Skip to content
Snippets Groups Projects
Commit df8d0051 authored by David Hammer's avatar David Hammer
Browse files

Merge branch 'feat/agipd-add-fixed-gain' of...

Merge branch 'feat/agipd-add-fixed-gain' of ssh://git.xfel.eu:10022/detectors/pycalibration into feat/agipd-add-fixed-gain
parents 6e632ff3 bd98a3c6
No related branches found
No related tags found
1 merge request!438Feat/agipd add fixed gain mode to dark notebook
......@@ -15,8 +15,10 @@ from cal_tools.agipdutils import (
match_asic_borders,
melt_snowy_pixels,
)
from cal_tools.cython import agipdalgs as calgs
from cal_tools.enums import AgipdGainMode, BadPixels, SnowResolution
from cal_tools.tools import get_constant_from_db_and_time
from iCalibrationDB import Conditions
def get_num_cells(fname, loc, module):
......@@ -125,6 +127,7 @@ def get_gain_setting(fname: str, h5path_ctrl: str) -> int:
else:
raise ValueError('Could not derive gain setting from setupr and patternTypeIndex') # noqa
def get_gain_mode(fname: str, h5path_ctrl: str) -> AgipdGainMode:
"""Returns the gain mode (adaptive or fixed) from slow data"""
......
......@@ -77,11 +77,9 @@
"metadata": {},
"outputs": [],
"source": [
"# imports and things that do not usually need to be changed\n",
"from datetime import datetime\n",
"\n",
"import dateutil.parser\n",
"\n",
"import os\n",
"from collections import OrderedDict\n",
"from typing import Tuple\n",
......@@ -436,11 +434,37 @@
" else:\n",
" continue\n",
" inp.append((fname_in, i, gg))\n",
<<<<<<< HEAD
||||||| 335796a
" \n",
" gg += 1\n",
"\n",
"p = partial(characterize_module, IL_MODE, max_cells,\n",
" (thresholds_offset_hard, thresholds_offset_sigma,\n",
" thresholds_noise_hard, thresholds_noise_sigma),\n",
" rawversion, karabo_id, acq_rate, h5path, h5path_idx,\n",
" control_names, karabo_id_control)\n",
=======
"\n",
"with multiprocessing.Pool() as pool:\n",
" results = pool.starmap(characterize_module, inp)\n",
>>>>>>> bd98a3c6b5a10f7347ba8a74d0ce895565db9ca5
"\n",
<<<<<<< HEAD
"with multiprocessing.Pool() as pool:\n",
" results = pool.starmap(characterize_module, inp)\n",
"\n",
"for offset, noise, gains, gains_std, gg, bp, thiscell, thisacq in results:\n",
||||||| 335796a
"# Don't remove. Used for Debugging.\n",
"#results = list(map(p, inp))\n",
"results = view.map_sync(p, inp)\n",
"\n",
"for ii, r in enumerate(results):\n",
" offset, noise, gains, gains_std, gg, bp, thiscell, thisacq = r\n",
=======
"for offset, noise, gains, gains_std, gg, bp, thiscell, thisacq in results:\n",
>>>>>>> bd98a3c6b5a10f7347ba8a74d0ce895565db9ca5
" all_cells.append(thiscell)\n",
" all_acq_rate.append(thisacq)\n",
" for i in modules:\n",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment