Skip to content

Commit

Permalink
Fixed bug where filename_parser may not parse out detector information
Browse files Browse the repository at this point in the history
  • Loading branch information
bourque committed Mar 19, 2021
1 parent 41b8457 commit 4ff3af7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions jwql/website/apps/jwql/data_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1169,8 +1169,14 @@ def thumbnails_ajax(inst, proposal=None):

# Extract information for sorting with dropdown menus
# (Don't include the proposal as a sorting parameter if the proposal has already been specified)
detectors = [data_dict['file_data'][rootname]['filename_dict']['detector'] for rootname in list(data_dict['file_data'].keys())]
proposals = [data_dict['file_data'][rootname]['filename_dict']['program_id'] for rootname in list(data_dict['file_data'].keys())]
detectors, proposals = [], []
for rootname in list(data_dict['file_data'].keys()):
proposals.append(data_dict['file_data'][rootname]['filename_dict']['program_id'])
try: # Some rootnames cannot parse out detectors
detectors.append(data_dict['file_data'][rootname]['filename_dict']['detector'])
except KeyError:
pass

if proposal is not None:
dropdown_menus = {'detector': detectors}
else:
Expand Down

0 comments on commit 4ff3af7

Please sign in to comment.