The SpectralData Class¶
Spectral data is use to define data with an associated spectrum. Typically objects of this class will be generated by a parent MaterialData class which handles one or more spectral data classes in order to provide both real and imaginary parts of optical parameters.
Full API¶
describes spectrally dependent data
spectral_data implements the abstract base class SpectralData which defines a material parameter which has a spectral dependence (e.g. refractive index, permittivity). Each of the subclasses must implement the evaluate method which returns the material parameter for a given Spectrum object.
Classes¶
- SpectralData
- abstract base class
- Constant: SpectralData
- for values that are independent of the spectrum
- Interpolation: SpectralData
- for tabulated data values
- Model: SpectralData
- abstract base class for values generated from a particular model
- Sellmeier: Model
- implements the Sellmeier model for refractive index
- Sellmeier2: Model
- implements the modified Sellmeier model for refractive index
- Polynomial: Model
- implements a polynomial model for refractive index
- RefractiveIndexInfo: Model
- implements the RefractiveIndexInfo model for refractive index
- Cauchy: Model
- implements the Cauchy model for refractive index
- Gases: Model
- implements the Gas model for refractive index
- Herzberger: Model
- implements the Herzberger model for refractive index
- Retro: Model
- implements the Retro model for refractive index
- Exotic: Model
- implements the Exotic model for refractive index
- Drude: Model
- implements the Drude model for complex permittivity
- DrudeLorentz: Model
- implements the Drude-Lorentz model for complex permittivity
- TaucLorentz: Model
- implements the Tauc-Lorentz model for complex permittivity
Notes¶
for more information on models see https://refractiveindex.info/about
-
class
spectral_data.
Cauchy
(model_parameters, valid_range, spectrum_type='wavelength', unit='m')¶ requires wavelength input in micrometers returns real part of refractive index only
Methods
dict_repr
(self)return a dictionary representation of the object evaluate
(self, spectrum)returns the value of the spectral data for the given spectrum input_output
(self)defines the required inputs and the output spectrum type preprocess
(self, spectrum)check range of spectrum, convert to correct sType and unit and return an object with the same tensor order (scalar|vector) with values set to 1.0 suggest_spectrum
(self)for plotting the spectral data we take a geometrically spaced set of values validate_spectrum_type -
evaluate
(self, spectrum)¶ returns the value of the spectral data for the given spectrum
-
-
class
spectral_data.
Constant
(constant, valid_range=(0, inf), spectrum_type='wavelength', unit='m')¶ for spectral data values that are independent of the spectrum
Methods
dict_repr
(self)return a dictionary representation of the object evaluate
(self, spectrum)returns the value of the spectral data for the given spectrum suggest_spectrum
(self)for plotting the spectral data we take a geometrically spaced set of values -
dict_repr
(self)¶ return a dictionary representation of the object
-
evaluate
(self, spectrum)¶ returns the value of the spectral data for the given spectrum
-
-
class
spectral_data.
Drude
(model_parameters, valid_range, spectrum_type='wavelength', unit='m')¶ requires energy input in eV returns real and imaginary parts of permittivity
Methods
dict_repr
(self)return a dictionary representation of the object evaluate
(self, spectrum)returns the value of the spectral data for the given spectrum input_output
(self)defines the required inputs and the output spectrum type preprocess
(self, spectrum)check range of spectrum, convert to correct sType and unit and return an object with the same tensor order (scalar|vector) with values set to 1.0 suggest_spectrum
(self)for plotting the spectral data we take a geometrically spaced set of values validate_spectrum_type -
evaluate
(self, spectrum)¶ returns the value of the spectral data for the given spectrum
-
-
class
spectral_data.
DrudeLorentz
(model_parameters, valid_range, spectrum_type='wavelength', unit='m')¶ requires energy input in eV returns real and imaginary parts of permittivity
Methods
dict_repr
(self)return a dictionary representation of the object evaluate
(self, spectrum)returns the value of the spectral data for the given spectrum input_output
(self)defines the required inputs and the output spectrum type preprocess
(self, spectrum)check range of spectrum, convert to correct sType and unit and return an object with the same tensor order (scalar|vector) with values set to 1.0 suggest_spectrum
(self)for plotting the spectral data we take a geometrically spaced set of values validate_spectrum_type -
evaluate
(self, spectrum)¶ returns the value of the spectral data for the given spectrum
-
-
class
spectral_data.
Exotic
(model_parameters, valid_range, spectrum_type='wavelength', unit='m')¶ requires wavelength input in micrometers returns real part of refractive index only
Methods
dict_repr
(self)return a dictionary representation of the object evaluate
(self, spectrum)returns the value of the spectral data for the given spectrum input_output
(self)defines the required inputs and the output spectrum type preprocess
(self, spectrum)check range of spectrum, convert to correct sType and unit and return an object with the same tensor order (scalar|vector) with values set to 1.0 suggest_spectrum
(self)for plotting the spectral data we take a geometrically spaced set of values validate_spectrum_type -
evaluate
(self, spectrum)¶ returns the value of the spectral data for the given spectrum
-
-
class
spectral_data.
Extrapolation
(spectral_data, extended_spectrum, spline_order=2)¶ for extending spectral data outside of the valid range. Use with caution
Methods
evaluate
(self, spectrum)returns the value of the spectral data for the fiven spectrum extrapolate_data
(self)makes a spline base on the base data for future lookup get_extrap_spectrum
(self, extended_spectrum)takes a Spectrum object with one or two values possibly lying outside the base spectral range. suggest_spectrum
(self)for plotting the spectral data we take a geometrically spaced set of values validate_extrap_val
(self, extrap_val, base_range)checks if extrap_val lies outside base_range and replaces the relevant value in base_range with extrap_val. -
evaluate
(self, spectrum)¶ returns the value of the spectral data for the fiven spectrum
-
extrapolate_data
(self)¶ makes a spline base on the base data for future lookup
-
get_extrap_spectrum
(self, extended_spectrum)¶ takes a Spectrum object with one or two values possibly lying outside the base spectral range. Raises an error if the values do not lie outside the base spectral range. returns a new length two spectrum that gives the lower and upper bound for an extrapolation
-
validate_extrap_val
(self, extrap_val, base_range)¶ checks if extrap_val lies outside base_range and replaces the relevant value in base_range with extrap_val.
-
-
class
spectral_data.
Fano
(model_parameters, valid_range, spectrum_type='wavelength', unit='m')¶ this model can be applied to scattering cross sections requires energy input in eV returns real and imaginary parts of scattering cross section
Methods
dict_repr
(self)return a dictionary representation of the object evaluate
(self, spectrum)returns the value of the spectral data for the given spectrum input_output
(self)defines the required inputs and the output spectrum type preprocess
(self, spectrum)check range of spectrum, convert to correct sType and unit and return an object with the same tensor order (scalar|vector) with values set to 1.0 suggest_spectrum
(self)for plotting the spectral data we take a geometrically spaced set of values validate_spectrum_type -
evaluate
(self, spectrum)¶ returns the value of the spectral data for the given spectrum
-
input_output
(self)¶ defines the required inputs and the output spectrum type
-
-
class
spectral_data.
Gases
(model_parameters, valid_range, spectrum_type='wavelength', unit='m')¶ requires wavelength input in micrometers returns real part of refractive index only
Methods
dict_repr
(self)return a dictionary representation of the object evaluate
(self, spectrum)returns the value of the spectral data for the given spectrum input_output
(self)defines the required inputs and the output spectrum type preprocess
(self, spectrum)check range of spectrum, convert to correct sType and unit and return an object with the same tensor order (scalar|vector) with values set to 1.0 suggest_spectrum
(self)for plotting the spectral data we take a geometrically spaced set of values validate_spectrum_type -
evaluate
(self, spectrum)¶ returns the value of the spectral data for the given spectrum
-
-
class
spectral_data.
Herzberger
(model_parameters, valid_range, spectrum_type='wavelength', unit='m')¶ requires wavelength input in micrometers returns real part of refractive index only
Methods
dict_repr
(self)return a dictionary representation of the object evaluate
(self, spectrum)returns the value of the spectral data for the given spectrum input_output
(self)defines the required inputs and the output spectrum type preprocess
(self, spectrum)check range of spectrum, convert to correct sType and unit and return an object with the same tensor order (scalar|vector) with values set to 1.0 suggest_spectrum
(self)for plotting the spectral data we take a geometrically spaced set of values validate_spectrum_type -
evaluate
(self, spectrum)¶ returns the value of the spectral data for the given spectrum
-
-
class
spectral_data.
Interpolation
(data, spectrum_type='wavelength', unit='m', interp_order=1)¶ for spectral data values that are from tabulated data
Methods
dict_repr
(self)return a dictionary representation of the object evaluate
(self, spectrum)returns the value of the spectral data for the fiven spectrum interpolate_data
(self)interpolates the data for future lookup suggest_spectrum
(self)for plotting the spectral data we take a geometrically spaced set of values -
dict_repr
(self)¶ return a dictionary representation of the object
-
evaluate
(self, spectrum)¶ returns the value of the spectral data for the fiven spectrum
-
interpolate_data
(self)¶ interpolates the data for future lookup
-
-
class
spectral_data.
Model
(model_parameters, valid_range, spectrum_type='wavelength', unit='m')¶ for spectral data values depending on model parameters
Methods
dict_repr
(self)return a dictionary representation of the object evaluate
(self, spectrum)returns the value of the spectral data for the given spectrum input_output
(self)defines the required inputs and the output spectrum type preprocess
(self, spectrum)check range of spectrum, convert to correct sType and unit and return an object with the same tensor order (scalar|vector) with values set to 1.0 suggest_spectrum
(self)for plotting the spectral data we take a geometrically spaced set of values validate_spectrum_type -
dict_repr
(self)¶ return a dictionary representation of the object
-
evaluate
(self, spectrum)¶ returns the value of the spectral data for the given spectrum
-
input_output
(self)¶ defines the required inputs and the output spectrum type
-
preprocess
(self, spectrum)¶ check range of spectrum, convert to correct sType and unit and return an object with the same tensor order (scalar|vector) with values set to 1.0
-
-
class
spectral_data.
Polynomial
(model_parameters, valid_range, spectrum_type='wavelength', unit='m')¶ requires wavelength input in micrometers returns real part of refractive index only
Methods
dict_repr
(self)return a dictionary representation of the object evaluate
(self, spectrum)returns the value of the spectral data for the given spectrum input_output
(self)defines the required inputs and the output spectrum type preprocess
(self, spectrum)check range of spectrum, convert to correct sType and unit and return an object with the same tensor order (scalar|vector) with values set to 1.0 suggest_spectrum
(self)for plotting the spectral data we take a geometrically spaced set of values validate_spectrum_type -
evaluate
(self, spectrum)¶ returns the value of the spectral data for the given spectrum
-
-
class
spectral_data.
RefractiveIndexInfo
(model_parameters, valid_range, spectrum_type='wavelength', unit='m')¶ requires wavelength input in micrometers returns real part of refractive index only
Methods
dict_repr
(self)return a dictionary representation of the object evaluate
(self, spectrum)returns the value of the spectral data for the given spectrum input_output
(self)defines the required inputs and the output spectrum type preprocess
(self, spectrum)check range of spectrum, convert to correct sType and unit and return an object with the same tensor order (scalar|vector) with values set to 1.0 suggest_spectrum
(self)for plotting the spectral data we take a geometrically spaced set of values validate_spectrum_type -
evaluate
(self, spectrum)¶ returns the value of the spectral data for the given spectrum
-
-
class
spectral_data.
Retro
(model_parameters, valid_range, spectrum_type='wavelength', unit='m')¶ requires wavelength input in micrometers returns real part of refractive index only
Methods
dict_repr
(self)return a dictionary representation of the object evaluate
(self, spectrum)returns the value of the spectral data for the given spectrum input_output
(self)defines the required inputs and the output spectrum type preprocess
(self, spectrum)check range of spectrum, convert to correct sType and unit and return an object with the same tensor order (scalar|vector) with values set to 1.0 suggest_spectrum
(self)for plotting the spectral data we take a geometrically spaced set of values validate_spectrum_type -
evaluate
(self, spectrum)¶ returns the value of the spectral data for the given spectrum
-
-
class
spectral_data.
Sellmeier
(model_parameters, valid_range, spectrum_type='wavelength', unit='m')¶ requires wavelength input in micrometers returns real part of refractive index only
Methods
dict_repr
(self)return a dictionary representation of the object evaluate
(self, spectrum)returns the value of the spectral data for the given spectrum input_output
(self)defines the required inputs and the output spectrum type preprocess
(self, spectrum)check range of spectrum, convert to correct sType and unit and return an object with the same tensor order (scalar|vector) with values set to 1.0 suggest_spectrum
(self)for plotting the spectral data we take a geometrically spaced set of values validate_spectrum_type -
evaluate
(self, spectrum)¶ returns the value of the spectral data for the given spectrum
-
-
class
spectral_data.
Sellmeier2
(model_parameters, valid_range, spectrum_type='wavelength', unit='m')¶ requires wavelength input in micrometers returns real part of refractive index only
Methods
dict_repr
(self)return a dictionary representation of the object evaluate
(self, spectrum)returns the value of the spectral data for the given spectrum input_output
(self)defines the required inputs and the output spectrum type preprocess
(self, spectrum)check range of spectrum, convert to correct sType and unit and return an object with the same tensor order (scalar|vector) with values set to 1.0 suggest_spectrum
(self)for plotting the spectral data we take a geometrically spaced set of values validate_spectrum_type -
evaluate
(self, spectrum)¶ returns the value of the spectral data for the given spectrum
-
-
class
spectral_data.
SpectralData
(valid_range, spectrum_type='wavelength', unit='nm')¶ Base class for defining a quantity (e.g. refactive index) which is defined over a given spectrum (see class Spectrum).
Methods
evaluate
(self, spectrum)returns the value of the spectral data for the given spectrum suggest_spectrum
(self)for plotting the spectral data we take a geometrically spaced set of values -
evaluate
(self, spectrum)¶ returns the value of the spectral data for the given spectrum
-
suggest_spectrum
(self)¶ for plotting the spectral data we take a geometrically spaced set of values
-
-
class
spectral_data.
TaucLorentz
(model_parameters, valid_range, spectrum_type='wavelength', unit='m')¶ requires energy input in eV returns real and imaginary parts of permittivity
Methods
dict_repr
(self)return a dictionary representation of the object evaluate
(self, spectrum)returns the value of the spectral data for the given spectrum input_output
(self)defines the required inputs and the output spectrum type preprocess
(self, spectrum)check range of spectrum, convert to correct sType and unit and return an object with the same tensor order (scalar|vector) with values set to 1.0 suggest_spectrum
(self)for plotting the spectral data we take a geometrically spaced set of values validate_spectrum_type -
evaluate
(self, spectrum)¶ returns the value of the spectral data for the given spectrum
-