Skip to content

Commit

Permalink
Merge pull request #1651 from bhilbert4/filter-wfss-source-specific-f…
Browse files Browse the repository at this point in the history
…iles

Exclude source-specific WFSS files from observation page
  • Loading branch information
mfixstsci authored Oct 22, 2024
2 parents 640ceeb + ff83362 commit 2d655d8
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions 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,27 +2193,22 @@ 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)
if filename_dict['recognized_filename']:
# Weed out file types that are not supported by generate_preview_images
if 'stage_3' in filename_dict['filename_type']:
continue

else:
# Temporary workaround for noncompliant files in filesystem
filename_dict = {'activity': rootname[17:19],
'detector': rootname[26:],
'exposure_id': rootname[20:25],
'observation': rootname[7:10],
'parallel_seq_id': rootname[16],
'program_id': rootname[2:7],
'visit': rootname[10:13],
'visit_group': rootname[14:16],
'group_root': rootname[:26]}
logging.warning((f'While running thumbnails_ajax() on rootname {rootname}, '
'filename_parser() failed to recognize the file pattern.'))
# Skip over files not recognized by the filename_parser
continue

# 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 2d655d8

Please sign in to comment.