Skip to content
Snippets Groups Projects

[JUNGFRAU][CORRECT][ROI] Fix storing multiple ROIs Instrument datasets and run keys

Merged Karim Ahmed requested to merge fix/Trying_to_recreate_Instrument/Control/sections into master
1 unresolved thread
1 file
+ 7
6
Compare changes
  • Side-by-side
  • Inline
@@ -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",
Loading