Skip to content
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
run: |
ls -l $HOME
if test -d $HOME/des_data; then ls -l $HOME/des_data; fi
if ! test -d $HOME/des_data || ! test -f $HOME/des_data/DECam_00154912_01.fits.fz; then wget --no-check-certificate http://www.sas.upenn.edu/~mjarvis/des_data.tar.gz; tar xfz des_data.tar.gz -C $HOME; fi
if ! test -d $HOME/des_data || ! test -f $HOME/des_data/DECam_00154912_01.fits.fz; then wget "https://drive.usercontent.google.com/download?id=11-dRyJaH7RRrbk_vE53fZfT9WZGXkVa4&export=download&authuser=0&confirm=t&uuid=249c6a44-764d-4545-a5d5-48c181af9f5a&at=AMrWOn3ZoUdCALulXb1xzzAsvkBU%3A1789453625694" -O des_data.tar.gz; tar xfz des_data.tar.gz -C $HOME; fi
ln -s $HOME/des_data examples/des/

- name: Install basic dependencies
Expand Down
Binary file added devel/roman/mapping_v210503.pdf
Binary file not shown.
6 changes: 6 additions & 0 deletions galsim/roman/roman_psfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.flip_ud()

aper = Aperture(lam=wave, diam=diameter,
obscuration=obscuration,
pupil_plane_im=pupil_plane_im,
Expand Down
7 changes: 3 additions & 4 deletions galsim/zernike.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,14 +421,15 @@ def describe_zernike(j):
first = True
out = "sqrt({}) * (".format(var)

# i, k indicate powers of x and y, respectively.
for (i, k), val in np.ndenumerate(arr):
if val != 0:
if not first:
out += " + "
first = False
ival = int(np.round(val))
if ival != 1:
out += str(int(np.round(val)))
if ival != 1 or (i == 0 and k == 0):
out += str(ival)
if i >= 1:
out += "x"
if i >= 2:
Expand All @@ -442,8 +443,6 @@ def describe_zernike(j):
out = out.replace("(-1x", "(-x")
out = out.replace("(-1y", "(-y")
out = out.replace("+ -", "- ")
if out == "sqrt(1) * ()":
out = "sqrt(1) * (1)"
return out


Expand Down
5 changes: 4 additions & 1 deletion tests/test_draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,10 @@ def test_drawKImage():

# Other error combinations:
assert_raises(TypeError, obj.drawKImage, image=im6, bounds=bounds)
assert_raises(TypeError, obj.drawKImage, image=im6, dtype=int)
if not is_jax_galsim(): # jax-galsim adds the `dtype` keyword argument
assert_raises(TypeError, obj.drawKImage, image=im6, dtype=int)
Comment thread
beckermr marked this conversation as resolved.
Resolved
else:
assert_raises(galsim.GalSimValueError, obj.drawKImage, image=im6, dtype=int)
assert_raises(TypeError, obj.drawKImage, nx=3, ny=4, image=im6, scale=scale)
assert_raises(TypeError, obj.drawKImage, nx=3, ny=4, image=im6)
assert_raises(TypeError, obj.drawKImage, nx=3, ny=4, add_to_image=True)
Expand Down
5 changes: 3 additions & 2 deletions tests/test_interpolatedimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,12 @@ def test_interpolant():
check_pickle(galsim.SincInterpolant())
check_pickle(galsim.Interpolant.from_name('sinc'))

# jax v0.12 changes sinc to be more precise
true_xval = np.sinc(x)
np.testing.assert_allclose(s.xval(x), true_xval)
np.testing.assert_allclose(s.xval(x), true_xval, atol=1e-15)
true_kval = np.zeros_like(x)
true_kval[np.abs(x) < np.pi] = 1.
np.testing.assert_allclose(s.kval(x), true_kval)
np.testing.assert_allclose(s.kval(x), true_kval, atol=1e-15)
assert np.isclose(s.xval(x[12]), true_xval[12])
assert np.isclose(s.kval(x[12]), true_kval[12])

Expand Down
1 change: 1 addition & 0 deletions tests/test_zernike.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@ def test_describe_zernike():
assert galsim.zernike.describe_zernike(3) == "sqrt(4) * (y)"
assert galsim.zernike.describe_zernike(4) == "sqrt(3) * (-1 + 2y^2 + 2x^2)"
assert galsim.zernike.describe_zernike(10) == "sqrt(8) * (-3xy^2 + x^3)"
assert galsim.zernike.describe_zernike(11) == "sqrt(5) * (1 - 6y^2 + 6y^4 - 6x^2 + 12x^2y^2 + 6x^4)"

Z22str = (
"sqrt(7) * (-1 + 12y^2 - 30y^4 + 20y^6 + 12x^2"
Expand Down
Loading