brandondube / prysm

physical optics: integrated modeling, phase retrieval, segmented systems, polynomials and fitting, sequential raytracing...
https://prysm.readthedocs.io/en/stable/
MIT License
262 stars 45 forks source link

Debug films #99

Closed Jashcraf closed 1 year ago

Jashcraf commented 1 year ago

A couple changes. We discovered in #92 that at non-normal AOI multilayer_stack_rt produces incorrect results. This was due to a bug that resulted in part of the computation for the first layer being skipped. We simplified the calculation to make sure that this didn't happen and tested it against Filmetrics data and poke.thinfilms.compute_thin_films_broadcasted, and they all agree (to the extent that Filmetrics refractive index data agrees with refractiveindex.info).

It was also noted that it would be useful to remove the polarization kwarg, in lieu of returning "reflection" or "transmission", or both. But before this proceeds I wanted to mark this issue as closed and pronounce the function "fixed" as far as I can tell.

Filmetrics Test

image

Poke Rs Test

image