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

remove grating for FLOYDS observations. #693

Merged
merged 4 commits into from
Oct 4, 2023
Merged
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
7 changes: 7 additions & 0 deletions tom_observations/facilities/lco.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,10 @@ def __init__(self, *args, **kwargs):
help_text='Rotation angle of slit. Only for Floyds `Slit Position Angle` rotator mode',
label='Rotator Angle', required=False
)
# Add None option and help text for SOAR Gratings
if self.fields.get(f'c_{j+1}_ic_{i+1}_grating', None):
self.fields[f'c_{j+1}_ic_{i+1}_grating'].help_text = 'Only for SOAR'
self.fields[f'c_{j+1}_ic_{i+1}_grating'].choices.insert(0, ('None', 'None'))
self.fields[f'c_{j+1}_ic_{i+1}_slit'].help_text = 'Only for Floyds'

def convert_old_observation_payload_to_fields(self, data):
Expand Down Expand Up @@ -725,6 +729,9 @@ def _build_instrument_config(self, instrument_type, configuration_id, id):
if instrument_config['rotator_mode'] == 'SKY':
instrument_config['extra_params'] = {'rotator_angle': self.cleaned_data.get(
f'c_{configuration_id}_ic_{id}_rotator_angle', 0)}
if 'FLOYDS' in instrument_type.upper():
# Remove grating from FLOYDS requests
instrument_config['optical_elements'].pop('grating', None)
# Clear out the optical elements for NRES
elif 'NRES' in instrument_type.upper():
instrument_config['optical_elements'] = {}
Expand Down
Loading