recovering from missing smalldata

This commit is contained in:
2023-04-03 15:38:58 +02:00
parent 6f64e38906
commit 70410fad72

View File

@@ -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