Skip to content

Commit

Permalink
Add check for dq when data is NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
melanieclarke committed May 21, 2024
1 parent 5f6f4a9 commit ddaf8d7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions jwst/flatfield/tests/test_flatfield.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ def test_nirspec_bots_flat():
for ext in ['data', 'err', 'var_rnoise', 'var_poisson', 'var_flat']:
test_data = getattr(result, ext)
assert np.all(np.isnan(test_data[~nn]))
assert np.all(result.dq[~nn] | datamodels.dqflags.pixel['DO_NOT_USE'])

# error is propagated from non-empty fflat error
# (no other additive contribution, scale from data is 1.0)
Expand Down Expand Up @@ -265,6 +266,7 @@ def test_nirspec_fs_flat(srctype):
for ext in ['data', 'err', 'var_rnoise', 'var_poisson', 'var_flat']:
test_data = getattr(result.slits[0], ext)
assert np.all(np.isnan(test_data[~nn]))
assert np.all(result.slits[0].dq[~nn] | datamodels.dqflags.pixel['DO_NOT_USE'])

# error is propagated from non-empty fflat error
# (no other additive contribution, scale from data is 1.0)
Expand Down Expand Up @@ -321,6 +323,7 @@ def test_nirspec_msa_flat():
for ext in ['data', 'err', 'var_rnoise', 'var_poisson', 'var_flat']:
test_data = getattr(result.slits[0], ext)
assert np.all(np.isnan(test_data[~nn]))
assert np.all(result.slits[0].dq[~nn] | datamodels.dqflags.pixel['DO_NOT_USE'])

# error is propagated from non-empty fflat error
# (no other additive contribution, scale from data is 1.0)
Expand Down Expand Up @@ -364,6 +367,7 @@ def test_nirspec_ifu_flat():
for ext in ['data', 'err', 'var_rnoise', 'var_poisson', 'var_flat']:
test_data = getattr(result, ext)
assert np.all(np.isnan(test_data[~nn]))
assert np.all(result.dq[~nn] | datamodels.dqflags.pixel['DO_NOT_USE'])

# error is propagated from non-empty fflat error
# (no other additive contribution, scale from data is 1.0)
Expand Down

0 comments on commit ddaf8d7

Please sign in to comment.