materials.at_conditions#

Material at Conditions

This module contains the MaterialAtConditions class, which evaluates another material at a fixed temperature and pressure. It lets an optic be traced with its glasses at another temperature without passing the conditions through the ray trace.

Classes

MaterialAtConditions(material, temperature)

A material evaluated at a fixed temperature and pressure.

class MaterialAtConditions(material: BaseMaterial, temperature: float, pressure: float = 1.0, propagation_model: BasePropagationModel | None = None)[source]#

A material evaluated at a fixed temperature and pressure.

Every refractive index and extinction coefficient query is forwarded to the wrapped material with this wrapper’s temperature and pressure. The wrapper’s conditions always apply: keyword arguments given to n or k are not forwarded.

Only materials whose model depends on the conditions change with them. MaterialFile (and Material) applies the Schott dn/dT model when its data includes thermal coefficients. Materials that ignore temperature and pressure, such as IdealMaterial and AbbeMaterial, return their normal index.

Parameters:
  • material – The material to evaluate.

  • temperature – The temperature in degrees Celsius. Must be above absolute zero (-273.15 °C).

  • pressure – The ambient pressure in atmospheres. Must not be negative. Defaults to 1.0.

  • propagation_model – The propagation model to use for this material. If None, a default HomogeneousPropagation model is created.

Raises:
  • TypeError – If material is not a material.

  • ValueError – If temperature is not above absolute zero, or pressure is negative.

P_ref(wavelength: float)#

Calculate the relative partial dispersion at a reference wavelength.

The relative partial dispersion is defined as P_ref = (n_ref - n_D) / (n_F - n_C), where n_ref, n_D, n_F and n_C are the refractive indices at the reference wavelength, the D (587.5618 nm), F (486.1327 nm) and C (656.2725 nm) spectral lines, respectively.

Parameters:

wavelength (float) – The reference wavelength in microns.

PgF()#

Calculate the partial dispersion between the F and C lines.

The partial dispersion is defined as PgF = (n_g - n_F) / (n_F - n_C), where n_g, n_F, and n_C are the refractive indices at g (435.8343 nm), F (486.1327 nm), and C (656.2725 nm) spectral lines, respectively.

Returns:

The partial dispersion between the g and F lines.

Return type:

float

abbe() → float#

Calculate the Abbe number (Vd) of the material.

The Abbe number is a measure of the material’s dispersion, defined as Vd = (n_d - 1) / (n_F - n_C), where n_d, n_F, and n_C are the refractive indices at the Fraunhofer d (587.5618 nm), F (486.1327 nm), and C (656.2725 nm) spectral lines, respectively.

Returns:

The Abbe number of the material.

Return type:

float

dPgF()#

Calculate the deviation of the relative partial dispersion.

The deviation of the relative partial dispersion is defined as

dPgF = PgF - (0.6438 - 0.001682 Vd)

Returns:

The deviation of the relative partial dispersion.

Return type:

float

property display_name: str#

The wrapped material’s name with the conditions.

classmethod from_dict(data)[source]#

Creates a material from a dictionary representation.

Parameters:

data (dict) – The dictionary representation of the material.

Returns:

The material.

Return type:

MaterialAtConditions

k(wavelength: float | be.ndarray, **kwargs) → float | be.ndarray#

Calculates the extinction coefficient at a given wavelength with caching.

Parameters:
  • wavelength (float | be.ndarray) – The wavelength(s) of light in microns. Can be a float, numpy array, or torch tensor.

  • **kwargs – Additional keyword arguments for calculation.

Returns:

The extinction coefficient at the given wavelength(s).

Return type:

float | be.ndarray

property material: BaseMaterial#

The wrapped material.

n(wavelength: float | be.ndarray, **kwargs) → float | be.ndarray#

Calculates the refractive index at a given wavelength with caching.

Parameters:
  • wavelength (float | be.ndarray) – The wavelength(s) of light in microns. Can be a float, numpy array, or torch tensor.

  • **kwargs – Additional keyword arguments for calculation (e.g., temperature).

Returns:

The refractive index at the given wavelength(s).

Return type:

float | be.ndarray

property pressure: float#

The ambient pressure in atmospheres.

spectral_range(property_name: str = 'n') → tuple[float, float] | None[source]#

The wrapped material’s validity limits in micrometers, or None.

property temperature: float#

The temperature in degrees Celsius.

property thermal_expansion: float | None#

The wrapped material’s coefficient of thermal expansion, in 1/K.

None means the wrapped material has no CTE data, not that the CTE is zero.

to_dict()[source]#

Returns a dictionary representation of the material.

The wrapped material is stored with its own serialization.

Returns:

A dictionary representation of the material.

Return type:

dict