Skip to content

Commit

Permalink
include 5 and 6 orders (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
wtbarnes committed Mar 18, 2024
1 parent 88ea6ed commit 1e45e65
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
6 changes: 3 additions & 3 deletions mocksipipeline/instrument/configuration/moxsi_short.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
from mocksipipeline.instrument.optics.aperture import CircularAperture
from mocksipipeline.instrument.optics.configuration import short_design
from mocksipipeline.instrument.optics.filter import ThinFilmFilter
from mocksipipeline.instrument.optics.response import Channel
from mocksipipeline.instrument.optics.response import (ALLOWED_SPECTRAL_ORDERS,
Channel)

__all__ = [
'moxsi_short',
Expand Down Expand Up @@ -74,12 +75,11 @@
aperture=pinhole)

# Set up spectrograms
orders = [-4, -3, -2, -1, 0, 1, 2, 3, 4]
spectrogram_1_refpix = ((short_design.detector_shape[1] - 1) / 2,
(short_design.detector_shape[0] / 2 - 1) / 2,
0) * u.pix
spectrograms = []
for order in orders:
for order in ALLOWED_SPECTRAL_ORDERS:
chan = Channel(name='spectrogram_1',
order=order,
filters=[al_thin, al_oxide],
Expand Down
6 changes: 3 additions & 3 deletions mocksipipeline/instrument/configuration/moxsi_slot.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
SlotAperture)
from mocksipipeline.instrument.optics.configuration import short_design
from mocksipipeline.instrument.optics.filter import ThinFilmFilter
from mocksipipeline.instrument.optics.response import Channel
from mocksipipeline.instrument.optics.response import (ALLOWED_SPECTRAL_ORDERS,
Channel)

__all__ = [
'moxsi_slot',
Expand Down Expand Up @@ -83,10 +84,9 @@
aperture=pinhole)

# Set up spectrograms
orders = [-4, -3, -2, -1, 0, 1, 2, 3, 4]
spectrograms_pinhole = []
spectrograms_slot = []
for order in orders:
for order in ALLOWED_SPECTRAL_ORDERS:
spectrograms_pinhole.append(
Channel(name='spectrogram_pinhole',
order=order,
Expand Down
19 changes: 17 additions & 2 deletions mocksipipeline/instrument/optics/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,22 @@

from mocksipipeline.instrument.optics.filter import ThinFilmFilter

ALLOWED_SPECTRAL_ORDERS = [
-6,
-5,
-4,
-3,
-2,
-1,
0,
1,
2,
3,
4,
5,
6,
]

__all__ = [
'Channel',
]
Expand Down Expand Up @@ -96,8 +112,7 @@ def spectral_order(self):

@spectral_order.setter
def spectral_order(self, value):
allowed_spectral_orders = [-4, -3, -2, -1, 0, 1, 2, 3, 4]
if value not in allowed_spectral_orders:
if value not in ALLOWED_SPECTRAL_ORDERS:
raise ValueError(f'{value} is not an allowed spectral order.')
self._spectral_order = value

Expand Down

0 comments on commit 1e45e65

Please sign in to comment.