prysm.thinfilm¶
Tools for performing thin film calculations.
-
prysm.thinfilm.
brewsters_angle
(n0, n1, deg=True)¶ Compute the Brewster’s angle at a given interface.
- Parameters
n0 (float) – refractive index on the “left” of the boundary
n1 (float) – refractive index on the “right” of the boundary
deg (bool, optional) – if True, convert output to degrees
-
prysm.thinfilm.
critical_angle
(n0, n1, deg=True)¶ Minimum angle for total internal reflection at an interface.
- Parameters
n0 (float) – index of refraction of the “left” material
n1 (float) – index of refraction of the “right” material
- Returns
the angle in degrees at which TIR begins to occur
- Return type
float
-
prysm.thinfilm.
snell_aor
(n0, n1, theta, degrees=True)¶ Compute the angle of refraction using Snell’s law.
- Parameters
n0 (float) – index of refraction of the “left” material
n1 (float) – index of refraction of the “right” material
theta (float) – angle of incidence, in degrees if degrees=True
degrees (bool, optional) – if True, theta is interpreted as an angle in degrees
- Returns
angle of refraction
- Return type
float
-
prysm.thinfilm.
fresnel_rs
(n0, n1, theta0, theta1)¶ Compute the “r sub s” fresnel coefficient.
This is associated with reflection of the s-polarized electric field.
- Parameters
n0 (float) – refractive index of the “left” material
n1 (float) – refractive index of the “right” material
theta0 (float) – angle of incidence, radians
theta1 (float) – angle of reflection, radians
- Returns
the fresnel coefficient “r sub s”
- Return type
float
-
prysm.thinfilm.
fresnel_ts
(n0, n1, theta0, theta1)¶ Compute the “t sub s” fresnel coefficient.
This is associated with transmission of the s-polarized electric field.
- Parameters
n0 (float) – refractive index of the “left” material
n1 (float) – refractive index of the “right” material
theta0 (float) – angle of incidence, radians
theta1 (float) – angle of refraction, radians
- Returns
the fresnel coefficient “t sub s”
- Return type
float
-
prysm.thinfilm.
fresnel_rp
(n0, n1, theta0, theta1)¶ Compute the “r sub p” fresnel coefficient.
This is associated with reflection of the p-polarized electric field.
- Parameters
n0 (float) – refractive index of the “left” material
n1 (float) – refractive index of the “right” material
theta0 (float) – angle of incidence, radians
theta1 (float) – angle of reflection, radians
- Returns
the fresnel coefficient “r sub p”
- Return type
float
-
prysm.thinfilm.
fresnel_tp
(n0, n1, theta0, theta1)¶ Compute the “t sub p” fresnel coefficient.
This is associated with transmission of the p-polarized electric field.
- Parameters
n0 (float) – refractive index of the “left” material
n1 (float) – refractive index of the “right” material
theta0 (float) – angle of incidence, radians
theta1 (float) – angle of refraction, radians
- Returns
the fresnel coefficient “t sub p”
- Return type
float
-
prysm.thinfilm.
characteristic_matrix_p
(lambda_, d, n, theta)¶ Compute the characteristic matrix M_j^p for a layer of a material stack and p-polarized light.
Uses (4.49) to compute (4.55) from BYU optics book, edition 2015
- Parameters
lambda (float) – wavelength of light, microns
d (float) – thickness of the layer, microns
n (float or complex) – refractive index of the layer
theta (float) – angle of incidence, radians
- Returns
a 2x2 matrix
- Return type
numpy.array
-
prysm.thinfilm.
characteristic_matrix_s
(lambda_, d, n, theta)¶ Compute the characteristic matrix M_j^p for a layer of a material stack and s-polarized light.
Uses (4.49) to compute (4.55) from BYU optics book, edition 2015
- Parameters
lambda (float) – wavelength of light, microns
d (float) – thickness of the layer, microns
n (float or complex) – refractive index of the layer
theta (float) – angle of incidence, radians
- Returns
a 2x2 matrix
- Return type
numpy.array
-
prysm.thinfilm.
multilayer_matrix_p
(n0, theta0, characteristic_matrices, nnp1, theta_np1)¶ Reduce a multilayer problem to give the 2x2 matrix A^p.
Computes (4.58) from BYU optics book.
- Parameters
n0 (float or complex) – refractive index of the first medium
theta0 (float) – angle of incidence on the first medium, radians
characteristic_matrices (iterable of numpy.ndarray each of which of shape 2x2) – the characteristic matrices of each layer
nnp1 (float or complex) – refractive index of the final medium
theta_np1 (float) – angle of incidence on final medium, radians
- Returns
2x2 matrix A^s
- Return type
numpy.ndarray
-
prysm.thinfilm.
multilayer_matrix_s
(n0, theta0, characteristic_matrices, nnp1, theta_np1)¶ Reduce a multilayer problem to give the 2x2 matrix A^s.
Computes (4.62) from BYU optics book.
- Parameters
n0 (float or complex) – refractive index of the first medium
theta0 (float) – angle of incidence on the first medium, radians
characteristic_matrices (iterable of numpy.ndarray each of which of shape 2x2) – the characteristic matrices of each layer
nnp1 (float or complex) – refractive index of the final medium
theta_np1 (float) – angle of incidence on final medium, radians
- Returns
2x2 matrix A^s
- Return type
numpy.ndarray
-
prysm.thinfilm.
rtot
(Amat)¶ Compute rtot, the equivalent total fresnel coefficient for a multilayer stack.
- Parameters
Amat (numpy.ndarray) – 2x2 array
- Returns
the value of rtot, either s or p.
- Return type
float or complex
-
prysm.thinfilm.
ttot
(Amat)¶ Compute ttot, the equivalent total fresnel coefficient for a multilayer stack.
- Parameters
Amat (numpy.ndarray) – 2x2 array
- Returns
the value of rtot, either s or p.
- Return type
float or complex
-
prysm.thinfilm.
multilayer_stack_rt
(polarization, wavelength, stack, aoi=0, assume_vac_ambient=True)¶ Compute r and t for a given stack of materials.
An infinitely thick layer of vacuum is assumed if assume_vac_ambient is True
- Parameters
polarization (str, {‘p’, ‘s’}) – the polarization state
stack (Iterable of Iterable) – iterable of tuples, which looks like [(n1, t1), (n2, t2) …] where n is the index and t is the thickness in microns
wavelength (float) – wavelength of light, microns
aoi (float, optional) – angle of incidence, degrees
assume_vac_ambient (bool, optional) – if True, prepends an infinitely thick layer of vacuum to the stack if False, prepend the ambient index but NOT a thickness
- Returns
r, t coefficients
- Return type
(float, float)