Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions jax_galsim/gsobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,9 @@ def _setup_image(
)
image = Image(nx, ny, dtype=dtype)
if center is not None:
# this code has to match the code in _get_new_bounds
# for the same branch of the if statement block
# if center, nx, and ny are given.
image.shift(
PositionI(
jnp.floor(center.x + 0.5 - image.true_center.x),
Expand Down Expand Up @@ -486,10 +489,13 @@ 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:
# this code has to match the code in _setup_image
# for the same branch of the if statement block
# if center, nx and ny are given.
b = b.shift(
PositionI(
jnp.floor(center.x + 0.5) - b.center.x,
jnp.floor(center.y + 0.5) - b.center.y,
jnp.floor(center.x + 0.5 - b.true_center.x),
jnp.floor(center.y + 0.5 - b.true_center.y),
)
)
return b
Expand Down
2 changes: 1 addition & 1 deletion tests/GalSim
Submodule GalSim updated 105 files
Loading