fix(LamNI): skip 22.5 deg approach rotation when shutter is closed
The k=2..8 alignment steps always rotated via a halfway "approach" angle before the 45 deg target, to let the operator watch the sample sweep through in live view. That's only useful when keep_shutter_open is True; with the shutter closed nobody sees the intermediate move, so just rotate straight to the target angle in that case. Also bump the OMNY/FlOMNI post-fshopen() freeze-frame delay in update_frame() from 0.5s to 1s to match LamNI's, for consistent behavior between the two plugins.
This commit was merged in pull request #284.
This commit is contained in:
@@ -417,17 +417,23 @@ class XrayEyeAlign:
|
||||
self.movement_buttons_enabled(False, False)
|
||||
|
||||
target_angle = LAMNI_ALIGNMENT_ANGLES[k - 1] # 45...315 deg
|
||||
# Approach from halfway between previous and current angle
|
||||
# to reduce mechanical hysteresis (same as old alignment.py)
|
||||
prev_angle = LAMNI_ALIGNMENT_ANGLES[k - 2]
|
||||
approach_angle = prev_angle + (target_angle - prev_angle) / 2
|
||||
self._disable_rt_feedback()
|
||||
self.tomo_rotate(approach_angle)
|
||||
self.scans.lamni_move_to_scan_center(
|
||||
shift_x=self.shift_xy[0] / 1000,
|
||||
shift_y=self.shift_xy[1] / 1000,
|
||||
angle=float(self.get_tomo_angle()),
|
||||
).wait()
|
||||
if keep_shutter_open:
|
||||
# Rotate via the halfway point between previous and
|
||||
# current angle so the sample is seen sweeping
|
||||
# smoothly through the intermediate position in live
|
||||
# view. Only worth the extra move when the shutter
|
||||
# is open and someone is actually watching -- with
|
||||
# the shutter closed, jump straight to target_angle
|
||||
# below.
|
||||
prev_angle = LAMNI_ALIGNMENT_ANGLES[k - 2]
|
||||
approach_angle = prev_angle + (target_angle - prev_angle) / 2
|
||||
self._disable_rt_feedback()
|
||||
self.tomo_rotate(approach_angle)
|
||||
self.scans.lamni_move_to_scan_center(
|
||||
shift_x=self.shift_xy[0] / 1000,
|
||||
shift_y=self.shift_xy[1] / 1000,
|
||||
angle=float(self.get_tomo_angle()),
|
||||
).wait()
|
||||
self._disable_rt_feedback()
|
||||
self.tomo_rotate(target_angle)
|
||||
self.scans.lamni_move_to_scan_center(
|
||||
|
||||
@@ -103,7 +103,7 @@ class XrayEyeAlign:
|
||||
dev.cam_xeye.live_mode_enabled.put(True)
|
||||
self.gui.on_live_view_enabled(True)
|
||||
dev.omnyfsh.fshopen()
|
||||
time.sleep(0.5)
|
||||
time.sleep(1)
|
||||
if not keep_shutter_open:
|
||||
self.gui.on_live_view_enabled(False)
|
||||
time.sleep(0.1)
|
||||
|
||||
Reference in New Issue
Block a user