Skip to content

Commit

Permalink
Exclude source-specific WFSS files from observation page
Browse files Browse the repository at this point in the history
  • Loading branch information
bhilbert4 committed Oct 16, 2024
1 parent 640ceeb commit a69a0cf
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion jwql/website/apps/jwql/data_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2144,7 +2144,7 @@ def thumbnails_ajax(inst, proposal, obs_num=None):
----------
inst : str
Name of JWST instrument
proposal : str (optional)
proposal : str
Number of APT proposal to filter
obs_num : str (optional)
Observation number
Expand Down Expand Up @@ -2193,6 +2193,12 @@ def thumbnails_ajax(inst, proposal, obs_num=None):
# Gather data for each rootname, and construct a list of all observations
# in the proposal
for rootname in rootnames:
# Skip over unsupported filenames
# e.g. jw02279-o001_s000... are spec2 products for WFSS with one file per source
# Any filename with a dash after the proposal number is either this spec2 product
# or a level 3 product
if f'jw{proposal}-' in rootname:
continue

# Parse filename
filename_dict = filename_parser(rootname)
Expand All @@ -2202,6 +2208,9 @@ def thumbnails_ajax(inst, proposal, obs_num=None):
continue

else:
# Skip over files not recognized by the filename_parser
continue
'''
# Temporary workaround for noncompliant files in filesystem
filename_dict = {'activity': rootname[17:19],
'detector': rootname[26:],
Expand All @@ -2214,6 +2223,7 @@ def thumbnails_ajax(inst, proposal, obs_num=None):
'group_root': rootname[:26]}
logging.warning((f'While running thumbnails_ajax() on rootname {rootname}, '
'filename_parser() failed to recognize the file pattern.'))
'''

# Get list of available filenames and exposure start times. All files with a given
# rootname will have the same exposure start time, so just keep the first.
Expand Down

0 comments on commit a69a0cf

Please sign in to comment.