-
Notifications
You must be signed in to change notification settings - Fork 171
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
NIRISS WFSS set SRC_TYPE in extract_2d JP-1917 #5788
NIRISS WFSS set SRC_TYPE in extract_2d JP-1917 #5788
Conversation
@hbushouse @sosey I don't think these changes will affect other GRISM type data. The GrismObject may contain the is_star information but it is only used in extract_2d/grism.py so I don't think these changes will break any thing else. |
Codecov Report
@@ Coverage Diff @@
## master #5788 +/- ##
==========================================
+ Coverage 75.81% 75.97% +0.15%
==========================================
Files 406 406
Lines 36608 36882 +274
==========================================
+ Hits 27756 28021 +265
- Misses 8852 8861 +9
*This pull request uses carry forward flags. Click here to find out more.
Continue to review full report at Codecov.
|
How about the idea of adding I know it's a bit hokey to define a new model attribute just to carry one piece of info to the very next step where it'll get replaced or superseded by another model attribute, but at least that way we maintain consistency in terms of having the |
Just to be clear we would leave the updates to the GrismObject into include is_star (since that information is read from the source catalog). But add is_star to slit_model and set it in extract_2d/grism.py Then we can set the SRCTYPE in the scrtype step where it really should be. |
Right. Include |
71f4976
to
27a4aff
Compare
jwst/extract_2d/grisms.py
Outdated
@@ -476,7 +476,10 @@ def extract_grism_objects(input_model, | |||
# The overall subarray offset is recorded in model.meta.subarray. | |||
# nslit = obj.sid - 1 # catalog id starts at zero | |||
new_slit.name = "{0}".format(obj.sid) | |||
new_slit.source_type = 'UNKNOWN' | |||
if obj.is_star: | |||
new_slit.is_star = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think any logic is needed here to make a choice of what to set, but instead simply set new_slit.is_star = obj.is_star
, in order to carry along the value of is_star
to the srctype
step, where it will set the appropriate value of source_type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes I meant to remove the settling of source type. Some how my push did not include this update. I did it on a different branch by mistake :(
jwst/srctype/srctype.py
Outdated
@@ -156,6 +156,14 @@ def set_source_type(input_model): | |||
log.info(f'Input is a TSO exposure; setting default SRCTYPE = {src_type}') | |||
input_model.meta.target.source_type = src_type | |||
|
|||
# FOR NIR_WFSS check slit values of is_star to set SRCTYPE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be done for all WFSS modes, so that includes NRC_WFSS
and NIS_WFSS
. This means that some of the change log entries above need to be updated to indicate that these changes apply to WFSS in general, not just NIS_WFSS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not all the familiar with WFSS mode. I did a search on WFSS in the pipeline and frequently get these modes:
WFSS_EXPTYPES = ['NIS_WFSS', 'NRC_WFSS', 'NRC_GRISM', 'NRC_TSGRISM']
NRC_TSGRISM is a mode that is already handled in the srctype code. But I could not find NRC_GRISM
Do I need to add it to this too ?
CHANGES.rst
Outdated
extract_2d | ||
---------- | ||
|
||
- For NIS_WFSS removed setting sorce_type to UNKNOW, added setting is_star to slitmeta [#5788] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be for all WFSS now, not just NIS_WFSS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, except for one minor wording issue in change log.
b3d9e57
to
68f52b7
Compare
This pr concerns JP-1917.
The GrismObject defined in transforms/model.py was updated to include 'is_star'
assign_wcs/util.py also had to be updated to pass this information along.
The code that sets SRC_TYPE for each slit in a NIRISS WFSS is in extract_2d/grism.py
A question I have is in the srctype step there is code that sets input_model.meta.target.source_type = src_type.
The log message to screen for running NIRISS WFSS in spec2 using a source catalog reports:
2021-02-25 15:56:15,579 - stpipe.Spec2Pipeline.srctype - WARNING - EXP_TYPE NIS_WFSS not applicable to this operation
2021-02-25 15:56:15,580 - stpipe.Spec2Pipeline.srctype - WARNING - Setting SRCTYPE = UNKNOWN
But I am not sure what input_model.meta.target.source_type is For NIRISS WFSS. We need to set the SRCTYPE for each slit not the input_model.meta.target.source_type.
Running this branch on NIRISS WFSS data results in the x1d files with SRCTYPE = 'POINT' for the is_star = True values in the source catalog.
Fixes #5731 / JP-1917