From 9df6eb1628f6074813b6874dcc69a58a94c6cb94 Mon Sep 17 00:00:00 2001 From: Marshall Perrin Date: Tue, 21 May 2024 12:02:07 -0400 Subject: [PATCH 1/2] add a CI test function for the NIRCam DHS support. Follow up to #845 --- webbpsf/tests/test_nircam.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/webbpsf/tests/test_nircam.py b/webbpsf/tests/test_nircam.py index dc898d74..2a12c64e 100644 --- a/webbpsf/tests/test_nircam.py +++ b/webbpsf/tests/test_nircam.py @@ -640,3 +640,14 @@ def test_ways_to_specify_detectors(): nrc.detector = 'nrcblong' assert nrc.detector == 'NRCB5', "nrcblong should be synonymous to nrcb5" + +def test_dhs(): + """Basic test that it's possible to calculate a PSF for one of the NIRCam DHS subapertures""" + nrc = webbpsf_core.NIRCam() + + nrc.pupil_mask = 'DHS_07' + + psf = nrc.calc_psf(monochromatic=2e-6) + + assert isinstance(psf, fits.HDUList), "the returned PSF should be a FITS HDUList" + assert 0.03 < psf[0].data.sum() < 0.05, "a DHS aperture should have low throughput around a few percent" From d27c878801f15b7007970908f0eba6a48578e46b Mon Sep 17 00:00:00 2001 From: Marshall Perrin Date: Tue, 21 May 2024 13:14:08 -0400 Subject: [PATCH 2/2] pep8 --- webbpsf/tests/test_nircam.py | 1 + 1 file changed, 1 insertion(+) diff --git a/webbpsf/tests/test_nircam.py b/webbpsf/tests/test_nircam.py index 2a12c64e..51724a15 100644 --- a/webbpsf/tests/test_nircam.py +++ b/webbpsf/tests/test_nircam.py @@ -641,6 +641,7 @@ def test_ways_to_specify_detectors(): nrc.detector = 'nrcblong' assert nrc.detector == 'NRCB5', "nrcblong should be synonymous to nrcb5" + def test_dhs(): """Basic test that it's possible to calculate a PSF for one of the NIRCam DHS subapertures""" nrc = webbpsf_core.NIRCam()