Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include 5th and 6th orders in spectrogram modeling #34

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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