MeasuredMirror#
- class optika.materials.MeasuredMirror(efficiency_measured, substrate=None, serial_number=None)[source]#
Bases:
AbstractMirrorA mirror where the reflectivity has been measured by an external source as a function of wavelength.
Examples
Create a mirror where the reflectivity is a Gaussian centered at 304 Angstroms.
import numpy as np import matplotlib.pyplot as plt import astropy.units as u import astropy.visualization import named_arrays as na import optika # Define the mean and standard deviation of the reflectivity peak. center = 304 * u.AA width = 10 * u.AA # Define a grid of wavelengths wavelength_min = center - 3 * width wavelength_max = center + 3 * width wavelength = na.linspace( start=wavelength_min, stop=wavelength_max, axis="wavelength", num=11, ) # Define an array of simulated reflectivity measurements efficiency = na.FunctionArray( inputs=na.SpectralDirectionalVectorArray( wavelength=wavelength, direction=na.Cartesian3dVectorArray(0, 0, 1), ), outputs=np.exp(-np.square((wavelength - center) / width) / 2), ) # Create an instance of a MeasuredMirror object mirror = optika.materials.MeasuredMirror(efficiency) # Define a new grid of wavelengths at which to evaluate the interpolated # reflectivity wavelength_interp = na.linspace( start=wavelength_min, stop=wavelength_max, axis="wavelength", num=1001, ) # Evaluate the interpolated reflectivity efficiency_interp = mirror.efficiency( rays=optika.rays.RayVectorArray( wavelength=wavelength_interp, direction=na.Cartesian3dVectorArray(0, 0, 1), ), normal=na.Cartesian3dVectorArray(0, 0, 1), ) # Plot the interpolated reflectivity vs the measured reflectivity with astropy.visualization.quantity_support(): fig, ax = plt.subplots() na.plt.plot(wavelength_interp, efficiency_interp, label="interpolated"); na.plt.scatter(efficiency.inputs.wavelength, efficiency.outputs, label="measured"); ax.set_xlabel(f"wavelength ({ax.xaxis.get_label().get_text()})"); ax.set_ylabel(f"reflectivity"); ax.legend();
Attributes
A function array that maps wavelengths and incidence angles to the measured reflectivity.
flag controlling whether this material reflects or transmits light
A unique number associated with this material
The array shape of this object.
A layer representing the substrate supporting the reflective surface.
the coordinate transformation between the global coordinate system and this object's local coordinate system
Methods
__init__(efficiency_measured[, substrate, ...])attenuation(rays)the attenuation coefficient of the given rays
efficiency(rays, normal)The fraction of light that passes through the interface.
index_refraction(rays)the index of refraction of this material for the given input rays
to_string([prefix])Public-facing version of the
__repr__method that allows for defining a prefix string, which can be used to calculate how much whitespace to add to the beginning of each line of the result.Inheritance Diagram

- Parameters:
efficiency_measured (FunctionArray[SpectralDirectionalVectorArray, AbstractScalar])
substrate (None | Layer)
serial_number (None | str | AbstractArray)
- attenuation(rays)#
the attenuation coefficient of the given rays
- Parameters:
rays (RayVectorArray) – input rays to calculate the attenuation coefficient for
- Return type:
- efficiency(rays, normal)[source]#
The fraction of light that passes through the interface.
- Parameters:
rays (RayVectorArray) – the input rays to calculate the efficiency for
normal (AbstractCartesian3dVectorArray) – the vector perpendicular to the optical surface
- Return type:
- index_refraction(rays)#
the index of refraction of this material for the given input rays
- Parameters:
rays (RayVectorArray) – input rays used to evaluate the index of refraction
- Return type:
- to_string(prefix=None)#
Public-facing version of the
__repr__method that allows for defining a prefix string, which can be used to calculate how much whitespace to add to the beginning of each line of the result.
- efficiency_measured: FunctionArray[SpectralDirectionalVectorArray, AbstractScalar] = <dataclasses._MISSING_TYPE object>#
A function array that maps wavelengths and incidence angles to the measured reflectivity.
- serial_number: None | str | AbstractArray = None#
A unique number associated with this material