From 312511fc927268c401ed1d50bbad057db441bd1c Mon Sep 17 00:00:00 2001 From: beckermr Date: Thu, 7 May 2026 05:46:01 -0500 Subject: [PATCH 1/3] test: figure out what fails with photon shooting --- tests/GalSim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/GalSim b/tests/GalSim index 2ba20589..ef8e6464 160000 --- a/tests/GalSim +++ b/tests/GalSim @@ -1 +1 @@ -Subproject commit 2ba20589733027df75a86da79a86f141dd10450d +Subproject commit ef8e646408787eb22fc1c652846b6b02e69f8352 From 93aad594c5abe041988ebb8c2388d48f47681873 Mon Sep 17 00:00:00 2001 From: beckermr Date: Thu, 7 May 2026 10:54:23 -0500 Subject: [PATCH 2/3] fix: do not draw from pixel in interpolated image photon shooting --- jax_galsim/interpolatedimage.py | 12 +++++------- tests/GalSim | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) 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 ef8e6464..95985414 160000 --- a/tests/GalSim +++ b/tests/GalSim @@ -1 +1 @@ -Subproject commit ef8e646408787eb22fc1c652846b6b02e69f8352 +Subproject commit 9598541484df0c364c1e093b6592c2ea78bca647 From ed69e21083b5b2a0a9afe6a165e63e0f67127af3 Mon Sep 17 00:00:00 2001 From: beckermr Date: Thu, 7 May 2026 14:10:37 -0500 Subject: [PATCH 3/3] test: put tests submodule back --- tests/GalSim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/GalSim b/tests/GalSim index 95985414..729191f0 160000 --- a/tests/GalSim +++ b/tests/GalSim @@ -1 +1 @@ -Subproject commit 9598541484df0c364c1e093b6592c2ea78bca647 +Subproject commit 729191f02b01318c1100238173c5da4218fbe7ca