AbstractChemical#

class optika.chemicals.AbstractChemical[source]#

Bases: Printable, Shaped

Interface defining the optical constants for a given chemical.

Attributes

file_nk

The path to the Windt [1998] file containing the index of refaction, \(n\), and the wavenumber, \(k\).

formula

the empirical formula of the chemical compound.

formula_latex

LaTeX representation of the chemical formula, with appropriate subscripts.

is_amorphous

Boolean flag controlling whether the chemical is amorphous or crystalline.

shape

The array shape of this object.

table

Name of the table of chemical constants.

Methods

__init__()

absorption(wavelength)

The absorption coefficient of this chemical for the given wavelength.

index_refraction(wavelength)

The index of refraction of this chemical for the given wavelength.

n(wavelength)

The complex index of refaction of this chemical for a given wavelength

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.

wavenumber(wavelength)

The wavenumber of this chemical for the given wavelength.

Inheritance Diagram

Inheritance diagram of optika.chemicals.AbstractChemical
absorption(wavelength)[source]#

The absorption coefficient of this chemical for the given wavelength.

Parameters:

wavelength (Quantity | AbstractScalar) – The wavelength of light in vacuum for which to compute the absorption coefficient.

index_refraction(wavelength)[source]#

The index of refraction of this chemical for the given wavelength.

Parameters:

wavelength (Quantity | AbstractScalar)

Return type:

AbstractScalar

n(wavelength)[source]#

The complex index of refaction of this chemical for a given wavelength

Parameters:

wavelength (Quantity | AbstractScalar)

Return type:

AbstractScalar

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.

Parameters:

prefix (None | str) – an optional string, the length of which is used to calculate how much whitespace to add to the result.

Return type:

str

wavenumber(wavelength)[source]#

The wavenumber of this chemical for the given wavelength.

Parameters:

wavelength (Quantity | AbstractScalar)

Return type:

AbstractScalar

property file_nk: ScalarArray#

The path to the Windt [1998] file containing the index of refaction, \(n\), and the wavenumber, \(k\).

abstract property formula: str | AbstractScalar#

the empirical formula of the chemical compound.

For example, water would be expressed as "H2O" and hydrogen peroxide would be expressed as "H2O2".

property formula_latex: str#

LaTeX representation of the chemical formula, with appropriate subscripts.

abstract property is_amorphous: bool#

Boolean flag controlling whether the chemical is amorphous or crystalline.

abstract property shape: dict[str, int]#

The array shape of this object.

abstract property table: None | str#

Name of the table of chemical constants.