diff --git a/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb b/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb index 1c1cfae94189b2ef9b910933bdb6c83f495bc0cd..928f120d8e8c24f527558a6da8dc96d88c6c3224 100644 --- a/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb +++ b/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb @@ -72,6 +72,7 @@ "metadata": {}, "outputs": [], "source": [ + "import fnmatch\n", "import multiprocessing\n", "import sys\n", "import warnings\n", @@ -86,7 +87,7 @@ "import pasha as psh\n", "import tabulate\n", "from IPython.display import Latex, Markdown, display\n", - "from extra_data import H5File, RunDirectory, by_id, components\n", + "from extra_data import DataCollection, H5File, RunDirectory, by_id, components\n", "from extra_geom import JUNGFRAUGeometry\n", "from matplotlib.colors import LogNorm\n", "\n", @@ -479,6 +480,7 @@ "source": [ "# Loop over modules\n", "empty_seq = 0\n", + "corrected_files = []\n", "for local_karabo_da, mapped_files_module in mapped_files.items():\n", " instrument_src_kda = instrument_src.format(int(local_karabo_da[-2:]))\n", "\n", @@ -487,6 +489,7 @@ " # of corresponding raw sequence file.\n", " ofile_name = sequence_file.name.replace(\"RAW\", \"CORR\")\n", " out_file = out_folder / ofile_name\n", + " corrected_files.append(ofile_name)\n", "\n", " # Load sequence file data collection, data.adc keydata,\n", " # the shape for data to later created arrays of the same shape,\n", @@ -674,7 +677,10 @@ "source": [ "first_seq = 0 if sequences == [-1] else sequences[0]\n", "\n", - "with RunDirectory(out_folder, f\"*{run}*S{first_seq:05d}*\") as corr_dc:\n", + "corrected_files = [\n", + " out_folder / f for f in fnmatch.filter(corrected_files, f\"*{run}*S{first_seq:05d}*\")\n", + "]\n", + "with DataCollection.from_paths(corrected_files) as corr_dc:\n", " # Reading CORR data for plotting.\n", " jf_corr = components.JUNGFRAU(\n", " corr_dc,\n",