Skip to content
Snippets Groups Projects
Commit 335eda86 authored by Philipp Schmidt's avatar Philipp Schmidt
Browse files

Carry Shimadzu output channel as part of source name pattern in CalCat

parent 62bdb2d1
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,6 @@ from cal_tools.calcat_interface2 import ShimadzuHPVX2Conditions
class ShimadzuHPVX2:
channel = "daqOutput"
image_key = "data.image.pixels"
copy_keys = [
"data.image.binning",
......@@ -27,8 +26,7 @@ class ShimadzuHPVX2:
def conditions(self, dc: "DataCollection", module=None): # noqa: F821
if module is None:
source_pattern = self.source_name_pattern.format(
f"*:{self.channel}")
source_pattern = self.source_name_pattern.format('*')
det_dc = dc.select(source_pattern)
if not det_dc.instrument_sources:
raise ValueError("No detector sources are found")
......@@ -41,12 +39,17 @@ class ShimadzuHPVX2:
return ShimadzuHPVX2Conditions(burst_frame_count=float(num_frames))
def instrument_source(self, module: int):
source_name = self.source_name_pattern.format(module)
return f"{source_name}:{self.channel}"
return self.source_name_pattern.format(modno=module)
def corrected_source(self, module: int):
source_name = self.source_name_pattern.format(module)
source_name = self.source_name_pattern.format(modno=module)
# Replace type with CORR.
parts = source_name.split('/')
parts[1] = "CORR"
source_name = '/'.join(parts)
return f"{source_name}:output"
# Replace channel with output.
source_name = source_name[:source_name.index(':')] + ':output'
return source_name
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