Skip to content

Commit

Permalink
adjust tol
Browse files Browse the repository at this point in the history
  • Loading branch information
beckermr committed Oct 16, 2023
1 parent e71e541 commit c59a64a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/test_moffat.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
from galsim_test_helpers import *

path, filename = os.path.split(__file__)
imgdir = os.path.join(path, "SBProfile_comparison_images") # Directory containing the reference
# images.
# Directory containing the reference images.
imgdir = os.path.join(path, "SBProfile_comparison_images")


@timer
def test_moffat():
Expand Down Expand Up @@ -198,7 +199,11 @@ def test_moffat_maxk():
rtol = 1.e-7 if psf.trunc == 0 else 3.e-3
fk = psf.kValue(psf.maxk,0).real/psf.flux
print(f'{psf.beta} \t {int(psf.trunc)} \t {thresh:.1e} \t {fk:.3e}')
np.testing.assert_allclose(abs(psf.kValue(psf.maxk,0).real)/psf.flux, thresh, rtol=rtol)
if hasattr(galsim, "_galsim"):
rtol_fac = 10.0
else:
rtol_fac = 1.0
np.testing.assert_allclose(abs(psf.kValue(psf.maxk,0).real)/psf.flux, thresh, rtol=rtol * rtol_fac)


@timer
Expand Down

0 comments on commit c59a64a

Please sign in to comment.