Skip to content
Snippets Groups Projects
Commit 6b200f08 authored by Egor Sobolev's avatar Egor Sobolev
Browse files

Update ShimadzuHPVX2 conditions, add copy_keys in ShimadzuHPVX2 detector

parent 00102c92
No related branches found
No related tags found
No related merge requests found
from dataclasses import dataclass from dataclasses import dataclass
from cal_tools.calcat_interface2 import ConditionsBase from cal_tools.calcat_interface2 import ConditionsBase
@dataclass @dataclass
class ShimadzuHPVX2Conditions(ConditionsBase): class ShimadzuHPVX2Conditions(ConditionsBase):
frame_size: float burst_frame_count: float
calibration_types = { calibration_types = {
"Offset": ["Frame Size"], 'Offset': ['Burst Frame Count'],
"DynamicFF": ["Frame Size"], 'DynamicFF': ['Burst Frame Count'],
} }
class ShimadzuHPVX2: class ShimadzuHPVX2:
channel = "daqOutput" channel = "daqOutput"
image_key = "data.image.pixels" image_key = "data.image.pixels"
copy_keys = [
"data.image.binning",
"data.image.dimTypes",
"data.image.dims",
"data.image.flipX",
"data.image.flipY",
"data.image.roiOffsets",
"data.image.rotation",
]
def __init__(self, source_name_pattern: str, channel=None, image_key=None): def __init__(self, source_name_pattern: str, channel=None, image_key=None):
self.source_name_pattern = source_name_pattern self.source_name_pattern = source_name_pattern
...@@ -38,7 +48,7 @@ class ShimadzuHPVX2: ...@@ -38,7 +48,7 @@ class ShimadzuHPVX2:
source_name = self.instrument_source(module) source_name = self.instrument_source(module)
keydata = dc[source_name, self.image_key] keydata = dc[source_name, self.image_key]
num_frames = keydata.shape[-3] num_frames = keydata.shape[-3]
return ShimadzuHPVX2Conditions(frame_size=num_frames / 256) return ShimadzuHPVX2Conditions(burst_frame_count=float(num_frames))
def instrument_source(self, module: int): def instrument_source(self, module: int):
source_name = self.source_name_pattern.format(module) source_name = self.source_name_pattern.format(module)
......
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