Description This subroutine calculates the real and imaginary amplitude and phase coefficients for a given wavelength, angle of incidence and arrays of refractive indices and thicknesses defining the thin film coating layers. This script command can be used inside of a user-scripted coating model in order to implement a thin film coating model with spatially varying layer thicknesses.
The wavelength and layer thickness values should have the same units, with the layer thickness values being physical thickness rather than optical thickness.
Syntax ThinFilmCoefficients sTreal, sTimag, pTreal, pTimag, sRreal, sRimag, pRreal, pRimag, cosAng, wavl, nIncReal, nIncImag, nSubReal, nSubImag, nStack(), kStack(), thickStack()
Parameters sTreal As Double After the subroutine execution, this argument holds the real S-polarization amplitude coefficient of the transmitted component.
sTimag As Double After the subroutine execution, this argument holds the imaginary S-polarization amplitude coefficient of the transmitted component.
pTreal As Double After the subroutine execution, this argument holds the real P-polarization amplitude coefficient of the transmitted component.
pTimag As Double After the subroutine execution, this argument holds the imaginary P-polarization amplitude coefficient of the transmitted component.
sRreal As Double After the subroutine execution, this argument holds the real S-polarization amplitude coefficient of the reflected component.
sRimag As Double After the subroutine execution, this argument holds the imaginary S-polarization amplitude coefficient of the reflected component.
pRreal As Double After the subroutine execution, this argument holds the real P-polarization amplitude coefficient of the reflected component.
pRimag As Double After the subroutine execution, this argument holds the imaginary P-polarization amplitude coefficient of the reflected component.
cosAng As Double Input cosine of the angle of incidence for which the coefficients will be calculated.
wavl As Double Wavelength for which the coefficients will be calculated. The units specifying the wavelength should be consistent with the units specifying the layer thickness.
nIncReal As Double Real part of the refractive index for the incident material.
nIncImag As Double Imaginary part of the refractive index for the incident material.
nSubReal As Double Real part of the refractive index for the substrate material.
nSubImag As Double Imaginary part of the refractive index for the substrate material.
nStack() As Double Array of real refractive index values for the thin film stack layers. Must have the same length as kStack() and thickStack().
kStack() As Double Array of imaginary refractive index values for the thin film stack layers. Must have the same length as nStack() and thickStack().
thickStack() As Double Array of thickness values for the thin film stack layers. Must have the same length as nStack() and kStack(). The layer thickness values should be specified in units of physical thickness (not optical), and have the same units as the wavl specification.
Example The following example demonstrates how this subroutine would be used in the context of a single layer thin film coating with a radially varying layer thickness. In this example, the implementation uses the user-scripted coating type.
Sub EvalCoating( ByVal g_x#, ByVal g_y#, ByVal g_z#, ByVal g_cos#, ByVal g_w#, ByVal g_n0#, ByVal g_n1#, ByVal g_k0#, ByVal g_k1#, ByVal g_refl As Boolean, ByRef g_magS#, ByRef g_magP#, ByRef g_phsS#, ByRef g_phsP# )
'Define the refractive index values for the thin film. In this example, 'we have a single quarter wave layer. Dim n(0) As Double, k(0) As Double, thick(0) As Double Dim zns As Long zns = FindMaterial( "ZnS" ) n(0) = RefractiveIndex( zns, g_w ) k(0) = RefractiveIndexImag( zns, g_w )
'Define the spatially varying thickness of the layers. Thickness should 'be provided in same units as the wavelength (microns). 'Example is cos^4 falloff Dim r_norm As Double, t0 As Double r_norm = 1.0 t0 = 0.0477386356571 thick(0) = t0*Cos( (PI()/2)*Sqr(g_x^2 + g_y^2)/r_norm )
'Call the ThinFilmCoefficients routine Dim sTreal As Double, sTimag As Double, pTreal As Double, pTimag As Double Dim sRreal As Double, sRimag As Double, pRreal As Double, pRimag As Double ThinFilmCoefficients( sTreal, sTimag, pTreal, pTimag, sRreal, sRimag, pRreal, pRimag, _ g_cos, g_w, g_n0, g_k0, g_n1, g_k1, n(), k(), thick() )
'Set reflection or refraction appropriately g_magS = Sqr( sTreal^2 + sTimag^2 ) g_phsS = Atn2( sTimag, sTreal ) g_magP = Sqr( pTreal^2 + pTimag^2 ) g_phsP = Atn2( pTimag, pTreal ) If g_refl Then g_magS = Sqr( sRreal^2 + sRimag^2 ) g_phsS = Atn2( sRimag, sRreal ) g_magP = Sqr( pRreal^2 + pRimag^2 ) g_phsP = Atn2( pRimag, pRreal ) End If
End Sub
See Also
|