Skip to content
Snippets Groups Projects

[LPD][Dark] fix: Remove hard check for consistent gain pixels

Merged Karim Ahmed requested to merge fix/remove_hard_check into master
All threads resolved!
1 file
+ 3
0
Compare changes
  • Side-by-side
  • Inline
@@ -248,7 +248,11 @@
" cid_arr = cid_arr[:-drop_last_frames_parallelgain]\n",
" \n",
" tids_by_cell_pattern.setdefault(tuple(cid_arr), []).append(tid)\n",
" \n",
"\n",
" if not tids_by_cell_pattern:\n",
" warning(\"No cell ID patterns were found.\")\n",
" return None, None\n",
"\n",
" most_common, sel_tids = max(tids_by_cell_pattern.items(), key=lambda p: len(p[1]))\n",
" \n",
" if len(sel_tids) <= (0.5 * len(cell_ids.train_ids)):\n",
@@ -272,6 +276,8 @@
" run = RunDirectory(run_path, parallelize=False)\n",
" det_source = run[source_name.format(karabo_id, channel)]\n",
" cellid_pattern, train_ids = find_common_cell_pattern(det_source)\n",
" if cellid_pattern is None:\n",
" return None, None, None, None, None, None, None, None\n",
" data = det_source['image.data'][by_id[train_ids]]\n",
" cell_ids = det_source['image.cellId'][by_id[train_ids]]\n",
"\n",
@@ -319,10 +325,6 @@
" if len(cellids_missing):\n",
" raise ValueError(f\"No frames left for cells {cellids_missing} \"\n",
" \"after discarding frames with wrong gain stage\")\n",
"\n",
" elif (gains != gg).any():\n",
" raise Exception(f\"Adaptive gain run {run_path} contains pixels \"\n",
" f\"in gain state other than expected {gg}\")\n",
" \n",
" im = reorder_axes(im,\n",
" from_order=('frames', 'slow_scan', 'fast_scan'),\n",
Loading