Skip to content

Commit

Permalink
Add inline comment about lines that need to match shift calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
rmjarvis committed Dec 7, 2024
1 parent b12465d commit 5593bf1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions galsim/gsobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,8 @@ def _get_new_bounds(self, image, nx, ny, bounds, center):
elif nx is not None and ny is not None:
b = BoundsI(1,nx,1,ny)
if center is not None:
# Note: this needs to match the corresponding calculation in _setup_image
# where we shift the image center after making a new image with nx,ny.
b = b.shift(_PositionI(np.floor(center.x+0.5-b.true_center.x),
np.floor(center.y+0.5-b.true_center.y)))
return b
Expand Down

0 comments on commit 5593bf1

Please sign in to comment.