You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The imprint step does not separate science and background imprints when searching for the correct imprint to subtract. A related issue is that in some cases (e.g., PID 2162 obs 1), there is one imprint for all science exposures and a separate imprint for all background exposures. In this case the science imprint should be used for all of the science exposures, and similar for the backgrounds. The current imprint step logic checks to see if there are multiple imprints. If there is only one it will use it. If there are multiple, it will try to the dither position of the input image with the associated imprint, but if there are only two imprints (one for sci and another for bkg), it will fail to find a matching imprint for anything except the first dither.
Using 2162 obs 1 as an example: visit group/activity number 02101 = sci, 02103 = bkg, 02105 = sci imprint, 02107 = bkg imprint. 02105 should be used for all 4 science dithers, and 02107 should be used for all 4 background dithers.
One possible solution would be to sort the imprints into sci vs. bkg using the meta.observation.bkgdtarg and check the same keyword in the input file to identify which list to use. Then the imprint step could follow its current logic: if there is only one appropriate imprint use it, and if there are more than one try to find the one that matches the dither position of the input file.
The text was updated successfully, but these errors were encountered:
stscijgbot-jp
changed the title
Imprint step does not check for separate science and background imprints.
Imprint step does not check for separate NIRSpec/IFU science and background imprints.
Jan 22, 2025
While we should fix this in the asn generator, I'd also be inclined to add a function to do this into the NIRSpec IFU pipeline notebook. See discussion on spacetelescope/jwst-pipeline-notebooks#29
That sounds good, I'll discuss with Kayli about putting together an asn generator function for the IFU pipeline notebook. We had been leery about this originally just to avoid putting something together to sort out how to do all of the recommended nod vs dedicated backgrounds and imprint associations, but it may be useful for users to know how to do it themselves. We'll follow up on that PR.
Just as a note, I've opened up a separate ticket about the association generation issue with imprints that we were running into, since the issue on this ticket is separate and specific to the imprint step in the code (though thematically related to the asn issue). Asn ticket here: https://jira.stsci.edu/browse/JP-3853]. If it's preferred to merge them let me know.
Just chiming in that the logic describes above sounds reasonable to me, using dither positions as a selector after the sci vs background sets have already been split out. That seems consistent with the original goal but fixing an oversight in the original logic.
Issue JP-3852 was created on JIRA by Christian Hayes:
The imprint step does not separate science and background imprints when searching for the correct imprint to subtract. A related issue is that in some cases (e.g., PID 2162 obs 1), there is one imprint for all science exposures and a separate imprint for all background exposures. In this case the science imprint should be used for all of the science exposures, and similar for the backgrounds. The current imprint step logic checks to see if there are multiple imprints. If there is only one it will use it. If there are multiple, it will try to the dither position of the input image with the associated imprint, but if there are only two imprints (one for sci and another for bkg), it will fail to find a matching imprint for anything except the first dither.
Using 2162 obs 1 as an example: visit group/activity number 02101 = sci, 02103 = bkg, 02105 = sci imprint, 02107 = bkg imprint. 02105 should be used for all 4 science dithers, and 02107 should be used for all 4 background dithers.
One possible solution would be to sort the imprints into sci vs. bkg using the meta.observation.bkgdtarg and check the same keyword in the input file to identify which list to use. Then the imprint step could follow its current logic: if there is only one appropriate imprint use it, and if there are more than one try to find the one that matches the dither position of the input file.
The text was updated successfully, but these errors were encountered: