From f20c5f761e571591324e738bcaa554d4579a5878 Mon Sep 17 00:00:00 2001 From: imedan Date: Thu, 5 Sep 2024 17:40:40 -0500 Subject: [PATCH] change rs_replace to grab designid_status version first --- bin/validate_designs_batches.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/bin/validate_designs_batches.py b/bin/validate_designs_batches.py index 183025f..7545f5a 100644 --- a/bin/validate_designs_batches.py +++ b/bin/validate_designs_batches.py @@ -556,10 +556,17 @@ def valid_design_func(file, exp, obsTime, field_desmodes, files = [] cache_files = [] for fid in fieldids: - files += [file for file in glob.glob(replace_path + - '{plan}_{fid}*.fits'.format( - plan=plan, - fid=fid))] + # try to grab to version with designid_status first + files_field = [file for file in glob.glob(replace_path + + '{plan}_{fid}*_designid_status.fits'.format( + plan=plan, + fid=fid))] + if len(files_field) == 0: + files_field = [file for file in glob.glob(replace_path + + '{plan}_{fid}*.fits'.format( + plan=plan, + fid=fid))] + files += files_field for f in files: if 'validation' in f: files.remove(f)