diff --git a/tests/test_draw.py b/tests/test_draw.py index 082ed16cc1..421231c464 100644 --- a/tests/test_draw.py +++ b/tests/test_draw.py @@ -527,15 +527,6 @@ def test_drawKImage(): """Test the various optional parameters to the drawKImage function. In particular test the parameters image, and scale in various combinations. """ - if is_jax_galsim(): - maxk_threshold = 1.e-3 - N = 880 - Ns = 28 - else: - maxk_threshold = 1.e-4 - N = 1174 - Ns = 37 - # We use a Moffat profile with beta = 1.5, since its real-space profile is # flux / (2 pi rD^2) * (1 + (r/rD)^2)^3/2 # and the 2-d Fourier transform of that is @@ -543,13 +534,14 @@ def test_drawKImage(): # So this should draw in Fourier space the same image as the Exponential drawn in # test_drawImage(). obj = galsim.Moffat(flux=test_flux, beta=1.5, scale_radius=0.5) - obj = obj.withGSParams(maxk_threshold=maxk_threshold) + obj = obj.withGSParams(maxk_threshold=1.e-4) # First test drawKImage() with no kwargs. It should: # - create new images # - return the new images # - set the scale to 2pi/(N*obj.nyquist_scale) im1 = obj.drawKImage() + N = 1174 np.testing.assert_equal(im1.bounds, galsim.BoundsI(-N/2,N/2,-N/2,N/2), "obj.drawKImage() produced image with wrong bounds") stepk = obj.stepk @@ -571,7 +563,7 @@ def test_drawKImage(): # - also return that image # - set the scale to obj.stepk # - zero out any existing data - im3 = galsim.ImageCD(N-25,N-25) + im3 = galsim.ImageCD(1149,1149) im4 = obj.drawKImage(im3) np.testing.assert_almost_equal(im3.scale, stepk, 9, "obj.drawKImage(im3) produced image with wrong scale") @@ -619,7 +611,7 @@ def test_drawKImage(): np.testing.assert_almost_equal(CalculateScale(im7), 2, 1, "Measured wrong scale after obj.drawKImage(dx)") # This image is smaller because not using nyquist scale for stepk - np.testing.assert_equal(im7.bounds, galsim.BoundsI(-Ns,Ns,-Ns,Ns), + np.testing.assert_equal(im7.bounds, galsim.BoundsI(-37,37,-37,37), "obj.drawKImage(dx) produced image with wrong bounds") # Test if we provide an image with a defined scale. It should: