Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add test function for the NIRCam DHS support. #857

Merged
merged 2 commits into from
May 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Loading