Skip to content

Commit 1739ee5

Browse files
authored
Added AbstractSensor.width_active property. (#35)
1 parent 509f8dd commit 1739ee5

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

msfc_ccd/_sensors.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ def num_pixel_active(self):
5252
def width_pixel(self) -> u.Quantity:
5353
"""The physical size of a single pixel on the imaging sensor."""
5454

55+
@property
56+
def width_active(self):
57+
"""The physical size of the light sensitive area of the sensor."""
58+
result = self.width_pixel * self.num_pixel_active
59+
return result.to(u.mm)
60+
5561
@property
5662
@abc.abstractmethod
5763
def num_blank(self) -> int:

msfc_ccd/_tests/test_sensors.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ def test_serial_number(self, sensor: msfc_ccd.abc.AbstractSensor):
2525
def test_width_pixel(self, sensor: msfc_ccd.abc.AbstractSensor):
2626
assert sensor.width_pixel > 0 * u.um
2727

28+
def test_width_active(self, sensor: msfc_ccd.abc.AbstractSensor):
29+
assert sensor.width_active > 0 * u.um
30+
2831
def test_num_pixels(self, sensor: msfc_ccd.abc.AbstractSensor):
2932
assert sensor.num_pixel.x > 0
3033
assert sensor.num_pixel.y > 0

0 commit comments

Comments
 (0)