Skip to content

Commit b5af0d0

Browse files
committed
savu paganin work4
1 parent 9333cb0 commit b5af0d0

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

httomolibgpu/prep/phase.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,17 @@ def paganin_filter(
100100
alpha = _calculate_alpha(energy, distance, ratio_delta_beta)
101101

102102
# Compute the reciprocal grid
103-
pixel_size *= 1e6 # rescaling to meters
104-
indx = _reciprocal_coord(pixel_size / (2 * math.pi), dy)
105-
indy = _reciprocal_coord(pixel_size / (2 * math.pi), dx)
103+
# pixel_size *= 1e6 # rescaling to meters
104+
indx = _reciprocal_coord(pixel_size, dy)
105+
indy = _reciprocal_coord(pixel_size, dx)
106106

107107
# Build Lorentzian-type filter
108108
phase_filter = fftshift(
109-
1.0 / (1.0 + alpha * (cp.add.outer(cp.square(indx), cp.square(indy))))
109+
1.0
110+
/ (
111+
1.0
112+
+ alpha * (cp.add.outer(cp.square(indx), cp.square(indy)) / (4 * math.pi))
113+
)
110114
)
111115

112116
phase_filter = phase_filter / phase_filter.max() # normalisation
@@ -139,7 +143,7 @@ def paganin_filter(
139143

140144

141145
def _calculate_alpha(energy, distance, ratio_delta_beta):
142-
return _wavelength(energy) * distance * ratio_delta_beta / (4 * math.pi)
146+
return _wavelength(energy) * distance * ratio_delta_beta
143147

144148

145149
# the scaling is different here and doesn't follow the original formula

0 commit comments

Comments
 (0)