xopto.materials.ri.base module

class RefractiveIndex(t=293, trange: Optional[Tuple[float, float]] = None, wrange: Optional[Tuple[float, float]] = None)[source]

Bases: object

Base class of refractive index.

Parameters
  • t (float) – Default medium temperature.

  • trange (Tuple[float, float] or None) – Valid temperature range in K as (min, max).

  • wrange (Tuple[float, float] or None) – Valid wavelength range in nm as (min, max).

check_temperature(t: float)[source]

Checks if the temperature of medium is within the valid range.

Parameters

temperature (float or np.ndarray) – Temperature(s) to check.

Note

Reports a warning if the temperature of the medium is not within the valid range. If the temperature input argument is a numpy array, the call reports a warning if any of the temperatures are not within the valid range.

check_wavelengths(w: float)[source]

Checks if the wavelength of light is within the valid range.

Parameters

wavelength (float or np.ndarray) – Wavelength(s) to check.

Note

Reports a warning if the wavelength of light is not within the valid range. If the wavelength input argument is a numpy array, the call reports a warning if any of the wavelengths are not within the valid range.

is_valid_temperature(temperature: float)bool[source]

Checks if the temperature of the medium is within the valid range.

Parameters

temperature (float or np.ndarray) – Temperature to check.

Returns

valid – Returns True if the temperature is within the valid range. If the temperature input argument is a numpy array, the call returns True only if all the temperatures are within the valid range.

Return type

bool

is_valid_wavelength(wavelength: float)bool[source]

hecks if the wavelength of light is within the valid range.

Parameters

wavelength (float or np.ndarray) – Wavelength(s) to check.

Returns

valid – Returns True if the wavelength is within the valid range. If the wavelength input argument is a numpy array, the call returns True only if all the wavelengths are within the valid range.

Return type

bool

plot(temperature=None, **kwargs)[source]

Plot the wavelength dependence of the refractive index at the given temperature.

Parameters
  • temperature (float or None) – Temperature of the medium or None. Default medium temperature is used if None.

  • kwargs (dict) – Keyword arguments passed to the __call__ method of the instance.

property t: float

Default temperature of the material in K.

property temperature: float

Default temperature of the material in K.

property trange: Tuple[float, float]

Valid temperature range in K.

property wrange: Tuple[float, float]

Valid wavelength range in K.