diff --git a/observation_portal/common/configdb.py b/observation_portal/common/configdb.py index e88fef21..7c182647 100644 --- a/observation_portal/common/configdb.py +++ b/observation_portal/common/configdb.py @@ -463,6 +463,12 @@ def get_instrument_type_full_name(self, instrument_type): return instrument['science_camera']['camera_type']['name'] return instrument_type + def get_instrument_type_telescope_class(self, instrument_type): + for instrument in self.get_instruments(): + if instrument_type.upper() == instrument['science_camera']['camera_type']['code'].upper(): + return instrument['__str__'].split('.')[2][0:3] + return instrument_type[0:3] + def get_active_instrument_types(self, location: dict) -> set: """Get the available instrument_types. diff --git a/observation_portal/requestgroups/views.py b/observation_portal/requestgroups/views.py index ef1ab3cd..1f15aa4f 100644 --- a/observation_portal/requestgroups/views.py +++ b/observation_portal/requestgroups/views.py @@ -187,7 +187,7 @@ def get(self, request): for instrument_type in configdb.get_active_instrument_types({}): info[instrument_type] = { 'type': 'SPECTRA' if configdb.is_spectrograph(instrument_type) else 'IMAGE', - 'class': instrument_type[0:3], + 'class': configdb.get_instrument_type_telescope_class(instrument_type), 'name': configdb.get_instrument_type_full_name(instrument_type), 'optical_elements': configdb.get_optical_elements(instrument_type), 'modes': configdb.get_modes_by_type(instrument_type),