Skip to content

Commit

Permalink
Merge pull request #611 from sezelt/fourier_coords_dedup
Browse files Browse the repository at this point in the history
Remove duplicate make_fourier_coords_2D
  • Loading branch information
bsavitzky authored Mar 7, 2024
2 parents d3ec3c2 + d7e7472 commit 9718a98
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions py4DSTEM/process/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,6 @@
import matplotlib.font_manager as fm

from emdfile import tqdmnd
from py4DSTEM.process.utils.multicorr import upsampled_correlation
from py4DSTEM.preprocess.utils import make_Fourier_coords2D

try:
from IPython.display import clear_output
except ImportError:

def clear_output(wait=True):
pass


try:
import cupy as cp
Expand Down Expand Up @@ -173,25 +163,6 @@ def get_qx_qy_1d(M, dx=[1, 1], fft_shifted=False):
return qxa, qya


def make_Fourier_coords2D(Nx, Ny, pixelSize=1):
"""
Generates Fourier coordinates for a (Nx,Ny)-shaped 2D array.
Specifying the pixelSize argument sets a unit size.
"""
if hasattr(pixelSize, "__len__"):
assert len(pixelSize) == 2, "pixelSize must either be a scalar or have length 2"
pixelSize_x = pixelSize[0]
pixelSize_y = pixelSize[1]
else:
pixelSize_x = pixelSize
pixelSize_y = pixelSize

qx = np.fft.fftfreq(Nx, pixelSize_x)
qy = np.fft.fftfreq(Ny, pixelSize_y)
qy, qx = np.meshgrid(qy, qx)
return qx, qy


def get_CoM(ar, device="cpu", corner_centered=False):
"""
Finds and returns the center of mass of array ar.
Expand Down

0 comments on commit 9718a98

Please sign in to comment.