diff --git a/CHANGES.rst b/CHANGES.rst index 226e869f7d..6899e2c5d3 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -7,6 +7,9 @@ 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] +- Match NIRSpec imprint observations to science exposures on mosaic tile location + and dither pointing, ``MOSTILNO`` and ``DITHPTIN``. [#8410] + documentation ------------- diff --git a/jwst/associations/lib/rules_level2_base.py b/jwst/associations/lib/rules_level2_base.py index 9243b35537..fe07c1463a 100644 --- a/jwst/associations/lib/rules_level2_base.py +++ b/jwst/associations/lib/rules_level2_base.py @@ -774,11 +774,7 @@ def __init__(self): DMSAttrConstraint( name='imprint', sources=['is_imprt'] - ), - DMSAttrConstraint( - name='mosaic_tile', - sources=['mostilno'], - ), + ) ], reprocess_on_match=True, work_over=ListCategory.EXISTING, diff --git a/jwst/associations/lib/rules_level2b.py b/jwst/associations/lib/rules_level2b.py index 5217591266..a6c2677ccd 100644 --- a/jwst/associations/lib/rules_level2b.py +++ b/jwst/associations/lib/rules_level2b.py @@ -304,9 +304,29 @@ def __init__(self, *args, **kwargs): ), Constraint( [ + # Allow either any background, or ensure imprint and science members + # match on mosaic tile number and dither pointing position. Constraint_Background(), - Constraint_Imprint(), - Constraint_Single_Science(self.has_science, self.get_exposure_type), + Constraint( + [ + Constraint( + [ + Constraint_Imprint(), + Constraint_Single_Science(self.has_science, self.get_exposure_type), + ], + reduce=Constraint.any + ), + DMSAttrConstraint( + name='mostilno', + sources=['mostilno'] + ), + DMSAttrConstraint( + name='dithptin', + sources=['dithptin'] + ) + ], + reduce=Constraint.all + ), ], reduce=Constraint.any ), diff --git a/jwst/regtest/test_associations_sdp_pools.py b/jwst/regtest/test_associations_sdp_pools.py index ce25e54432..4f02c0692e 100644 --- a/jwst/regtest/test_associations_sdp_pools.py +++ b/jwst/regtest/test_associations_sdp_pools.py @@ -87,6 +87,11 @@ 'xfail': None, 'slow': True, }, + 'jw01192_o008_pool.csv': { + 'args': ['-i', 'o008'], + 'xfail': None, + 'slow': False, + }, 'jw01194_20230115t113819_pool': { 'args': [], 'xfail': None,