Skip to content

Commit

Permalink
initializing tomo alignments
Browse files Browse the repository at this point in the history
  • Loading branch information
smribet committed Sep 11, 2024
1 parent 4714ce7 commit b9b7d4b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions py4DSTEM/tomography/tomography.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def __init__(
datacube_Q_pixel_size_inv_A: float = None, # do we even need this?
tilt_deg: Sequence[np.ndarray] = None,
translation_px: Sequence[np.ndarray] = None,
scanning_to_tilt_rotation: float = None,
tilt_rotation_axis_angle: float = None,
tilt_rotation_axis_shift: float = None,
initial_object_guess: np.ndarray = None,
verbose: bool = True,
device: str = "cpu",
Expand All @@ -61,7 +62,8 @@ def __init__(
self._datacube_Q_pixel_size_inv_A = datacube_Q_pixel_size_inv_A
self._tilt_deg = tilt_deg
self._translation_px = translation_px
self._scanning_to_tilt_rotation = scanning_to_tilt_rotation
self._tilt_rotation_axis_angle = tilt_rotation_axis_angle
self._tilt_rotation_axis_shift = tilt_rotation_axis_shift
self._verbose = verbose
self._initial_object_guess = initial_object_guess

Expand Down Expand Up @@ -496,8 +498,8 @@ def _calculate_scan_positions(

x, y = np.meshgrid(x, y, indexing="ij")

if self._scanning_to_tilt_rotation is not None:
rotation_angle = np.deg2rad(self._scanning_to_tilt_rotation)
if self._tilt_rotation_axis_angle is not None:
rotation_angle = np.deg2rad(self._tilt_rotation_axis_angle)
x, y = x * np.cos(rotation_angle) + y * np.sin(rotation_angle), -x * np.sin(
rotation_angle
) + y * np.cos(rotation_angle)
Expand Down

0 comments on commit b9b7d4b

Please sign in to comment.