spacetelescope / jwst

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

Spec2 error for NIRISS SOSS full-frame non-TSO exposure #8572

Closed stscijgbot-jp closed 1 week ago

stscijgbot-jp commented 2 weeks ago

Issue JP-3662 was created on JIRA by Howard Bushouse:

jw01209-o001_20240614t162206_spec2_00001_asn.json contains a single NIRISS SOSS exposure taken with full-frame readout and in non-TSO mode. The ATOCA algorithm in extract_1d is not setup to handle full-frame images, so extract_1d properly skips with a warning. That however then causes the photom step to fail, because the input datamodel has no "spec" attribute (no extracted spectrum) and the hook in the photom step that's meant to catch the situation where extract_1d was skipped only works if the input is a "CubeModel". If the SOSS exposure was taken in TSO mode, the input would indeed be a CubeModel and the hook in the photom step would work properly and also cause that step to skip. But in this case, because the exposure was not taken in TSO mode, the input to spec2 is a "rate" file (ImageModel), instead of "rateints" (CubeModel). 

We need to modify the logic in either the spec2 pipeline or the photom step to trap this situation and cleanly skip whenever the extract_1d step has been skipped, regardless of input datamodel type.

Note that this problem was thought to be solved by the work done for JP-3325, but those changes only work for the case where the input is a CubeModel.

stscijgbot-jp commented 1 week ago

Comment by Howard Bushouse on JIRA:

Fixed by #8575