Skip to content

Commit

Permalink
broadcasting polar coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
gvarnavi committed Jan 6, 2024
1 parent cfa835c commit 693f0b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions py4DSTEM/process/phase/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,9 @@ def get_spatial_frequencies(self):
def polar_coordinates(self, x, y):
"""Calculate a polar grid for a given Cartesian grid."""
xp = self._xp
alpha = xp.sqrt(x.reshape((-1, 1)) ** 2 + y.reshape((1, -1)) ** 2)
alpha = xp.sqrt(x[:, None] ** 2 + y[None, :] ** 2)
# phi = xp.arctan2(x.reshape((-1, 1)), y.reshape((1, -1))) # bug in abtem-legacy and py4DSTEM<=0.14.9
phi = xp.arctan2(y.reshape((1, -1)), x.reshape((-1, 1)))
phi = xp.arctan2(y[None, :], x[:, None])
return alpha, phi

def build(self):
Expand Down

0 comments on commit 693f0b0

Please sign in to comment.