Skip to content

Commit

Permalink
Merge pull request #857 from mperrin/test_dhs
Browse files Browse the repository at this point in the history
add test function for the NIRCam DHS support.
  • Loading branch information
obi-wan76 authored May 22, 2024
2 parents 898c1ea + d27c878 commit 5d521c9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions webbpsf/tests/test_nircam.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,3 +640,15 @@ 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"

0 comments on commit 5d521c9

Please sign in to comment.