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

JP-3147 Treat PSF exposures as science for Level 2 association processing #7508

Merged
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----------------

Expand Down
31 changes: 27 additions & 4 deletions jwst/associations/lib/rules_level2_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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


Expand Down
5 changes: 5 additions & 0 deletions jwst/regtest/test_associations_sdp_pools.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@
'xfail': None,
'slow': False,
},
'jw01194_20230115t113819_pool': {
'args': [],
'xfail': None,
'slow': True,
},
'jw01257_20221201t192226_pool': {
'args': [],
'xfail': None,
Expand Down