From 30f1756b5a4fe7eb9d9252c2dedb802daa83864c Mon Sep 17 00:00:00 2001 From: Nihar Dalal <140463192+nihardalal@users.noreply.github.com> Date: Tue, 4 Aug 2026 11:47:02 -0700 Subject: [PATCH 1/2] Flip to WFI coords and document the flip Flipped the coordinate system, and added some justification/documentation --- galsim/roman/roman_psfs.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/galsim/roman/roman_psfs.py b/galsim/roman/roman_psfs.py index 2e9a71db21..752478500e 100644 --- a/galsim/roman/roman_psfs.py +++ b/galsim/roman/roman_psfs.py @@ -290,6 +290,12 @@ def __make_aperture(SCA, pupil_plane_type, pupil_bin, wave, gsparams): pupil_plane_im = pupil_plane_im.bin(pupil_bin,pupil_bin) + #The project provides pupils in the exit frame orientation. To switch to WFI coords, we need to flip following: + #https://github.com/Roman-HLIS-Cosmology-PIT/PSFSim/blob/main/docs/coordinates.rst, which has the chirality + #looking in the telescope. Can be accomplished by flipping the vertical axis. + + pupil_plane_im = pupil_plane_im[::-1, :] + aper = Aperture(lam=wave, diam=diameter, obscuration=obscuration, pupil_plane_im=pupil_plane_im, From e70e9c221ede7206fccef05a50eba72d70bc24d5 Mon Sep 17 00:00:00 2001 From: nihardalal Date: Tue, 4 Aug 2026 15:30:18 -0400 Subject: [PATCH 2/2] Fixed to use galsim transformation isntead --- galsim/roman/roman_psfs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/galsim/roman/roman_psfs.py b/galsim/roman/roman_psfs.py index 752478500e..a374f64aba 100644 --- a/galsim/roman/roman_psfs.py +++ b/galsim/roman/roman_psfs.py @@ -294,7 +294,7 @@ def __make_aperture(SCA, pupil_plane_type, pupil_bin, wave, gsparams): #https://github.com/Roman-HLIS-Cosmology-PIT/PSFSim/blob/main/docs/coordinates.rst, which has the chirality #looking in the telescope. Can be accomplished by flipping the vertical axis. - pupil_plane_im = pupil_plane_im[::-1, :] + pupil_plane_im = pupil_plane_im.flip_ud() aper = Aperture(lam=wave, diam=diameter, obscuration=obscuration,