Skip to content

Commit

Permalink
fixed some mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
smribet committed Aug 28, 2024
1 parent f04c85e commit d56b23a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions py4DSTEM/tomography/tomography.py
Original file line number Diff line number Diff line change
Expand Up @@ -922,11 +922,11 @@ def _diffraction_space_slice(
tilt = xp.deg2rad(tilt_deg)

length = s[-1] * xp.cos(tilt)
line_y_diff = xp.arange(-1 * (length) / 2, length / 2, length / s[-1])
line_y_diff = xp.arange(-1 * (length-1) / 2, (length+1) / 2, length / s[-1])
line_z_diff = line_y_diff * xp.tan(tilt)

line_y_diff[line_y_diff < 0] = s[-1] + line_y_diff[line_y_diff < 0]
line_z_diff[line_y_diff < 0] = s[-1] + line_z_diff[line_y_diff < 0]
line_z_diff[line_z_diff < 0] = s[-1] + line_z_diff[line_z_diff < 0]

order = xp.argsort(line_y_diff)
line_y_diff = line_y_diff[order]
Expand All @@ -948,9 +948,9 @@ def _diffraction_space_slice(
+ current_object_projected[:, :, yF_diff + 1, zF_diff]
* ((dy_diff) * (1 - dz_diff))[None, None, :]
+ current_object_projected[:, :, yF_diff, zF_diff + 1]
* ((dy_diff) * (dz_diff))[None, None, :]
* ((1-dy_diff) * (dz_diff))[None, None, :]
+ current_object_projected[:, :, yF_diff + 1, zF_diff + 1]
* ((1 - dy_diff) * (1 - dz_diff))[None, None, :]
* ((dy_diff) * (dz_diff))[None, None, :]
)

return self._asnumpy(current_object_sliced)
Expand Down

0 comments on commit d56b23a

Please sign in to comment.