See the Github description for more detail.
I wrote this python script while working on our ellipsometry results during the analysis process. I also used this on some unpublished work we did modelling a metasurface as a 2d surface susceptibility, which is superior to effective medium modelling in some ways. Scattering matrices can still be used with such a model, in which the metasurface is treated as an interface that supports a surface current.
Part of the calculated full scattering matrix for a three layer system (described on Github):