spacetelescope / jwst

Python library for science observations from the James Webb Space Telescope
https://jwst-pipeline.readthedocs.io/en/latest/
Other
561 stars 167 forks source link

Moving target extraction coordinates not working as expected for IFU #8796

Open stscijgbot-jp opened 2 weeks ago

stscijgbot-jp commented 2 weeks ago

Issue JP-3750 was created on JIRA by David Law:

Prompted by https://jira.stsci.edu/browse/JP-3544, I tried testing spectral extraction on some IFU moving targets as well and ran into some problems.

Specifically, for PID 2361 Obs 5 (MIRI MRS observations of a rapidly moving asteroid) the nominal RA/DEC based extraction location from the final dither-combined data cube is off by 4-5 arcsec.  This isn't obvious though from the default extractions, since MRS sets ifu_autocen=True for point sources by default, meaning that the code will find the source and center up on it anyway rather than trusting the input coordinates.  However, we should fix the bug anyway as it could likely affect NIRSpec too, and would cause issue if there were source confusion.

I've confirmed that the pipeline is correctly building the final ifu cube on the moving_target frame, so that looks ok.  Rather, the TARG_RA, TARG_DEC coordinates given in the dither-combined cube header are those for the first exposure.  The moving target frame however (based on my reading of the documentation) uses the average WCS of the association rather than the WCS of the first frame.

The relevant location to fix this may therefore be in the cube building header metadata blending code.