epix100lib
epix100Ctrl
¶
Source code in /usr/src/app/checkouts/readthedocs.org/user_builds/european-xfel-offline-calibration/envs/latest/lib/python3.8/site-packages/cal_tools/epix100/epix100lib.py
class epix100Ctrl():
def __init__(
self,
run_dc: extra_data.DataCollection,
ctrl_src: str,
instrument_src: str,
):
"""Read epix100 parameters to use later while quering CALCAT.
:param run_dir: EXtra-data RunDirectory DataCollection object.
:param ctrl_src: CONTROL source for accessing slow data.
:param instrument_src: INSTRUMENT source for accessing fast data.
"""
self.run_dc = run_dc
self.ctrl_src = ctrl_src
self.instrument_src = instrument_src
def get_integration_time(self) -> float:
"""Get Integration time for ePix100 from /CTRL/
Returns:
Integration time: integration time value.
"""
return self.run_dc[
self.ctrl_src, 'expTime.value'].as_single_value(reduce_by='first')
def get_temprature(self) -> float:
"""Get temperature value from CONTROL.
atol is degree variation tolerance.
"""
# old receiver device configuration
# temperature was stored in:
# source: 'MID_EXP_EPIX-1/DET/RECEIVER:daqOutput'
# key: 'data.backTemp'
if 'data.backTemp' in self.run_dc[self.instrument_src]:
# using `item()` because data.backTemp shape evolved from (n_trains,) to (n_trains, 1)
# atol = 100 because temperature was in C/100
return self.run_dc[
self.instrument_src, 'data.backTemp'].as_single_value(
reduce_by='mean', atol=100).item() / 100
# new (2023) receiver device configuration
# temperature is stored in:
# source: 'MID_EXP_EPIX-1/DET/RECEIVER'
# key: 'slowdata.backTemp.value'
else:
return self.run_dc[
self.instrument_src.split(':daqOutput')[0], 'slowdata.backTemp.value'].as_single_value(
reduce_by='mean', atol=1)
__init__(run_dc, ctrl_src, instrument_src)
¶
Read epix100 parameters to use later while quering CALCAT. :param run_dir: EXtra-data RunDirectory DataCollection object. :param ctrl_src: CONTROL source for accessing slow data. :param instrument_src: INSTRUMENT source for accessing fast data.
Source code in /usr/src/app/checkouts/readthedocs.org/user_builds/european-xfel-offline-calibration/envs/latest/lib/python3.8/site-packages/cal_tools/epix100/epix100lib.py
def __init__(
self,
run_dc: extra_data.DataCollection,
ctrl_src: str,
instrument_src: str,
):
"""Read epix100 parameters to use later while quering CALCAT.
:param run_dir: EXtra-data RunDirectory DataCollection object.
:param ctrl_src: CONTROL source for accessing slow data.
:param instrument_src: INSTRUMENT source for accessing fast data.
"""
self.run_dc = run_dc
self.ctrl_src = ctrl_src
self.instrument_src = instrument_src
get_integration_time()
¶
Get Integration time for ePix100 from /CTRL/
Returns:
Type | Description |
---|---|
float
|
Integration time: integration time value. |
Source code in /usr/src/app/checkouts/readthedocs.org/user_builds/european-xfel-offline-calibration/envs/latest/lib/python3.8/site-packages/cal_tools/epix100/epix100lib.py
get_temprature()
¶
Get temperature value from CONTROL. atol is degree variation tolerance.
Source code in /usr/src/app/checkouts/readthedocs.org/user_builds/european-xfel-offline-calibration/envs/latest/lib/python3.8/site-packages/cal_tools/epix100/epix100lib.py
def get_temprature(self) -> float:
"""Get temperature value from CONTROL.
atol is degree variation tolerance.
"""
# old receiver device configuration
# temperature was stored in:
# source: 'MID_EXP_EPIX-1/DET/RECEIVER:daqOutput'
# key: 'data.backTemp'
if 'data.backTemp' in self.run_dc[self.instrument_src]:
# using `item()` because data.backTemp shape evolved from (n_trains,) to (n_trains, 1)
# atol = 100 because temperature was in C/100
return self.run_dc[
self.instrument_src, 'data.backTemp'].as_single_value(
reduce_by='mean', atol=100).item() / 100
# new (2023) receiver device configuration
# temperature is stored in:
# source: 'MID_EXP_EPIX-1/DET/RECEIVER'
# key: 'slowdata.backTemp.value'
else:
return self.run_dc[
self.instrument_src.split(':daqOutput')[0], 'slowdata.backTemp.value'].as_single_value(
reduce_by='mean', atol=1)