Skip to content

Commit eb8a04d

Browse files
viljarjfCSSFrancis
authored andcommitted
Rename confusing variable. The clipping is for NOT fast
1 parent c09b1ea commit eb8a04d

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
@@ -364,7 +364,7 @@ def get_diffraction_pattern(
364364
mirrored: bool = False,
365365
fast: bool = True,
366366
normalize: bool = True,
367-
fast_clip_threshold: float = 1,
367+
clip_threshold: float = 1,
368368
):
369369
"""Returns the diffraction data as a numpy array with
370370
two-dimensional Gaussians representing each diffracted peak. Should only
@@ -388,7 +388,7 @@ def get_diffraction_pattern(
388388
Whether to speed up calculations by rounding spot coordinates down to integer pixel
389389
normalize: bool, optional
390390
Whether to normalize the pattern to values between 0 and 1
391-
fast_clip_threshold: float, optional
391+
clip_threshold: float, optional
392392
Only used when `fast` is False.
393393
Pixel intensity threshold, such that pixels which would be below this value are ignored.
394394
Thresholding performed before possible normalization.
@@ -435,7 +435,7 @@ def get_diffraction_pattern(
435435
return np.zeros(shape)
436436

437437
pattern = get_pattern_from_pixel_coordinates_and_intensities(
438-
spot_coords, spot_intens, shape, sigma, fast_clip_threshold
438+
spot_coords, spot_intens, shape, sigma, clip_threshold
439439
)
440440
if normalize:
441441
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
@@ -158,7 +158,7 @@ def test_get_diffraction_pattern_fast_vs_slow(self, al_phase):
158158
sigma=1,
159159
calibration=1,
160160
normalize=False,
161-
fast_clip_threshold=0.01,
161+
clip_threshold=0.01,
162162
)
163163
# Check that fast/slow are the same when coordinates are dtype int
164164
fast = int_sim.get_diffraction_pattern(fast=True, **sim_kwargs)
@@ -170,7 +170,7 @@ def test_get_diffraction_pattern_fast_vs_slow(self, al_phase):
170170
float_fast = float_sim.get_diffraction_pattern(fast=True, **sim_kwargs)
171171
float_slow = float_sim.get_diffraction_pattern(fast=False, **sim_kwargs)
172172
assert np.allclose(float_fast, fast)
173-
assert np.all((float_slow - float_fast) < sim_kwargs["fast_clip_threshold"])
173+
assert np.all((float_slow - float_fast) < sim_kwargs["clip_threshold"])
174174

175175
# Change the size, now the center is between pixels.
176176
# Slow should reflect this

0 commit comments

Comments
 (0)