Sellmeier2¶
- class dnois.mt.Sellmeier2(name: str, a: float, b1: float, b2: float, wl1: float, wl2: float, min_wl: float = None, max_wl: float = None, default_unit: str = 'um')¶
Materials described by Sellmeier2 formula:
\[n^2-1=A+\frac{B_1\lambda^2}{\lambda^2-\lambda_1^2}+\frac{B_2}{\lambda^2-\lambda_2^2}\]- Parameters:
a (float) – \(A\) in Sellmeier2 formula.
b1 (float) – \(B_1\) in Sellmeier2 formula.
b2 (float) – \(B_2\) in Sellmeier2 formula.
wl1 (float) – \(\lambda_1\) in Sellmeier2 formula.
wl2 (float) – \(\lambda_2\) in Sellmeier2 formula.
See
Material
for descriptions for other parameters.- classmethod from_dict(d: dict) Self ¶
Constructs an instance of
cls
from adict
.- Parameters:
d (dict) – A
dict
typically returned byto_dict()
.- Returns:
An instance of
cls
.
- classmethod load_json(file, **kwargs) Self ¶
Constructs an instance of
cls
through loading JSON from a file, converting it to adict
and then callingfrom_dict()
.- Parameters:
file (str or
pathlib.Path
or file-like object) – The JSON file to load. Either its path (str
orpathlib.Path
) or a file-like object.kwargs – Keyword arguments passed to
json.load()
.
- Returns:
An instance of
cls
.
- n(wl: Real | Tensor) Real | Tensor ¶
Computes refractive index.
- Parameters:
wavelength – Value of wavelength.
- Type:
float or Tensor
- Returns:
Refractive index.
- Return type:
float or Tensor
- save_json(file, **kwargs)¶
Save
self
into a JSON filefile
.- Parameters:
file – The JSON file to save. Either its path (
str
orpathlib.Path
) or a file-like object.kwargs – Keyword arguments passed to
json.dump()
.
- to_dict(keep_tensor: bool = True) dict[str, Any] ¶
Converts
self
into adict
which recursively contains only primitive Python objects.- Return type:
dict
- to_json(**kwargs) str ¶
Converts
self
into a JSON string.- Parameters:
kwargs – Keyword arguments passed to
json.dumps()
.- Return type:
str
- a_pp¶
\(A+1\) in Sellmeier2 formula.
- b1¶
\(B_1\) in Sellmeier2 formula.
- b2¶
\(B_2\) in Sellmeier2 formula.
- default_unit¶
Default unit.
- max_wl¶
Maximum wavelength valid for the material.
- min_wl¶
Minimum wavelength valid for the material.
- name¶
Name of the material.
- swl1¶
\(\lambda_1^2\) in Sellmeier2 formula.
- swl2¶
\(\lambda_2^2\) in Sellmeier2 formula.