From a69a0cfa0d9bdc66de9d9c8884c036beb242bb9b Mon Sep 17 00:00:00 2001 From: Bryan Hilbert Date: Wed, 16 Oct 2024 16:42:01 -0400 Subject: [PATCH] Exclude source-specific WFSS files from observation page --- jwql/website/apps/jwql/data_containers.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/jwql/website/apps/jwql/data_containers.py b/jwql/website/apps/jwql/data_containers.py index 218488c42..732165d99 100644 --- a/jwql/website/apps/jwql/data_containers.py +++ b/jwql/website/apps/jwql/data_containers.py @@ -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 @@ -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) @@ -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:], @@ -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.