Python implementation of Berreman's 4x4 matrix method