From a2b6ca8a089aee8b87591d719e1a720eefd98ccb Mon Sep 17 00:00:00 2001 From: Eddie Schlafly Date: Thu, 19 Oct 2023 13:02:14 -0400 Subject: [PATCH] Updates for galsim 2.5. (#87) --- pyproject.toml | 2 +- romanisim/bandpass.py | 6 ++---- romanisim/tests/test_psf.py | 5 ++--- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c01fc15e..a21ed639 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ dependencies = [ 'astropy >=5.3', 'crds >=10.3.1', 'defusedxml >=0.5.0', - 'galsim >=2.3.5', + 'galsim >=2.5.0', 'rad >=0.17.1', 'roman_datamodels >=0.17.1', 'gwcs >=0.18.1', diff --git a/romanisim/bandpass.py b/romanisim/bandpass.py index 92d38791..93d6e210 100644 --- a/romanisim/bandpass.py +++ b/romanisim/bandpass.py @@ -23,12 +23,10 @@ # provide some translation dictionaries for the mapping from # the galsim bandpass names to the Roman bandpass names and vice versa. # it would be nice to be agnostic about which one we use. -galsim_bandpasses = ['Z087', 'Y106', 'J129', 'H158', 'F184', 'W149'] +galsim_bandpasses = [ + 'R062', 'Z087', 'Y106', 'J129', 'H158', 'F184', 'K213', 'W146'] galsim2roman_bandpass = {x: 'F' + x[1:] for x in galsim_bandpasses} roman2galsim_bandpass = {v: k for k, v in galsim2roman_bandpass.items()} -# we should add some support for F213 (K) and F062. That would require getting -# zodiacal light estimates and maybe making a bandpass. -# W149 is probably the same as F146 but we should compare. # provide some no-ops if we are given a key in the right bandpass galsim2roman_bandpass.update(**{k: k for k in roman2galsim_bandpass}) diff --git a/romanisim/tests/test_psf.py b/romanisim/tests/test_psf.py index ba8f9fa8..b89aa8b7 100644 --- a/romanisim/tests/test_psf.py +++ b/romanisim/tests/test_psf.py @@ -43,6 +43,5 @@ def test_make_psf(): assert totsum > 0.9 # assert that image catches no more than 100% and no less than 90% # of flux? - assert np.min(im) > np.max(im) * (-1e-4) - # ideally nothing negative, though we could loosen this to, say, - # > -1e-3 * peak and I wouldn't feel too bad. + assert np.min(im) > np.max(im) * (-1e-3) + # ideally nothing negative