Skip to content
Snippets Groups Projects

[Generic][Shimadzu] Dynamic flat-field characterization and correction for MHz microscopy

Merged Egor Sobolev requested to merge feat/shimadzu-correction into master
1 file
+ 10
7
Compare changes
  • Side-by-side
  • Inline
+ 10
7
@@ -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
Loading