Skip to content

Commit

Permalink
cleaning typos and dead code and such
Browse files Browse the repository at this point in the history
  • Loading branch information
sezelt committed Feb 25, 2024
1 parent 63c4c98 commit 18e0734
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
4 changes: 2 additions & 2 deletions py4DSTEM/process/calibration/origin.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,14 +386,14 @@ def get_origin_friedel(
for rx, ry in tqdmnd(datacube.R_Nx, datacube.R_Ny):
if mask is None:
# pad image
im_xp = xp.asarray(datacube.data[rx, ry, :, :])
im_xp = xp.asarray(datacube.data[rx, ry])
im = xp.pad(
im_xp,
((0, datacube.data.shape[2]), (0, datacube.data.shape[3])),
)
G = xp.fft.fft2(im)

# Masked cross correlation of masked image with its inverse
# Cross correlation of masked image with its inverse
cc = xp.real(xp.fft.ifft2(G**2))

else:
Expand Down
17 changes: 6 additions & 11 deletions py4DSTEM/process/polar/polar_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,10 +667,6 @@ def calculate_FEM_local(
ax.set_ylabel("Normalized Variance")
ax.set_xlim((self.qq[0], self.qq[-1]))

# self.radial_all_std[rx, ry] = np.sqrt(
# np.mean((self.data[rx, ry] - self.radial_all[rx, ry][None]) ** 2, axis=0)
# )

if return_values:
if returnfig:
return self.local_radial_mean, self.local_radial_var, fig, ax
Expand All @@ -687,7 +683,7 @@ def calculate_annular_symmetry(
mask_realspace=None,
plot_result=False,
figsize=(8, 4),
returnval=False,
return_symmetry_map=False,
progress_bar=True,
):
"""
Expand All @@ -697,16 +693,16 @@ def calculate_annular_symmetry(
Parameters
--------
self: PolarDatacube
Polar transformation datacube
Polar transformed datacube
max_symmetry: int
Symmetry orders will be computed from 1 to max_symmetry for n-fold symmetry orders.
mask_realspace: np.array
Boolean mask, symmetries will only be computed at probe positions wheremask is True.
Boolean mask, symmetries will only be computed at probe positions where mask is True.
plot_result: bool
Plot the resulting array
figsize: (float, float)
Size of the plot.
returnval: bool
return_symmetry_map: bool
Set to true to return the symmetry array.
progress_bar: bool
Show progress bar during calculation.
Expand Down Expand Up @@ -740,7 +736,6 @@ def calculate_annular_symmetry(
# Get polar transformed image
im = self.transform(
self.data_raw.data[rx, ry],
# returnval = 'zeros',
)
polar_im = np.ma.getdata(im)
polar_mask = np.ma.getmask(im)
Expand Down Expand Up @@ -824,10 +819,10 @@ def calculate_annular_symmetry(
np.arange(max_symmetry) + 0.5,
range(1, max_symmetry + 1),
)
ax.set_xlabel("Scattering angle (1/A)")
ax.set_xlabel("Scattering angle (1/Å)")
ax.set_ylabel("Symmetry Order")

if returnval:
if return_symmetry_map:
return self.annular_symmetry


Expand Down

0 comments on commit 18e0734

Please sign in to comment.