Skip to content

Commit 17fd1e1

Browse files
authored
Merge pull request #733 from maclariz/DDF-patch-11
DDF patch 11
2 parents 1fd5b9e + 282121c commit 17fd1e1

File tree

2 files changed

+7
-22
lines changed

2 files changed

+7
-22
lines changed

py4DSTEM/process/diffraction/digital_dark_field.py

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -550,16 +550,8 @@ def DDF_radial_image(points_array_w_rphi, radius, Rshape, tol=1):
550550

551551
radialimage = np.zeros(shape=Rshape)
552552

553-
for i in range(Rshape[0]):
554-
for j in range(Rshape[1]):
555-
radialimage[i, j] = np.where(
556-
np.logical_and(
557-
radial_filtered_points_array[:, 3] == i,
558-
radial_filtered_points_array[:, 4] == j,
559-
),
560-
radial_filtered_points_array[:, 2],
561-
0,
562-
).sum()
553+
for line in radial_filtered_points_array:
554+
radialimage[int(line[3]), int(line[4])] += line[2]
563555

564556
return radialimage
565557

@@ -612,14 +604,7 @@ def DDFradialazimuthimage(points_array_w_rphi, radius, phi0, phi1, Rshape, tol=1
612604
)
613605
radiusazimuthimage = np.zeros(shape=Rshape)
614606

615-
for i in range(Rshape[0]):
616-
for j in range(Rshape[1]):
617-
radiusazimuthimage[i, j] = np.where(
618-
np.logical_and(
619-
rphi_filtered_points_array[:, 3] == i,
620-
rphi_filtered_points_array[:, 4] == j,
621-
),
622-
rphi_filtered_points_array[:, 2],
623-
0,
624-
).sum()
607+
for line in rphi_filtered_points_array:
608+
radiusazimuthimage[int(line[3]), int(line[4])] += line[2]
609+
625610
return radiusazimuthimage

py4DSTEM/visualize/show.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ def show(
267267
* 'centered': The vmin/vmax values are set to ``c -/+ m``, where by default
268268
'c' is zero and m is the max(abs(ar-c), or the two params can be user
269269
specified using the kwargs vmin/vmax -> c/m.
270-
vmin (number): min intensity, behavior depends on clipvals
271-
vmax (number): max intensity, behavior depends on clipvals
270+
vmin (number): min intensity, behavior depends on intensity_range
271+
vmax (number): max intensity, behavior depends on intensity_range
272272
min,max: alias' for vmin,vmax, throws deprecation warning
273273
power (number): specifies the scaling power
274274
power_offset (bool): If true, image has min value subtracted before power scaling

0 commit comments

Comments
 (0)