Commit f3d608e0 authored by camera computer's avatar camera computer
Browse files

adjustment to usage of ImageLabel

parent 81127967
...@@ -314,7 +314,12 @@ class FluorescenceScanData(ImagingData): ...@@ -314,7 +314,12 @@ class FluorescenceScanData(ImagingData):
for label, array in self.arrays.items(): for label, array in self.arrays.items():
m = label_pat.match(label.label if isinstance(label, ImageLabel) else label) m = label_pat.match(label.label if isinstance(label, ImageLabel) else label)
if m is not None: if m is not None:
array_reps[ImageLabel(m.group(1), label.savedir)].append(array) array_reps[
ImageLabel(
m.group(1),
label.savedir if isinstance(label, ImageLabel) else None
)
].append(array)
else: else:
print(f"[imaging] skip averaging for improperly formatted label '{label}'") print(f"[imaging] skip averaging for improperly formatted label '{label}'")
averaged_arrays = { averaged_arrays = {
...@@ -444,7 +449,12 @@ class DailyMeasurementData(ImagingData): ...@@ -444,7 +449,12 @@ class DailyMeasurementData(ImagingData):
for label, array in self.arrays.items(): for label, array in self.arrays.items():
m = label_pat.match(label.label if isinstance(label, ImageLabel) else label) m = label_pat.match(label.label if isinstance(label, ImageLabel) else label)
if m is not None: if m is not None:
array_reps[ImageLabel(m.group(1), label.savedir)].append(array) array_reps[
ImageLabel(
m.group(1),
label.savedir if isinstance(label, ImageLabel) else None
)
].append(array)
else: else:
print(f"[imaging] skip averaging for improperly formatted label '{label}'") print(f"[imaging] skip averaging for improperly formatted label '{label}'")
averaged_arrays = { averaged_arrays = {
...@@ -596,11 +606,11 @@ class DailyMeasurementData(ImagingData): ...@@ -596,11 +606,11 @@ class DailyMeasurementData(ImagingData):
s.append( s.append(
np.sqrt( (float(data["sx"])**2 + float(data["sy"])**2) / 2 ) np.sqrt( (float(data["sx"])**2 + float(data["sy"])**2) / 2 )
) )
N.append(float(data["N"]))
elif m_pre is not None: elif m_pre is not None:
s0.append( s0.append(
np.sqrt( (float(data["sx"])**2 + float(data["sy"])**2) / 2 ) np.sqrt( (float(data["sx"])**2 + float(data["sy"])**2) / 2 )
) )
N.append(float(data["N"]))
else: else:
print(f"[imaging] skip TOF free-space resonance processing for" print(f"[imaging] skip TOF free-space resonance processing for"
f" improperly formatted label '{label}'") f" improperly formatted label '{label}'")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment