Skip to content

Commit 4d6d6a5

Browse files
committed
Move segm files to the end so we don't create thumbnails from them
1 parent a0a05e4 commit 4d6d6a5

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

jwql/jwql_monitors/generate_preview_images.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -834,8 +834,14 @@ def process_program(program, overwrite, level3_only):
834834
filenames = filtered_filenames
835835

836836
# Sort in order to help keep track of thumbnail production for level 3 files
837+
# By sorting in reverse, we'll preferentially make thumbnails for x1d files if present,
838+
# which seems like a nice way to distinguish from level 2 thumbanils.
837839
filenames = sorted(filenames, reverse=True)
838840

841+
# Move segm.fits files to the end of the list, because we don't really want thumbnails from
842+
# these, unless there are no other suffixes available for a given rootname
843+
filenames.sort(key=lambda f: f.endswith('_segm.fits'))
844+
839845
# Dictionary to track whether a thumbnail has been created for a level 3 rootname
840846
# Keys are rootnames, values are booleans describing whether a thumbail image has been made
841847
thumbs = {}

0 commit comments

Comments
 (0)