Skip to content

Commit 8bd0ca7

Browse files
Jammy2211Jammy2211
authored andcommitted
next vrersion
1 parent fac1a3e commit 8bd0ca7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

autoarray/inversion/pixelization/border_relocator.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,13 @@ def relocated_grid_via_ellipse_border_from(grid, origin, a, b, phi, xp=np, eps=1
327327
q = (xprime / a) ** 2 + (yprime / b) ** 2
328328

329329
outside = q > 1.0
330+
scale = 1.0 / xp.sqrt(xp.maximum(q, 1.0 + eps))
331+
332+
# scale back to boundary
333+
xprime2 = xprime * scale
334+
yprime2 = yprime * scale
330335

331-
moved = xp.stack([origin[0] + yprime, origin[1] + xprime], axis=1)
336+
moved = xp.stack([origin[0] + yprime2, origin[1] + xprime2], axis=1)
332337
return xp.where(outside[:, None], moved, grid)
333338

334339
class BorderRelocator:

0 commit comments

Comments
 (0)