Skip to content

Commit df8037c

Browse files
authored
Added esis.optics.Sensor class. (#17)
1 parent 24b4fac commit df8037c

6 files changed

Lines changed: 66 additions & 1 deletion

File tree

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,5 @@
113113
'astropy': ('https://docs.astropy.org/en/stable/', None),
114114
'named_arrays': ('https://named-arrays.readthedocs.io/en/stable/', None),
115115
'optika': ('https://optika.readthedocs.io/en/stable/', None),
116+
'msfc_ccd': ('https://msfc-ccd.readthedocs.io/en/stable/', None),
116117
}

esis/optics/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from ._field_stops import FieldStop
99
from ._gratings import Grating
1010
from ._filters import Filter
11+
from ._sensors import Sensor
1112

1213
__all__ = [
1314
"abc",
@@ -18,4 +19,5 @@
1819
"FieldStop",
1920
"Grating",
2021
"Filter",
22+
"Sensor",
2123
]

esis/optics/_sensors/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from ._sensors import Sensor
2+
3+
__all__ = [
4+
"Sensor",
5+
]

esis/optics/_sensors/_sensors.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import dataclasses
2+
import astropy.units as u
3+
import named_arrays as na
4+
import optika
5+
import msfc_ccd
6+
from .. import mixins
7+
8+
__all__ = [
9+
"Sensor",
10+
]
11+
12+
13+
@dataclasses.dataclass(repr=False)
14+
class Sensor(
15+
optika.mixins.Printable,
16+
optika.mixins.Rollable,
17+
optika.mixins.Yawable,
18+
optika.mixins.Pitchable,
19+
optika.mixins.Translatable,
20+
mixins.CylindricallyTransformable,
21+
msfc_ccd.TeledyneCCD230,
22+
):
23+
"""A model of the CCD sensors used to detect light."""
24+
25+
distance_radial: u.Quantity | na.AbstractScalar = 0 * u.mm
26+
"""The distance between the axis of symmetry and the center of the detector."""
27+
28+
azimuth: u.Quantity | na.AbstractScalar = 0 * u.deg
29+
"""The angle that the detector has been rotated about the axis of symmetry."""
30+
31+
translation: u.Quantity | na.AbstractCartesian3dVectorArray = 0 * u.mm
32+
"""An additional translation vector."""
33+
34+
pitch: u.Quantity | na.AbstractScalar = 0 * u.deg
35+
"""The pitch angle of this sensor."""
36+
37+
yaw: u.Quantity | na.AbstractScalar = 0 * u.deg
38+
"""The yaw angle of this sensor."""
39+
40+
roll: u.Quantity | na.AbstractScalar = 0 * u.deg
41+
"""The roll angle of this sensor."""
42+
43+
position_image: u.Quantity | na.AbstractCartesian2dVectorArray = 0 * u.mm
44+
"""The position of the center of the FOV on the sensor for the target wavelength."""
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import pytest
2+
from msfc_ccd._tests.test_sensors import AbstractTestAbstractSensor
3+
import esis
4+
5+
6+
@pytest.mark.parametrize(
7+
argnames="sensor",
8+
argvalues=[
9+
esis.optics.Sensor(),
10+
],
11+
)
12+
class TestSensor(AbstractTestAbstractSensor):
13+
pass

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies = [
1818
"matplotlib",
1919
"astropy",
2020
"optika>=0.12.0",
21-
"msfc-ccd>=0.2.0",
21+
"msfc-ccd>=0.3.0",
2222
"aastex>=0.3.1",
2323
]
2424
dynamic = ["version"]

0 commit comments

Comments
 (0)