Skip to content

Commit

Permalink
Added esis.flights.f1.optics.filters.materials.thin_film_design() f…
Browse files Browse the repository at this point in the history
…actory function.
  • Loading branch information
byrdie committed Mar 19, 2024
1 parent bc48294 commit 663b898
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 0 deletions.
1 change: 1 addition & 0 deletions esis/flights/f1/optics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@

from . import primaries
from . import gratings
from . import filters
from . import models
5 changes: 5 additions & 0 deletions esis/flights/f1/optics/filters/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""
Models of thin-film filters used to block visible light
"""

from . import materials
5 changes: 5 additions & 0 deletions esis/flights/f1/optics/filters/materials/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""
Models of the visible light filter materials.
"""

from ._materials import *
65 changes: 65 additions & 0 deletions esis/flights/f1/optics/filters/materials/_materials.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import astropy.units as u
import optika

__all__ = ["thin_film_design"]


def thin_film_design() -> optika.materials.ThinFilmFilter:
"""
The as-designed thin-film visible light filter material for the ESIS instrument.
Examples
--------
Plot the transmissivity of the thin-film filter over the EUV wavelength
range.
.. jupyter-execute::
import matplotlib.pyplot as plt
import astropy.units as u
import astropy.visualization
import named_arrays as na
import optika
from esis.flights.f1.optics import filters
# Define an array of wavelengths with which to sample the efficiency
wavelength = na.geomspace(100, 1000, axis="wavelength", num=1001) * u.AA
# Define the incident rays from the wavelength array
rays = optika.rays.RayVectorArray(
wavelength=wavelength,
direction=na.Cartesian3dVectorArray(0, 0, 1),
)
# Initialize the ESIS diffraction grating material
material = filters.materials.thin_film_design()
# Compute the reflectivity of the primary mirror
transmissivity = material.efficiency(
rays=rays,
normal=na.Cartesian3dVectorArray(0, 0, -1),
)
# Plot the transmissivity vs wavelength
fig, ax = plt.subplots(constrained_layout=True)
na.plt.plot(wavelength, transmissivity, ax=ax);
ax.set_xlabel(f"wavelength ({wavelength.unit:latex_inline})");
ax.set_ylabel("transmissivity");
"""

return optika.materials.ThinFilmFilter(
layer=optika.materials.Layer(
chemical="Al",
thickness=100 * u.nm,
),
layer_oxide=optika.materials.Layer(
chemical="Al2O3",
thickness=4 * u.nm,
),
mesh=optika.materials.meshes.Mesh(
chemical="Ni",
efficiency=0.82,
pitch=70 / u.imperial.inch,
),
)
7 changes: 7 additions & 0 deletions esis/flights/f1/optics/filters/materials/_materials_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import optika
import esis


def test_thin_film_design():
r = esis.flights.f1.optics.filters.materials.thin_film_design()
assert isinstance(r, optika.materials.ThinFilmFilter)

0 comments on commit 663b898

Please sign in to comment.