Skip to content

Commit

Permalink
Merge 872d017 into 98a21f9
Browse files Browse the repository at this point in the history
  • Loading branch information
jnation3406 committed Jul 17, 2019
2 parents 98a21f9 + 872d017 commit 414d2fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions observation_portal/common/configdb.py
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion observation_portal/requestgroups/views.py
Expand Up @@ -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),
Expand Down

0 comments on commit 414d2fc

Please sign in to comment.