spacetelescope / jwst

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

Proposed enhancement of extract1d step for NIRISS SOSS data #8398

Open stscijgbot-jp opened 5 months ago

stscijgbot-jp commented 5 months ago

Issue JP-3588 was created on JIRA by Joseph Filippazzo:

BACKGROUND: For NIRISS SOSS data, the extract1d step of the pipeline uses (by default) the ATOCA algorithm, which is an optimal spectral extraction routine that disentangles the signals from the overlapping order 1 and order 2 traces. This routine is very sensitive to the wavelength value assigned to each pixel by the ‘wavemap' reference file and the location of the trace centers assigned by the ‘spectrace’ reference file.    PROBLEM: These reference files assume that the pupil wheel for the GR700XD grism is in its nominal position, dispersing the spectra onto the same detector pixels each time. However, the SOSS team’s analysis has shown that SOSS observations exhibit a range of pupil wheel positions (recorded as the PWCPOS value in the FITS header) that do not align with the nominal positions represented in the CRDS reference files.   SOLUTION: To account for this misalignment when reducing SOSS data, the SOSS team has developed the PASTASOSS Python package (https://github.com/spacetelescope/pastasoss) that transforms the pixel wavelength values and trace positions to reflect those seen in on-sky observations at a variety of PWCPOS values. We have created a pull request of the jwst pipeline (https://github.com/spacetelescope/jwst/pull/8397) which incorporates this package to solve our problem. It reads in the PWCPOS value from an input JWST DataModel and saves the appropriate ‘wavemap’ and ‘spectrace’ reference files on the fly to perform the optimal extraction. It then updates the locations of the corrected reference files in the DataModel before performing the 1D spectral extraction with the ATOCA algorithm. All input requirements and output data products remain unaffected by this change and the ‘override_wavemap' and ‘override_spectrace’ keyword arguments still function as intended. 

stscijgbot-jp commented 5 months ago

Comment by David Law on JIRA:

Thanks Joseph Filippazzo ; let's discuss at the JP meeting next week.  One quick comment though from looking at the pull request- generally the pipeline has tried to avoid introducing new dependencies, so importing directly from pastasoss would probably not be ideal.

stscijgbot-jp commented 5 months ago

Comment by Nestor Espinoza on JIRA:

Hi David! We understand, but we have worked very hard on PASTASOSS and we are convinced is the best long-term solution possible for SOSS needs. PASTASOSS is also an STScI-supported tool.

stscijgbot-jp commented 1 month ago

Comment by Tyler Pauly on JIRA:

Hi Joseph Filippazzo! I'm back from leave and reasonably up to date on this project - do you want to have a chat about your current progress and plans? I took a look at the slides you sent, and I have a suggestion or two on implementation.