Skip to content

Commit

Permalink
remove grating for FLOYDS observations.
Browse files Browse the repository at this point in the history
  • Loading branch information
jchate6 committed Sep 28, 2023
1 parent b3a7470 commit 3fc2504
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tom_observations/facilities/lco.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,9 @@ 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
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 +728,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

0 comments on commit 3fc2504

Please sign in to comment.