daq: loop centering sequence. Changes how filenames oif background images are generated and saved in redis. Changes angles. Debugging print statements currently kept but can be removed following further testing.

This commit is contained in:
2025-09-05 17:24:32 +02:00
parent 9fece3e4a1
commit c50edebe22
+10 -1
View File
@@ -786,24 +786,33 @@ class AareDAQ:
try:
i = 0
for s in self.__cfg.alc_zoom_settings.z:
print('new loop center settings')
print(s.zoom_value,s.sam_cam_gain, s.sam_cam_exp)
self.__devs.samcam_settings = SampleCameraSettings(exposure=s.sam_cam_exp, gain=s.sam_cam_gain)
self.__devs.zoom_sync(s.zoom_value)
print(s.zoom_value, s.sam_cam_gain, s.sam_cam_exp)
if i % 2 == 0:
angles = (0, -45, -90)
else:
angles = (-90, -45, 0)
for angle in angles:
print(angle)
self.__devs.aerotech.move(angle, wait=True)
filename = None
exp = int(s.sam_cam_exp * 1000)
gain = int(s.sam_cam_gain)
if sample_id is not None:
filename = f"{angle}_{s.zoom_value:.0f}"
self.__devs.smargon.target = self.__loop_center(filename)
filename = f"{sample_id}_{angle}_{s.zoom_value:.0f}_{exp}_{gain}"
self.__devs.smargon.target = self.__loop_center(s, filename)
self.__devs.smargon.wait(60)
print(sample_id)
if sample_id is not None:
self.__aare.sample_centered(self.__cfg.current_sample)
time.sleep(0.1)
self.save_screenshot_db(sample_id, f"{angle}_{s.zoom_value:.0f}")
self.save_screenshot_db(sample_id, f"{sample_id}_{angle}_{s.zoom_value:.0f}_{exp}_{gain}")
i += 1
return True
except LoopCenteringFailed: