diff --git a/src/cal_tools/shimadzu.py b/src/cal_tools/shimadzu.py index 0251e5621c82231281f7ddb9fe55c723b3c1cf8e..d34d8e85f9d63c39a7c84f93903f24f6f72cf187 100644 --- a/src/cal_tools/shimadzu.py +++ b/src/cal_tools/shimadzu.py @@ -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(modno='*') 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