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-3173: Add NIRSpec optical path constraints for TSO associations #8537

Merged
merged 6 commits into from
Jun 11, 2024
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
4 changes: 3 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ associations
- Added default values for new non-header keywords (``MOSTILNO`` and ``DITHPTIN``)
to the default values in the ``asn_make_pool`` script. [#8508]

- Create WFSS Pure-Parallel associations [#8528]
- Create WFSS Pure-Parallel associations. [#8528]

- Add NIRSpec optical path constraints for TSO associations. [#8537]

combine_1d
----------
Expand Down
18 changes: 18 additions & 0 deletions jwst/associations/lib/rules_level2b.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,24 @@ def __init__(self, *args, **kwargs):
)
],
reduce=Constraint.notany
),
# Don't allow NIRSpec invalid optical paths in spec2
Constraint(
[
Constraint([
DMSAttrConstraint(
name='exp_type',
sources=['exp_type'],
value=('nrs_brightobj')
),
SimpleConstraint(
value=False,
test=lambda value, item: nrsfss_valid_detector(item) == value,
force_unique=False
),
]),
],
reduce=Constraint.notany
)
])

Expand Down
28 changes: 23 additions & 5 deletions jwst/associations/lib/rules_level3.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,19 +881,19 @@ def __init__(self, *args, **kwargs):
DMSAttrConstraint(
name='restricted_grism',
sources=['exp_type'],
value = ('nrc_tsgrism')
value=('nrc_tsgrism')
),
DMSAttrConstraint(
name='grism_clear',
sources=['pupil'],
value = ('clear')
value=('clear')
),
]),
Constraint([
DMSAttrConstraint(
name='restricted_ts',
sources=['exp_type'],
value = 'nrc_tsgrism'
value='nrc_tsgrism'
),
DMSAttrConstraint(
name='module',
Expand All @@ -911,12 +911,30 @@ def __init__(self, *args, **kwargs):
DMSAttrConstraint(
name='exp_type',
sources=['exp_type'],
value = ('nis_soss')
value=('nis_soss')
),
DMSAttrConstraint(
name='nints',
sources=['nints'],
value = ('1')
value=('1')
),
]),
],
reduce=Constraint.notany
),
# Don't allow NIRSpec invalid optical paths in TSO3
Constraint(
[
Constraint([
DMSAttrConstraint(
name='exp_type',
sources=['exp_type'],
value=('nrs_brightobj')
),
SimpleConstraint(
value=False,
test=lambda value, item: nrsfss_valid_detector(item) == value,
force_unique=False
),
]),
],
Expand Down
2 changes: 1 addition & 1 deletion jwst/associations/tests/data/pool_021_tso.csv
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ set acid|OBS_ID|PROGRAM|OBS_NUM|VISIT|VISIT_ID|VISITGRP|WFSVISIT|SEQ_ID|ACT_ID|E
@!fmt_fname(next(expnum))|V99009003001P0000000002102|99009|@!next(obsnum)|1|99009003001|2|NULL|1|2|1|NIS_SOSS|NULL|NULL|NIRISS|CENTRAL|NULL|1|M-33|NULL|FIXED|NIRISS WFSS|SCIENCE|2|1|1|1|1|NULL|F140M|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NIS_CEN|2015_1|FULL|NULL|NULL|NULL|@!fmt_cand([(next(obsnum), 'OBSERVATION')])|N|N|N|T
@!fmt_fname(next(expnum))|V99009003001P0000000002102|99009|@!next(obsnum)|1|99009003001|2|NULL|1|2|1|NRC_TSIMAGE|NULL|NULL|NIRCAM|CENTRAL|NULL|1|M-33|NULL|FIXED|NIRISS WFSS|SCIENCE|2|1|1|1|1|NULL|F140M|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NIS_CEN|2015_1|FULL|NULL|NULL|NULL|@!fmt_cand([(next(obsnum), 'OBSERVATION')])|N|N|N|T
@!fmt_fname(next(expnum))|V99009003001P0000000002102|99009|@!next(obsnum)|1|99009003001|2|NULL|1|2|1|NRC_TSGRISM|NULL|NULL|NIRCAM|CENTRAL|NULL|1|M-33|NULL|FIXED|NIRISS WFSS|SCIENCE|2|1|1|1|1|NULL|F140M|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NIS_CEN|2015_1|FULL|NULL|NULL|NULL|@!fmt_cand([(next(obsnum), 'OBSERVATION')])|N|N|N|T
@!fmt_fname(next(expnum))|V99009003001P0000000002102|99009|@!next(obsnum)|1|99009003001|2|NULL|1|2|1|NRS_BRIGHTOBJ|NULL|NULL|NIRSPEC|CENTRAL|NULL|1|M-33|NULL|FIXED|NIRISS WFSS|SCIENCE|2|1|1|1|1|NULL|F140M|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NIS_CEN|2015_1|FULL|NULL|NULL|NULL|@!fmt_cand([(next(obsnum), 'OBSERVATION')])|N|N|N|T
@!fmt_fname(next(expnum))|V99009003001P0000000002102|99009|@!next(obsnum)|1|99009003001|2|NULL|1|2|1|NRS_BRIGHTOBJ|NULL|NULL|NIRSPEC|NRS1|NULL|1|M-33|NULL|FIXED|NIRISS WFSS|SCIENCE|2|1|1|1|1|NULL|CLEAR|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NIS_CEN|2015_1|FULL|PRISM|S1600A1|NULL|@!fmt_cand([(next(obsnum), 'OBSERVATION')])|N|N|N|T
#
# Set ACID to how many have been used.
set acid|OBS_ID|PROGRAM|OBS_NUM|VISIT|VISIT_ID|VISITGRP|WFSVISIT|SEQ_ID|ACT_ID|EXPOSURE|EXP_TYPE|NEXPOSUR|EXPCOUNT|INSTRUME|DETECTOR|CHANNEL|TARGETID|TARGPROP|TARGNAME|TARGTYPE|TEMPLATE|PNTGTYPE|PNTG_SEQ|TARGORDN|EXPSPCIN|DITHPTIN|MOSTILNO|MODULE|FILTER|PUPIL|DITHERID|PATTTYPE|PATTSTRT|NUMDTHPT|PATTSIZE|SUBPXPNS|PATT_NUM|SUBPXNUM|SUBPIXEL|APERNAME|SDP_VER|SUBARRAY|GRATING|FXD_SLIT|BAND|@!acid.set(acid.value)|BACKGROUND|IS_IMPRT|IS_PSF|IS_TSO
2 changes: 1 addition & 1 deletion jwst/associations/tests/data/pool_022_tso_noflag.csv
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ set acid|OBS_ID|PROGRAM|OBS_NUM|VISIT|VISIT_ID|VISITGRP|WFSVISIT|SEQ_ID|ACT_ID|E
@!fmt_fname(next(expnum))|V99009003001P0000000002102|99009|@!next(obsnum)|1|99009003001|2|NULL|1|2|1|NIS_SOSS|NULL|NULL|NIRISS|CENTRAL|NULL|1|M-33|NULL|FIXED|NIRISS WFSS|SCIENCE|2|1|1|1|1|NULL|F140M|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NIS_CEN|2015_1|FULL|NULL|NULL|NULL|@!fmt_cand([(next(obsnum), 'OBSERVATION')])|N|N|N|T
@!fmt_fname(next(expnum))|V99009003001P0000000002102|99009|@!next(obsnum)|1|99009003001|2|NULL|1|2|1|NRC_TSIMAGE|NULL|NULL|NIRCAM|CENTRAL|NULL|1|M-33|NULL|FIXED|NIRISS WFSS|SCIENCE|2|1|1|1|1|NULL|F140M|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NIS_CEN|2015_1|FULL|NULL|NULL|NULL|@!fmt_cand([(next(obsnum), 'OBSERVATION')])|N|N|N|T
@!fmt_fname(next(expnum))|V99009003001P0000000002102|99009|@!next(obsnum)|1|99009003001|2|NULL|1|2|1|NRC_TSGRISM|NULL|NULL|NIRCAM|CENTRAL|NULL|1|M-33|NULL|FIXED|NIRISS WFSS|SCIENCE|2|1|1|1|1|NULL|F140M|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NIS_CEN|2015_1|FULL|NULL|NULL|NULL|@!fmt_cand([(next(obsnum), 'OBSERVATION')])|N|N|N|T
@!fmt_fname(next(expnum))|V99009003001P0000000002102|99009|@!next(obsnum)|1|99009003001|2|NULL|1|2|1|NRS_BRIGHTOBJ|NULL|NULL|NIRSPEC|CENTRAL|NULL|1|M-33|NULL|FIXED|NIRISS WFSS|SCIENCE|2|1|1|1|1|NULL|F140M|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NIS_CEN|2015_1|FULL|NULL|NULL|NULL|@!fmt_cand([(next(obsnum), 'OBSERVATION')])|N|N|N|T
@!fmt_fname(next(expnum))|V99009003001P0000000002102|99009|@!next(obsnum)|1|99009003001|2|NULL|1|2|1|NRS_BRIGHTOBJ|NULL|NULL|NIRSPEC|NRS1|NULL|1|M-33|NULL|FIXED|NIRISS WFSS|SCIENCE|2|1|1|1|1|NULL|CLEAR|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NULL|NIS_CEN|2015_1|FULL|PRISM|S1600A1|NULL|@!fmt_cand([(next(obsnum), 'OBSERVATION')])|N|N|N|T
#
# Set ACID to how many have been used.
set acid|OBS_ID|PROGRAM|OBS_NUM|VISIT|VISIT_ID|VISITGRP|WFSVISIT|SEQ_ID|ACT_ID|EXPOSURE|EXP_TYPE|NEXPOSUR|EXPCOUNT|INSTRUME|DETECTOR|CHANNEL|TARGETID|TARGPROP|TARGNAME|TARGTYPE|TEMPLATE|PNTGTYPE|PNTG_SEQ|TARGORDN|EXPSPCIN|DITHPTIN|MOSTILNO|MODULE|FILTER|PUPIL|DITHERID|PATTTYPE|PATTSTRT|NUMDTHPT|PATTSIZE|SUBPXPNS|PATT_NUM|SUBPXNUM|SUBPIXEL|APERNAME|SDP_VER|SUBARRAY|GRATING|FXD_SLIT|BAND|@!acid.set(acid.value)|BACKGROUND|IS_IMPRT|IS_PSF|TSOVISIT
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': True,
},
'jw00818_20230407t030411_pool': {
'args': [],
'xfail': None,
'slow': False,
},
'jw00839_20221220t025418_pool': {
'args': ['-i', 'o002', 'c1000'],
'xfail': None,
Expand Down