Skip to content

Commit

Permalink
working on a normalization error
Browse files Browse the repository at this point in the history
  • Loading branch information
smribet committed Sep 6, 2024
1 parent 035c57d commit 1e63bfd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions py4DSTEM/tomography/tomography.py
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,7 @@ def _forward(
line_y_diff = xp.arange(-(s[-1] - 1) / 2, s[-1] / 2) * length / s[-1]
line_z_diff = line_y_diff * xp.tan(tilt) + (s[-1] - 1) / 2
line_y_diff += (s[-1] - 1) / 2

# line_y_diff = np.fft.fftfreq(s[-1], 1 / s[-1]) * xp.cos(tilt) + (s[-1]-1)/2
# line_z_diff = np.fft.fftfreq(s[-1], 1 / s[-1]) * xp.sin(tilt) + (s[-1]-1)/2

Expand Down Expand Up @@ -1107,6 +1108,7 @@ def _forward(
"clip",
)


bincount_x = (
xp.tile(
(xp.tile(self._ind_diffraction_ravel, (1, 4))),
Expand All @@ -1122,14 +1124,12 @@ def _forward(
obj[xp.ravel_multi_index((ind0, ind1), (s[1], s[2]), mode="clip"),]
* weights_real[:, :, None]
)
.sum(1)[:, ind_diff]
.mean(1)[:, ind_diff]
.ravel()
* xp.tile(weights_diff, (1, s[1])).ravel(),
* xp.tile(weights_diff, s[1]).ravel(),
minlength=self._q_length * s[1],
).reshape(s[1], self._q_length)[:, self._circular_mask_bincount]
).reshape(s[1], self._q_length)[:, self._circular_mask_bincount] * s[2]

# from pdb import set_trace
# set_trace()

self._ind0 = ind0
self._ind1 = ind1
Expand Down

0 comments on commit 1e63bfd

Please sign in to comment.