API Reference¶
This page contains autodocumented classes and functions from the PyEtalon package.
Etalon class¶
Etalon
¶
Etalon(materials: list[Material], material_names: list[str] | None, d_stack: list[float] | ndarray, idx_stack: list[int], wavelength_min: float | None = None, wavelength_max: float | None = None, wavelength: list[float] | ndarray = None, d_spacer: float = 0.01, aoi: float = 0.0, identifier: str = 'Etalon')
Class for modeling an etalon with a multilayer thin film stack.
Attributes:
-
materials–List of materials used in the stack
-
names–List of names of the materials
-
d_stack_design–List of layer thicknesses in [nm]
-
d_corrections–List of layer thickness corrections in [nm] - default is an array of zeros (same length as d_stack)
-
num_layers–Number of layers in the stack
-
identifier–Identifier for the etalon
-
wavelength_min–Minimum wavelength in [nm] (if not given, it is calculated from the wavelength vector)
-
wavelength_max–Maximum wavelength in [nm] (if not given, it is calculated from the wavelength vector)
-
wavelength–Wavelength vector in [nm]
-
normalized_wavelength–Normalized wavelength vector
-
aoi–Angle of incidence in [rad]
-
_d_spacer–Spacer thickness in [m] (incl. corrections if given)
-
d_spacer_correction–Spacer thickness correction in [nm] - default is 0.0
-
idx_stack–List of indices of the materials in the stack
-
_m–Peak order number
Parameters:
-
(materials¶list[Material]) –List of materials used in the stack
-
(material_names¶list[str] | None) –List of names of the materials
-
(d_stack¶list[float] | ndarray) –List of layer thicknesses in [nm]
-
(idx_stack¶list[int]) –List of indices of the materials in the stack
-
(wavelength_min¶float | None, default:None) –Minimum wavelength in [nm] (if not given, it is calculated from the wavelength vector)
-
(wavelength_max¶float | None, default:None) –Maximum wavelength in [nm] (if not given, it is calculated from the wavelength vector)
-
(wavelength¶list[float] | ndarray, default:None) –Wavelength vector in [nm]
-
(d_spacer¶float, default:0.01) –Spacer thickness in [m] (incl. corrections if given)
-
(aoi¶float, default:0.0) –Angle of incidence in [deg]
-
(identifier¶str, default:'Etalon') –Identifier for the etalon
Methods:
-
calculate_reflectivity_transmissivity–Calculate reflectivity and transmissivity from reflection and transmission coefficients.
-
get_refractive_index_cavity–Returns the refractive index of the cavity material
-
print_parameters–print parameters names and parameters and index in a table
-
print_parameters_horizontally–print index, parameter names and values in a table.
-
transmission_spectrum–Returns the transmission spectrum of the entire etalon for the given wavelength.
Source code in PyEtalon/etalon.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | |
coefficient_of_finesse
property
¶
coefficient_of_finesse
Returns the coefficient of finesse of the mirror coating stack
The coefficient of finesse is given by the formula:
F = 4 * R / (1 - R)^2
where: R: mirror reflectivity
d_stack_normalized
property
¶
d_stack_normalized
Returns the stack thickness normalized to the maximum thickness
fsr
property
¶
fsr
Return the real free spectral range in [GHz]
The free spectral range is given by the formula:
FSR [GHz] = c / (2 * n * d * cos(theta) - lambda^2 * 10^-9 / pi * dphi/dlambda)
see https://doi.org/10.1103/PhysRevA.37.1802
where: c: speed of light [m/s] n: refractive index of cavity material d: spacer thickness [m] theta: angle of incidence [rad] lambda: peak wavelength [nm] dphi/dlambda: derivative of phase with respect to wavelength [rad/nm]
The factor 10^-9 is used to convert the wavelength from nm to m. There is a factor of 10^-18 from lambda^2, but also a factor of 10^9 from the derivative of the phase. The factor of 10^-9 cancels out.
fsr_wavelength
property
¶
fsr_wavelength
Return the free spectral range in [nm]
ChatGPT gives me this as approximation (phase shift is a small correction to optical path)
FSR_lambda = lambda^2 / (2nL cos(theta)) (1+ (lambda^2/(2pi n L cos(theta)) dPhi/dlambda))
gdd_spline
property
¶
gdd_spline
Returns the group delay dispersion upon reflection in [fs^2] as a spline
ideal_fsr
property
¶
ideal_fsr: float
Return the ideal free spectral range in [GHz]
The ideal free spectral range is given by the formula:
FSR [GHz] = c / (2 * n * d * cos(theta))
where:
c: speed of light [m/s]
n: refractive index of cavity material
d: spacer thickness [m]
theta: angle of incidence [rad]
It neglects the phase shift upon reflection.
mirror_reflectivity
property
¶
mirror_reflectivity
Returns the reflectivity of the mirror coating stack
mirror_transmission
property
¶
mirror_transmission
Returns the transmission of the mirror coating stack
n_parameter
cached
property
¶
n_parameter
Total number of parameters
Number of layers + 1 for the spacer + number of coefficients for each coating material
num_material_coefficients
cached
property
¶
num_material_coefficients
Returns the total number of coefficients for all coating materials
The substrate and ambient material are not included.
phase
property
¶
phase
Returns the unwrapped phase shift upon reflection in [rad] as a function of wavelength
reflectivity_finesse
property
¶
reflectivity_finesse
Returns the reflectivity finesse of the mirror coating stack
The reflectivity finesse is given by the formula:
F = pi / (2 * arcsin(1 / sqrt(F)))
where: F: coefficient of finesse
calculate_reflectivity_transmissivity
¶
calculate_reflectivity_transmissivity() -> tuple[ndarray, ndarray]
Calculate reflectivity and transmissivity from reflection and transmission coefficients.
Returns:
-
tuple[ndarray, ndarray]–tuple[np.ndarray, np.ndarray]:ay of float64 values. - Transmissivity (T): 1D array of float64 values.
Source code in PyEtalon/etalon.py
476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 | |
get_refractive_index_cavity
¶
get_refractive_index_cavity(wl)
Returns the refractive index of the cavity material
Source code in PyEtalon/etalon.py
277 278 279 | |
print_parameters
¶
print_parameters()
print parameters names and parameters and index in a table
Source code in PyEtalon/etalon.py
366 367 368 369 370 371 372 373 | |
print_parameters_horizontally
¶
print_parameters_horizontally(values_only=False)
print index, parameter names and values in a table. First row contains index, second row contains name, third row contains all values. Fix the column width to 20 characters
Source code in PyEtalon/etalon.py
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 | |
transmission_spectrum
¶
transmission_spectrum(wavelength)
Returns the transmission spectrum of the entire etalon for the given wavelength.
The transmission spectrum is calculated as:
T = 1 / (1 + F * sin^2(pi * d / lambda + phi))
where: T: transmission spectrum F: coefficient of finesse d: spacer thickness lambda: wavelength phi: phase shift upon reflection
Parameters:
-
–wavelength¶Wavelength in [nm]
Source code in PyEtalon/etalon.py
707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 | |
Module-level utilities¶
guess_m
¶
guess_m(wavelength: float | ndarray, d: float = 0.00999, aoi: float = 0.0, n: float | Callable = 1.0, phase: Callable | None = None) -> tuple[int | ndarray, ndarray]
Guesses the peak number m for a given peak wavelength.
Parameters:
-
(wavelength¶float | ndarray) –peak wavelength in [nm]
-
(d¶float, default:0.00999) –spacer thickness in [m]
-
(aoi¶float, default:0.0) –angle of incidence in [rad]
-
(n¶float | Callable, default:1.0) –refractive index of cavity material
-
(phase¶Callable | None, default:None) –phase shift upon reflection in [rad]
Returns:
-
tuple[int | ndarray, ndarray]–guessed peak numbers, difference between integer and float peak numbers
Source code in PyEtalon/etalon.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | |
lambda_peaks
¶
lambda_peaks(m: int | ndarray, d: float = 0.00999, n: float | Callable = 1.0, aoi: float = 0.0, phase: None | Callable = None) -> float | ndarray
Returns peak wavelength for given etalon parameters
It uses the dispersion formula as given in https://doi.org/10.1364/AO.30.004126 Args: m: Diffraction order (int) or 1D array with 'int' type. d: physical mirror distance [m] n: Refractive index of medium in between mirrors aoi: Angle of incidence [rad] phase: Interpolation function f = phase_shift(wavelength[nm])
Returns:
-
float | ndarray–peak wavelength in [nm]
Source code in PyEtalon/etalon.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
Add additional modules or symbols as needed, for example:¶
rt
¶
Calculate the reflection and transmission coefficients for a multilayer.
Parameters:
-
(n¶ndarray) –2D array-like, shape (num_wavelengths, num_layers) Refractive indices for each layer and wavelength.
-
(d¶ndarray) –1D array-like, shape (num_layers) Thickness of each layer (units must match wavelength).
-
(wvl¶ndarray) –1D array-like, shape (num_wavelengths) Wavelengths of light (units must match thickness).
-
(aoi¶float, default:0.0) –float, optional Angle of incidence in degrees. Default is 0.0.
-
(pol¶int, default:0) –int, optional Polarization state, 0 for TE (s) or 1 for TM (p). Default is 0.
Returns:
-
r(ndarray) –1D array, shape (num_wavelengths) Reflection coefficients for each wavelength.
-
t(ndarray) –1D array, shape (num_wavelengths) Transmission coefficients for each wavelength.
Source code in PyEtalon/tmm.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |