[AGIPD][CORR] exit notebook if no correction files found for the selected sequence
Description
This is a fix for a reported bug last week for AGIPD correction. https://git.xfel.eu/calibration/pycalibration/-/issues/70
If particular sequence files had no images, hence no correction files were stored the slurm job will error out with the below message.
This MR skip plotting instead in that case. As I didn't see a need to plot even the RAW trains.
How Has This Been Tested?
Relevant Documents (optional)
-------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-30-937af97297a2> in <module>
1 include = '*S00000*' if sequences is None else f'*S{sequences[0]:05d}*'
----> 2 tid, corrected = get_trains_data(out_folder, 'image.data', include, karabo_id, modules=nmods)
3
4 _, gains = get_trains_data(out_folder, 'image.gain', include, karabo_id, tid,modules=nmods)
5 _, mask = get_trains_data(out_folder, 'image.mask', include, karabo_id, tid,modules=nmods)
<ipython-input-28-d1b3e36b439a> in get_trains_data(data_folder, source, include, detector_id, tid, modules, fillvalue)
9 :param path: Path to find image data inside h5 file
10 """
---> 11 run_data = RunDirectory(data_folder, include)
12 if tid is not None:
13 tid, data = run_data.select(
~/proj/pycalibration/.venv/lib/python3.8/site-packages/extra_data/reader.py in RunDirectory(path, include, file_filter, inc_suspect_trains, parallelize, _use_voview)
1383 sel_files = file_filter(files)
1384 if not sel_files:
-> 1385 raise FileNotFoundError(
1386 f"No HDF5 files found in {path} with glob pattern {include}")
1387
FileNotFoundError: No HDF5 files found in /gpfs/exfel/exp/SPB/202301/p003373/scratch/pycal/proc/r0143 with glob pattern *S00005*
Types of changes
- Bug fix (non-breaking change which fixes an issue)