Materials#
- class ConstantMaterial#
Bases:
BaseMaterial- get_refractive_index(self: PyMieSim.material.ConstantMaterial, wavelength: object) object#
Retrieves the refractive index for a specific wavelength.
This method allows for querying the refractive index of the ConstantMaterial instance at a specific wavelength. Since the material has a constant refractive index, the provided wavelength does not affect the returned value. However, this method is included for consistency with other material types and to allow for potential future extensions where the refractive index might depend on wavelength.
- Parameters:
wavelength (Quantity) – The wavelength at which to retrieve the refractive index, provided as a quantity with appropriate units (e.g., nanometers, micrometers). This parameter is currently ignored since the refractive index is constant, but it is included for interface consistency.
- property refractive_index#
The constant refractive index of the material.
This property provides access to the constant refractive index of the ConstantMaterial instance. The refractive index is returned as a complex number, which can be used for calculations and analysis involving the material’s optical properties.
- class ConstantMedium#
Bases:
BaseMediumConstantMedium represents a medium with a constant refractive index.
This class allows for the definition of a medium with a constant refractive index, which does not depend on the wavelength. The class provides methods to initialize the medium and to retrieve the refractive index, which will always return the same value regardless of the wavelength.
- get_refractive_index(self: PyMieSim.material.ConstantMedium, wavelength: object) object#
Retrieves the refractive index for a given wavelength.
This method takes a wavelength as input and returns the constant refractive index of the medium. Since the refractive index is constant, the input wavelength does not affect the output value.
- property refractive_index#
The constant refractive index of the medium.
This property provides access to the constant refractive index value of the ConstantMedium instance, which can be used for analysis and representation purposes.
- class SellmeierMaterial#
Bases:
BaseMaterialSellmeierMaterial represents a material defined by the Sellmeier equation.
This class allows for the definition of a material whose refractive index is computed based on the Sellmeier equation, which is a common empirical relationship used to describe the wavelength dependence of the refractive index of transparent materials. The class provides methods to initialize the material and to get the refractive index for specific wavelengths.
- property allow_extrapolation#
Indicates whether extrapolation is allowed when computing the refractive index outside of the defined wavelength bounds.
This attribute provides access to the allow_extrapolation flag of the SellmeierMaterial instance, which determines whether the refractive index can be extrapolated beyond the specified wavelength bounds.
- property coefficients#
The coefficients used in the Sellmeier equation to compute the refractive index.
This attribute provides access to the coefficients of the SellmeierMaterial instance, which are used in the Sellmeier equation to calculate the refractive index based on the wavelength.
- property formula_type#
The type of Sellmeier formula to use for computing the refractive index.
This attribute provides access to the formula type of the SellmeierMaterial instance, which determines the specific Sellmeier equation used to calculate the refractive index.
- get_refractive_index(self: PyMieSim.material.SellmeierMaterial, wavelength: object) object#
Retrieves the refractive index for a given wavelength.
This method takes a wavelength as input and returns the corresponding refractive index of the material based on the Sellmeier equation. The wavelength is expected to be a quantity that can be converted to meters, and the method computes the refractive index accordingly.
- property name#
The name of the material.
This attribute provides access to the name of the SellmeierMaterial instance, which can be used for identification and representation purposes.
- property wavelength_bound#
The wavelength bounds for which the Sellmeier equation is valid.
This property provides access to the wavelength bounds of the SellmeierMaterial instance, which indicate the range of wavelengths (in meters) for which the Sellmeier equation is applicable. The bounds are returned as a quantity with units of meters.
- class SellmeierMedium#
Bases:
BaseMediumSellmeierMedium represents a medium whose refractive index is computed using a Sellmeier formula.
The Sellmeier formula is an empirical relationship that describes how the refractive index of a material varies with wavelength. It is commonly used in optics to model the dispersion of light in transparent materials.
The class provides methods to initialize the medium with specific parameters and to compute the refractive index for given wavelengths. It also includes properties to access the material’s name, coefficients, formula type, and wavelength bounds.
- property allow_extrapolation#
Whether to allow extrapolation outside the wavelength bounds.
This property indicates whether the SellmeierMedium should allow extrapolation of the refractive index calculation beyond the specified wavelength bounds. If set to True, the medium will provide refractive index values even for wavelengths outside the defined range, which may lead to less accurate results. If set to False, an error will be raised when attempting to calculate the refractive index for out-of-bounds wavelengths.
- property coefficients#
The coefficients used in the Sellmeier formula.
This property provides access to the coefficients of the Sellmeier medium, which are used in the Sellmeier formula to calculate the refractive index. The coefficients are typically provided as a list of floating-point numbers.
- property formula_type#
The type of Sellmeier formula to use.
This property indicates the specific type of Sellmeier formula that should be applied when calculating the refractive index. Common types include 1, 2, 5, and 6, each corresponding to a different mathematical form of the Sellmeier equation.
- get_refractive_index(self: PyMieSim.material.SellmeierMedium, wavelength: object) object#
Computes the refractive index for a given wavelength.
This method calculates the refractive index of the SellmeierMedium at a specified wavelength using the defined Sellmeier formula and coefficients. The input wavelength should be provided as a quantity with units (e.g., using Pint), and the method will handle the conversion to meters internally. The output is the computed refractive index, which may be a complex number depending on the material properties.
- Parameters:
wavelength (Quantity) – The wavelength at which to compute the refractive index. This should be a quantity with appropriate units (e.g., nanometers, micrometers, etc.) that can be converted to meters.
- property name#
The name of the Sellmeier medium.
This property provides access to the name of the Sellmeier medium, which is a string identifier for the material. The name can be used for reference and identification purposes when working with multiple materials in simulations or calculations.
- property wavelength_bound#
The wavelength bounds for the Sellmeier formula.
This property provides access to the lower and upper bounds of the wavelength range for which the Sellmeier formula is valid. The bounds are returned as a list of two floating-point numbers, representing the minimum and maximum wavelengths in meters. If no bounds were specified during initialization, this property will return an empty list.
- class TabulatedMaterial#
Bases:
BaseMaterialTabulatedMaterial represents a material defined by tabulated refractive index data.
This class allows for the definition of a material whose refractive index is defined by tabulated data, which consists of specific wavelength values and their corresponding refractive indices. The class provides methods to initialize the material, retrieve the refractive index for specific wavelengths, and access the material’s properties such as its name, the wavelengths for which data is available, and whether extrapolation is allowed when querying outside of the defined wavelength range.
- property allow_extrapolation#
Indicates whether extrapolation is allowed when computing the refractive index outside of the defined wavelength range.
This attribute indicates whether the TabulatedMaterial instance allows for extrapolation when querying the refractive index for wavelengths that fall outside of the defined range of wavelengths. If allow_extrapolation is set to True, the material will provide an extrapolated refractive index value based on the available data; if set to False, an error will be raised when attempting to query outside of the defined wavelength range.
- get_refractive_index(self: PyMieSim.material.TabulatedMaterial, wavelength: object) object#
Retrieves the refractive index for a specific wavelength.
This method allows for querying the refractive index of the TabulatedMaterial instance at a specific wavelength. The wavelength is provided as an argument, and the method returns the corresponding refractive index value. If the wavelength falls outside of the defined range and allow_extrapolation is set to False, an error will be raised.
- property name#
The name of the material.
This attribute holds the name of the TabulatedMaterial instance, which can be used for identification and representation purposes.
- property refractive_indices#
The refractive indices corresponding to the provided wavelengths.
This property provides access to the refractive index values that correspond to the wavelengths defined in the wavelengths property. The refractive indices are returned as a list of complex values, which can be used for analysis and interpolation of the material’s optical properties.
- property wavelengths#
The wavelengths for which the refractive index data is provided.
This property provides access to the wavelengths (in meters) for which the refractive index data of the TabulatedMaterial instance is defined. The wavelengths are returned as a list of values with appropriate units.
- class TabulatedMedium#
Bases:
BaseMediumTabulatedMedium represents a medium whose refractive index is defined by tabulated data.
This class allows for the definition of a medium based on tabulated values of refractive index at specific wavelengths. The refractive index can be interpolated for wavelengths within the range of the provided data, and optionally extrapolated outside that range if allowed. The class provides methods to initialize the medium and to retrieve the refractive index for given wavelengths.
- property allow_extrapolation#
Indicates whether extrapolation of the refractive index is allowed.
This property indicates whether the TabulatedMedium instance allows for extrapolation of the refractive index values outside the range of the provided wavelengths. If set to True, the get_refractive_index method will return extrapolated values for wavelengths outside the data range; if False, it will raise an error for such cases.
- get_refractive_index(self: PyMieSim.material.TabulatedMedium, wavelength: object) object#
Retrieves the refractive index for a given wavelength.
This method takes a wavelength as input and returns the corresponding refractive index. If the wavelength is within the range of the provided data, it will return an interpolated value. If the wavelength is outside the range and extrapolation is allowed, it will return an extrapolated value; otherwise, it will raise an error.
- Parameters:
wavelength (float) – The wavelength for which to retrieve the refractive index, in meters.
- Returns:
The refractive index corresponding to the given wavelength.
- Return type:
complex
- property name#
The name of the tabulated medium.
This property provides access to the name of the TabulatedMedium instance, which can be used for identification and representation purposes.
- property refractive_indices#
The refractive index values corresponding to the wavelengths.
This property returns a list of complex refractive index values that correspond to the wavelengths provided in the wavelengths property. These values can be used for interpolation and analysis of the medium’s optical properties.
- property wavelengths#
The wavelengths corresponding to the tabulated refractive index values.
This property returns a list of wavelengths for which the refractive index values are provided. The wavelengths are returned in meters, and can be used to understand the range of data available for the TabulatedMedium.
- print_available() None#
Prints the available materials in the PyOptik library.
This function retrieves and prints the list of available materials from the PyOptik library. It sets the appropriate flags to indicate that both tabulated and Sellmeier materials should be included in the output.