Skip to content

Commit

Permalink
JP-3151: Don't make associations for NRS2 IFU if detector not illumin…
Browse files Browse the repository at this point in the history
…ated (#8395)

Co-authored-by: Howard Bushouse <[email protected]>
  • Loading branch information
stscirij and hbushouse committed Apr 4, 2024
1 parent 804743f commit fa153cc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
1.14.1 (unreleased)
===================

associations
------------

- Ensure NRS IFU exposures don't make a spec2 association for grating/filter combinations
where the nrs2 detector isn't illuminated. Remove dupes in mkpool. [#8395]

documentation
-------------

Expand Down
7 changes: 6 additions & 1 deletion jwst/associations/lib/rules_level2b.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,12 @@ def __init__(self, *args, **kwargs):
)
],
reduce=Constraint.notany
)
),
SimpleConstraint(
value=True,
test=lambda value, item: nrsifu_valid_detector(item),
force_unique=False
),
])

# Now check and continue initialization.
Expand Down
3 changes: 2 additions & 1 deletion jwst/associations/mkpool.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,10 @@ def mkpool(data,

params = params.difference(IGNORE_KEYS)
params = [item.lower() for item in params]
# Make sure there's no duplicates
params = list(set(params))
params.sort()
defaults = {param: 'null' for param in params}

pool = AssociationPool(names=params, dtype=[object] * len(params))

# Set default values for user-settable non-header parameters
Expand Down
2 changes: 1 addition & 1 deletion jwst/associations/tests/test_exposerr.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_exposerr():
pool=pool
)
asns = generated.associations
assert len(asns) > 1
assert len(asns) == 1
for asn in asns:
any_degraded = False
for product in asn['products']:
Expand Down

0 comments on commit fa153cc

Please sign in to comment.