diff --git a/jax_galsim/interpolatedimage.py b/jax_galsim/interpolatedimage.py index c1c1e4e9..bd4556ef 100644 --- a/jax_galsim/interpolatedimage.py +++ b/jax_galsim/interpolatedimage.py @@ -27,7 +27,6 @@ from jax_galsim.interpolant import Quintic from jax_galsim.photon_array import PhotonArray from jax_galsim.position import PositionD -from jax_galsim.random import UniformDeviate from jax_galsim.transform import Transformation from jax_galsim.utilities import convert_interpolant from jax_galsim.wcs import BaseWCS, PixelScale @@ -866,13 +865,12 @@ def _shoot(self, photons, rng): ).astype(int) yinds, xinds = jnp.unravel_index(inds, img.array.shape) - xedges = jnp.arange(0, img.bounds.deltax + 1) - 0.5 - yedges = jnp.arange(0, img.bounds.deltay + 1) - 0.5 + # the photons come from this index location + xcens = jnp.arange(0, img.bounds.deltax + 1) + img.bounds.xmin + ycens = jnp.arange(0, img.bounds.deltay + 1) + img.bounds.ymin + photons.x = xcens[xinds] + photons.y = ycens[yinds] - # now we draw the position within the pixel - ud = UniformDeviate(rng) - photons.x = ud.generate(photons.x) + xedges[xinds] + img.bounds.xmin - photons.y = ud.generate(photons.y) + yedges[yinds] + img.bounds.ymin # this magic set of factors comes from the galsim C++ code in # a few spots it is # diff --git a/tests/GalSim b/tests/GalSim index 2ba20589..729191f0 160000 --- a/tests/GalSim +++ b/tests/GalSim @@ -1 +1 @@ -Subproject commit 2ba20589733027df75a86da79a86f141dd10450d +Subproject commit 729191f02b01318c1100238173c5da4218fbe7ca