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

Imprint step does not check for separate NIRSpec/IFU science and background imprints. #9083

Open
stscijgbot-jp opened this issue Jan 22, 2025 · 3 comments

Comments

@stscijgbot-jp
Copy link
Collaborator

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.

@stscijgbot-jp 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
@stscijgbot-jp
Copy link
Collaborator Author

Comment by David Law on JIRA:

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

@stscijgbot-jp
Copy link
Collaborator Author

Comment by Christian Hayes on JIRA:

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.

@stscijgbot-jp
Copy link
Collaborator Author

Comment by David Law on JIRA:

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant