Skip to content

Commit fac1a3e

Browse files
Jammy2211Jammy2211
authored andcommitted
v4
1 parent d4cf8e5 commit fac1a3e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

autoarray/inversion/pixelization/border_relocator.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,10 @@ def relocated_grid_via_ellipse_border_from(grid, origin, a, b, phi, xp=np, eps=1
323323
xprime = c * dx + s * dy
324324
yprime = -s * dx + c * dy
325325

326-
outside = xprime > xp.asarray(0.0, dtype=grid.dtype)
326+
# ellipse radius in normalized coords
327+
q = (xprime / a) ** 2 + (yprime / b) ** 2
328+
329+
outside = q > 1.0
327330

328331
moved = xp.stack([origin[0] + yprime, origin[1] + xprime], axis=1)
329332
return xp.where(outside[:, None], moved, grid)

0 commit comments

Comments
 (0)