OpticSim.jl icon indicating copy to clipboard operation
OpticSim.jl copied to clipboard

Unintuitive API of FresnelInterface

Open cdhf opened this issue 4 years ago • 3 comments

The reflectance and and transmission fields in FresnelInterface API are very unintuitive for me.

I initially assumed that these could be used to approximate coatings, in the case where you only have a single number specification by the coating manufacturer.

If reflectance/transmission are at their default value, the interface behaves like an uncoated surface. Let's say I have uncoated Fresnel losses of 10%, and I coat the surface to reduce reflection to 4%. I would expect to model this by setting reflectance to 0.04 and transmission to 0.96, and get attenuation of the reflected and transmitted rays at the surface by the same value.

But the code to calculate attenuation at the interface uses both the Fresnel coefficients and the user supplied reflectance/transmission.

# TODO - this is an approximation (total hack) for now until we get better modeling of thin film reflectors, antireflection coatings, etc.
powᵣ = max(powᵣ, reflectance(opticalinterface)) * internal_trans
powₜ = powₜ * transmission(opticalinterface) * internal_trans

So in my example, to simulate my specified coating performance of T=0.96, I would actually have to set the transmission of the FresnelInterface to a value > 1, but that's not allowed. So it seems I cannot model an AR coating at all. And for a high reflective coating I would not be able to model leakage through the mirror correctly.

I think that FresnelInterface should not have any transmission/reflectance field at all. It might simply be called UncoatedInterface in this case. The important special case of coatings specified by simple transmission/reflection number at some typical angle of incidence range should probably be a completely separate class.

cdhf avatar May 06 '21 19:05 cdhf

@cdhf Yes, the api is unintuitive. The reflectance/transmission field was a stopgap measure to make it possible to model partially mirrored surfaces without going into the full complexity of figuring out how to structure an api that would let you stack multiple optical interfaces into a single composite interface. This way you could make multiple layer interference filters, partially mirror a Fresnel interface, etc.

This is something that's been on our to do list for a while but we don't have much expertise in thin film optics. If you are an expert in thin film optical filters, a la this book, then we'd love to hear your ideas about what algorithms to use and how to organize the api.

BrianGun avatar May 06 '21 23:05 BrianGun

@BrianGun It's been over a decade since I've done thin film simulations, but I can look up what I did back then, and I know a coating expert who may be able to help with the physics.

I think that specifying a transmission/reflection in the constructor of interfaces is not a bad thing, since in many cases you do not have a coating design to make a detailed simulation. It is just that for the FresnelInterface, the transmission and reflection that are given in the constructor do not reflect the actual transmission and reflection coefficients that are actually simulated.

Let me think about an API for this problem for a few days that is comprehensive enough to model the use cases I know of.

cdhf avatar May 07 '21 08:05 cdhf

@cdhf that would be super! This would be a very useful, powerful enhancement.

At the least we should make it easy to add single layer antireflection coatings since otherwise scattering simulations won't reflect the real world performance of your optical system.

BrianGun avatar May 07 '21 20:05 BrianGun