-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathcauchy.py
More file actions
44 lines (36 loc) · 1.36 KB
/
cauchy.py
File metadata and controls
44 lines (36 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Encoding: utf-8
"""Cauchy dispersion."""
import numpy.typing as npt
from .base_dispersion import IndexDispersion
class Cauchy(IndexDispersion):
r"""Cauchy dispersion.
Single parameters:
:n0: Defaults to 1.5.
:n1: Defaults to 0. Unit in nm\ :sup:`2`.
:n2: Defaults to 0. Unit in nm\ :sup:`4`.
:k0: Defaults to 0.
:k1: Defaults to 0. Unit in nm\ :sup:`2`.
:k2: Defaults to 0. Unit in nm\ :sup:`4`.
Repeated parameters:
--
Output:
.. math::
\varepsilon^{1/2}(\lambda) = n(\lambda) =
\boldsymbol{n_0} + 100 \boldsymbol{n_1}/\lambda^2 + 10^7 \boldsymbol{n_2}/\lambda^4
+ i (\boldsymbol{k_0} + 100 \boldsymbol{k_1}/\lambda^2
+ 10^7 \boldsymbol{k_2}/\lambda^4)
"""
single_params_template = {"n0": 1.5, "n1": 0, "n2": 0, "k0": 0, "k1": 0, "k2": 0}
rep_params_template = {}
def refractive_index(self, lbda: npt.ArrayLike) -> npt.NDArray:
return (
self.single_params.get("n0")
+ 1e2 * self.single_params.get("n1") / lbda**2
+ 1e7 * self.single_params.get("n2") / lbda**4
+ 1j
* (
self.single_params.get("k0")
+ 1e2 * self.single_params.get("k1") / lbda**2
+ 1e7 * self.single_params.get("k2") / lbda**4
)
)