Skip to content

Commit 4e57397

Browse files
committed
Rename confusing variable. The clipping is for NOT fast
1 parent 5babaef commit 4e57397

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

diffsims/simulations/simulation2d.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ def get_diffraction_pattern(
353353
mirrored: bool = False,
354354
fast: bool = True,
355355
normalize: bool = True,
356-
fast_clip_threshold: float = 1,
356+
clip_threshold: float = 1,
357357
):
358358
"""Returns the diffraction data as a numpy array with
359359
two-dimensional Gaussians representing each diffracted peak. Should only
@@ -377,7 +377,7 @@ def get_diffraction_pattern(
377377
Whether to speed up calculations by rounding spot coordinates down to integer pixel
378378
normalize: bool, optional
379379
Whether to normalize the pattern to values between 0 and 1
380-
fast_clip_threshold: float, optional
380+
clip_threshold: float, optional
381381
Only used when `fast` is False.
382382
Pixel intensity threshold, such that pixels which would be below this value are ignored.
383383
Thresholding performed before possible normalization.
@@ -424,7 +424,7 @@ def get_diffraction_pattern(
424424
return np.zeros(shape)
425425

426426
pattern = get_pattern_from_pixel_coordinates_and_intensities(
427-
spot_coords, spot_intens, shape, sigma, fast_clip_threshold
427+
spot_coords, spot_intens, shape, sigma, clip_threshold
428428
)
429429
if normalize:
430430
pattern = np.divide(pattern, np.max(pattern))

diffsims/tests/simulations/test_simulations2d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def test_get_diffraction_pattern_fast_vs_slow(self, al_phase):
141141
sigma=1,
142142
calibration=1,
143143
normalize=False,
144-
fast_clip_threshold=0.01,
144+
clip_threshold=0.01,
145145
)
146146
# Check that fast/slow are the same when coordinates are dtype int
147147
fast = int_sim.get_diffraction_pattern(fast=True, **sim_kwargs)
@@ -153,7 +153,7 @@ def test_get_diffraction_pattern_fast_vs_slow(self, al_phase):
153153
float_fast = float_sim.get_diffraction_pattern(fast=True, **sim_kwargs)
154154
float_slow = float_sim.get_diffraction_pattern(fast=False, **sim_kwargs)
155155
assert np.allclose(float_fast, fast)
156-
assert np.all((float_slow - float_fast) < sim_kwargs["fast_clip_threshold"])
156+
assert np.all((float_slow - float_fast) < sim_kwargs["clip_threshold"])
157157

158158
# Change the size, now the center is between pixels.
159159
# Slow should reflect this

0 commit comments

Comments
 (0)