Skip to content

Commit

Permalink
Renamed the axis_layers argument of `optika.materials.multilayer_ef…
Browse files Browse the repository at this point in the history
…ficiency()` to `axis`.
  • Loading branch information
byrdie committed Jan 29, 2024
1 parent 3286570 commit 86b3f57
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
13 changes: 6 additions & 7 deletions optika/materials/_multilayers.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
def multilayer_efficiency(
n: na.AbstractScalar,
thickness: na.AbstractScalar,
axis_layers: str,
axis: str,
wavelength_ambient: u.Quantity | na.AbstractScalar,
direction_ambient: na.AbstractCartesian3dVectorArray,
n_ambient: complex | na.AbstractScalar,
Expand All @@ -36,7 +36,7 @@ def multilayer_efficiency(
The complex index of refraction for each layer
thickness
An array of thicknesses for each layer.
axis_layers
axis
The logical axis along which the different layers are distributed.
wavelength_ambient
The wavelength of the incident light in the ambient medium.
Expand Down Expand Up @@ -85,7 +85,7 @@ def multilayer_efficiency(
reflectivity, transmissivity = optika.materials.multilayer_efficiency(
n=n,
thickness=thickness,
axis_layers="layer",
axis="layer",
wavelength_ambient=wavelength,
direction_ambient=na.Cartesian3dVectorArray(0, 0, 1),
n_ambient=1,
Expand Down Expand Up @@ -146,7 +146,7 @@ def multilayer_efficiency(
reflectivity, transmissivity = optika.materials.multilayer_efficiency(
n=n,
thickness=thickness,
axis_layers="layer",
axis="layer",
wavelength_ambient=wavelength,
direction_ambient=na.Cartesian3dVectorArray(0, 0, 1),
n_ambient=1,
Expand Down Expand Up @@ -210,7 +210,7 @@ def multilayer_efficiency(
reflectivity, transmissivity = optika.materials.multilayer_efficiency(
n=n,
thickness=thickness,
axis_layers="layer",
axis="layer",
wavelength_ambient=wavelength,
direction_ambient=na.Cartesian3dVectorArray(0, 0, 1),
n_ambient=1,
Expand Down Expand Up @@ -367,7 +367,6 @@ def multilayer_efficiency(
shape_layers = na.shape_broadcasted(n, thickness)
n = n.broadcast_to(shape_layers)
thickness = thickness.broadcast_to(shape_layers)
axis = axis_layers

wavelength = wavelength_ambient * np.real(n_ambient)

Expand Down Expand Up @@ -569,7 +568,7 @@ def transmissivity(
reflectivity, transmissivity = multilayer_efficiency(
n=n,
thickness=self.thickness_layers,
axis_layers=self.axis_layers,
axis=self.axis_layers,
wavelength_ambient=wavelength,
direction_ambient=rays.direction,
n_ambient=n_ambient,
Expand Down
12 changes: 6 additions & 6 deletions optika/materials/_tests/test_multilayers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


@pytest.mark.parametrize(
argnames="n,thickness,axis_layers",
argnames="n,thickness,axis",
argvalues=[
(
optika.chemicals.Chemical(
Expand Down Expand Up @@ -66,7 +66,7 @@
def test_multilayer_efficiency(
n: na.AbstractScalarArray,
thickness: na.AbstractScalarArray,
axis_layers: str,
axis: str,
wavelength_ambient: u.Quantity | na.AbstractScalar,
direction_ambient: na.AbstractCartesian3dVectorArray,
n_ambient: complex | na.AbstractScalar,
Expand All @@ -77,7 +77,7 @@ def test_multilayer_efficiency(
reflected, transmitted = optika.materials.multilayer_efficiency(
n=n,
thickness=thickness,
axis_layers=axis_layers,
axis=axis,
wavelength_ambient=wavelength_ambient,
direction_ambient=direction_ambient,
n_ambient=n_ambient,
Expand All @@ -100,7 +100,7 @@ def test_multilayer_efficiency(
"file",
"material_layers",
"thickness",
"axis_layers",
"axis",
"direction_ambient",
"n_ambient",
"material_substrate",
Expand Down Expand Up @@ -147,7 +147,7 @@ def test_multilayer_transmissivity_vs_file(
file: pathlib.Path,
material_layers: na.AbstractScalarArray,
thickness: na.AbstractScalarArray,
axis_layers: str,
axis: str,
direction_ambient: na.AbstractCartesian3dVectorArray,
n_ambient: complex | na.AbstractScalar,
material_substrate: str,
Expand All @@ -168,7 +168,7 @@ def test_multilayer_transmissivity_vs_file(
reflectivity, transmissivity = optika.materials.multilayer_efficiency(
n=optika.chemicals.Chemical(material_layers).n(wavelength_ambient),
thickness=thickness,
axis_layers=axis_layers,
axis=axis,
wavelength_ambient=wavelength_ambient,
direction_ambient=direction_ambient,
n_ambient=n_ambient,
Expand Down
2 changes: 1 addition & 1 deletion optika/sensors/_materials/_materials.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def quantum_efficiency_effective(
reflectivity, transmissivity = optika.materials.multilayer_efficiency(
n=n,
thickness=na.stack([thickness_oxide], axis="_layer"),
axis_layers="_layer",
axis="_layer",
wavelength_ambient=wavelength,
direction_ambient=direction,
n_ambient=n_ambient,
Expand Down

0 comments on commit 86b3f57

Please sign in to comment.