Skip to content

Commit

Permalink
let 'SPECTRA' instrument_types through (don't filter)
Browse files Browse the repository at this point in the history
1M0-NRES-SCICAM instruments are not of type IMAGE and were
being filtered from the returned instrument list. This was
preventing radial velocity and flux standards from being
submitted. (Issue with FLOYDS as well).
  • Loading branch information
phycodurus committed Sep 13, 2023
1 parent d16822e commit 6de874a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tom_observations/facilities/lco.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,11 +406,17 @@ def layout(self):
)

def get_instruments(self):
"""Filter the instruments from the OCSBaseObservationForm.get_instruments()
(i.e. the super class) in an LCO-specifc way.
"""
instruments = super().get_instruments()
return {
filtered_instruments = {
code: instrument for (code, instrument) in instruments.items() if (
'IMAGE' == instrument['type'] and 'MUSCAT' not in code and 'SOAR' not in code)
instrument['type'] in ['IMAGE', 'SPECTRA'] and (
'MUSCAT' not in code and
'SOAR' not in code))
}
return filtered_instruments

def all_optical_element_choices(self, use_code_only=False):
return sorted(set([
Expand All @@ -433,8 +439,8 @@ def _build_instrument_configs(self):
'filter': self.cleaned_data['filter']
}
}

return [instrument_config]
instrument_configs = [instrument_config]
return instrument_configs


class LCOFullObservationForm(OCSFullObservationForm):
Expand Down

0 comments on commit 6de874a

Please sign in to comment.