diff --git a/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb b/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb index 17f443b9756df72851ab97e0b3ffdc2b1eb0c0d4..af760de939525527b65357d040a75a6fa2360b46 100644 --- a/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb +++ b/notebooks/Jungfrau/Jungfrau_Gain_Correct_and_Verify_NBC.ipynb @@ -441,7 +441,9 @@ " module_no = int(karabo_da[-2:])\n", " params_source = f'{karabo_id}/ROIPROC/{karabo_da}'\n", " rois_source = f'{params_source}:output'\n", - " \n", + " # Create Instrument and Control sections to later add datasets.\n", + " outp_source = ofile.create_instrument_source(rois_source)\n", + " ctrl_source = ofile.create_control_source(params_source)\n", " for i in range(len(roi_definitions) // 6):\n", " roi_module, a1, a2, b1, b2, mean_axis = roi_definitions[i*6 : (i+1)*6]\n", " if roi_module == module_no:\n", @@ -451,13 +453,12 @@ " axis=mean_axis, where=(mask_corr[..., a1:a2, b1:b2] == 0)\n", " )\n", "\n", - " # Create Instrument section to later add corrected datasets.\n", - " outp_source = ofile.create_instrument_source(rois_source)\n", + " # Add roi corrected datasets\n", " outp_source.create_key(f'data.roi{rois_defined}.data', data=roi_data)\n", "\n", - " ctrl_source = ofile.create_control_source(params_source)\n", - " ctrl_source.create_run_key('region', np.array([[a1, a2, b1, b2]]))\n", - " ctrl_source.create_run_key('reduce_axis', np.array([mean_axis]))\n", + " # Add roi run control datasets.\n", + " ctrl_source.create_run_key(f'roi{rois_defined}.region', np.array([[a1, a2, b1, b2]]))\n", + " ctrl_source.create_run_key(f'roi{rois_defined}.reduce_axis', np.array([mean_axis]))\n", " \n", " if rois_defined:\n", " # Copy the index for the new source\n",