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

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

parent 074e8c14
No related branches found
No related tags found
1 merge request!939[Generic][Shimadzu] Dynamic flat-field characterization and correction for MHz microscopy
...@@ -4,7 +4,6 @@ from cal_tools.calcat_interface2 import ShimadzuHPVX2Conditions ...@@ -4,7 +4,6 @@ from cal_tools.calcat_interface2 import ShimadzuHPVX2Conditions
class ShimadzuHPVX2: class ShimadzuHPVX2:
channel = "daqOutput"
image_key = "data.image.pixels" image_key = "data.image.pixels"
copy_keys = [ copy_keys = [
"data.image.binning", "data.image.binning",
...@@ -27,8 +26,7 @@ class ShimadzuHPVX2: ...@@ -27,8 +26,7 @@ class ShimadzuHPVX2:
def conditions(self, dc: "DataCollection", module=None): # noqa: F821 def conditions(self, dc: "DataCollection", module=None): # noqa: F821
if module is None: if module is None:
source_pattern = self.source_name_pattern.format( source_pattern = self.source_name_pattern.format(modno='*')
f"*:{self.channel}")
det_dc = dc.select(source_pattern) det_dc = dc.select(source_pattern)
if not det_dc.instrument_sources: if not det_dc.instrument_sources:
raise ValueError("No detector sources are found") raise ValueError("No detector sources are found")
...@@ -41,12 +39,17 @@ class ShimadzuHPVX2: ...@@ -41,12 +39,17 @@ class ShimadzuHPVX2:
return ShimadzuHPVX2Conditions(burst_frame_count=float(num_frames)) 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) return self.source_name_pattern.format(modno=module)
return f"{source_name}:{self.channel}"
def corrected_source(self, module: int): 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 = source_name.split('/')
parts[1] = "CORR" parts[1] = "CORR"
source_name = '/'.join(parts) 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