We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7d176a7 commit 1bf4a5dCopy full SHA for 1bf4a5d
1 file changed
jax_galsim/gsobject.py
@@ -1057,12 +1057,12 @@ def drawKImage(
1057
)
1058
1059
# Can't both recenter a provided image and add to it.
1060
- if recenter and image.center != PositionI(0, 0) and add_to_image:
1061
- raise _galsim.GalSimIncompatibleValuesError(
+ if recenter and add_to_image:
+ zp = PositionI(0, 0)
1062
+ equinox.error_if(
1063
+ zp.x,
1064
+ image.center != zp,
1065
"Cannot use add_to_image=True unless image is centered at (0,0) or recenter=False",
- recenter=recenter,
- image=image,
- add_to_image=add_to_image,
1066
1067
1068
# Set the center to 0,0 if appropriate
0 commit comments