From 242594577cc52cb9d38c661ff01319b90541f736 Mon Sep 17 00:00:00 2001 From: Stef Smeets Date: Tue, 26 Jun 2018 13:06:54 +0200 Subject: [PATCH] Bug fixes --- instamatic/TEMController/TEMController.py | 14 ++++++++------ instamatic/experiments/cred/experiment.py | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/instamatic/TEMController/TEMController.py b/instamatic/TEMController/TEMController.py index f64cb943..355160b9 100644 --- a/instamatic/TEMController/TEMController.py +++ b/instamatic/TEMController/TEMController.py @@ -309,8 +309,8 @@ def y(self, value: int): self.set(y=value) def move_in_projection(self, delta_x: int, delta_y: int): - r"""y and z are always perpendicular to the sample stage. Any movement in the projection - should be broken down into the components z' and y' to achieve eucentric movement. + r"""y and z are always perpendicular to the sample stage. To achieve the movement + in the projection, x and yshould be broken down into the components z' and y'. y = y' * cos(a) z = y' * sin(a) @@ -323,16 +323,18 @@ def move_in_projection(self, delta_x: int, delta_y: int): \ y """ x, y, z, a, b = self.get() + a = np.radians(a) x = x + delta_x y = y + delta_y * np.cos(a) - z = z + delta_y * np.sin(a) # check signs - self.set(x=x, y=y) + z = z - delta_y * np.sin(a) + self.set(x=x, y=y, z=z) def move_along_optical_axis(self, delta_z: int): """See `StagePosition.move_in_projection`""" x, y, z, a, b = self.get() - y = y + delta_z * np.cos(a) - z = z + delta_z * np.sin(a) # check signs + a = np.radians(a) + y = y + delta_z * np.sin(a) + z = z + delta_z * np.cos(a) self.set(y=y, z=z) @property diff --git a/instamatic/experiments/cred/experiment.py b/instamatic/experiments/cred/experiment.py index a0994504..0d1e1f3f 100644 --- a/instamatic/experiments/cred/experiment.py +++ b/instamatic/experiments/cred/experiment.py @@ -70,7 +70,7 @@ def __init__(self, ctrl, self.relax_beam_before_experiment = self.image_interval_enabled and config.cfg.cred_relax_beam_before_experiment - self.track_stage_position = config.cfg.cred_track_stage_position + self.track_stage_position = config.cfg.cred_track_stage_positions self.stage_positions = [] def log_start_status(self):