diff --git a/CHANGES.rst b/CHANGES.rst index c9608240d7..a5a7c290ed 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -11,6 +11,8 @@ associations - Remove extra reprocessing of existing associations. [#7506] +- Treat PSF exposures as science for Level 2 association processing. [#7508] + calwebb_detector1 ----------------- diff --git a/jwst/associations/lib/rules_level2_base.py b/jwst/associations/lib/rules_level2_base.py index fbcef648ef..ec0b886f6e 100644 --- a/jwst/associations/lib/rules_level2_base.py +++ b/jwst/associations/lib/rules_level2_base.py @@ -119,6 +119,31 @@ def __init__(self, *args, **kwargs): if 'asn_pool' not in self.data: self.data['asn_pool'] = 'none' + def get_exposure_type(self, item, default='science'): + """General Level 2 override of exposure type definition + + The exposure type definition is overridden from the default + for the following cases: + + - 'psf' -> 'science' + + Parameters + ---------- + item : dict + The pool entry to determine the exposure type of + default : str or None + The default exposure type. + If None, routine will raise LookupError + Returns + ------- + exposure_type + Always what is defined as `default` + """ + self.original_exposure_type = super(DMSLevel2bBase, self).get_exposure_type(item, default=default) + if self.original_exposure_type == 'psf': + return default + return self.original_exposure_type + def members_by_type(self, member_type): """Get list of members by their exposure type""" member_type = member_type.lower() @@ -1101,12 +1126,10 @@ def get_exposure_type(self, item, default='science'): exposure_type Always what is defined as `default` """ + self.original_exposure_type = super(AsnMixin_Lv2Special, self).get_exposure_type(item, default=default) if self.has_science(): - if super(AsnMixin_Lv2Special, self).get_exposure_type(item, default=default) == 'imprint': + if self.original_exposure_type == 'imprint': return 'imprint' - else: - self.original_exposure_type = super(AsnMixin_Lv2Special, self).get_exposure_type(item, default=default) - return default diff --git a/jwst/regtest/test_associations_sdp_pools.py b/jwst/regtest/test_associations_sdp_pools.py index b3c62e83f6..c50bd85b19 100644 --- a/jwst/regtest/test_associations_sdp_pools.py +++ b/jwst/regtest/test_associations_sdp_pools.py @@ -77,6 +77,11 @@ 'xfail': None, 'slow': False, }, + 'jw01194_20230115t113819_pool': { + 'args': [], + 'xfail': None, + 'slow': True, + }, 'jw01257_20221201t192226_pool': { 'args': [], 'xfail': None,