From 70410fad72ec39317d90b500cd6e477917c06299 Mon Sep 17 00:00:00 2001 From: Alexander Steppke Date: Mon, 3 Apr 2023 15:38:58 +0200 Subject: [PATCH] recovering from missing smalldata --- src/cristallina/utils.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/cristallina/utils.py b/src/cristallina/utils.py index e665a9c..a131060 100644 --- a/src/cristallina/utils.py +++ b/src/cristallina/utils.py @@ -17,10 +17,13 @@ def scan_info(run_number, base_path=None, small_data=True): scan = SFScanInfo(f"{base_path}run{run_number:04}/meta/scan.json") - if small_data: - for i in range(len(scan.readbacks)): - sd_path_for_step=heuristic_extract_smalldata_path()+'run'+str(run_number).zfill(4)+'/acq'+str(i+1).zfill(4)+'.smalldata.h5' - scan.info['scan_files'][i].append(sd_path_for_step) + try: + if small_data: + for i in range(len(scan.readbacks)): + sd_path_for_step=heuristic_extract_smalldata_path()+'run'+str(run_number).zfill(4)+'/acq'+str(i+1).zfill(4)+'.smalldata.h5' + scan.info['scan_files'][i].append(sd_path_for_step) + except KeyError: + logger.warn("Failed to load smalldata.") return scan