spacetelescope / jwst

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

Associate LRS slitless observation with dedicated background. #8803

Closed stscijgbot-jp closed 2 days ago

stscijgbot-jp commented 1 month ago

Issue JP-3754 was created on JIRA by Greg Sloan:

Observers are advised to obtain a dedicated background for LRS slitless (TSO) spectroscopy, and can link the background and science observation in the APT. However, the pipeline by default will not associate the two observations, and thus will not use the dedicated observation to subtract the background. Users can run the pipeline manually and subtract a background, but the pipeline should be able to recognize the existence of a dedicated background and subtract it automatically.

stscijgbot-jp commented 1 month ago

Comment by Tyler Pauly on JIRA:

Hi Greg, do you have an example program that has utilized this option? Bonus points if the program has been executed.

stscijgbot-jp commented 1 month ago

Comment by Ian Wong on JIRA:

From a cursory look through the pipeline code, all spectroscopic TSO observations appear to be assigned the Asn_Lv2SpecTSO association rule set, which does not currently allow for non-science exposures to be added.

Could this rule be updated to allow for linked background exposures (in an analogous way to how it is handled in other observing modes)?

stscijgbot-jp commented 1 month ago

Comment by Ian Wong on JIRA:

Tyler Pauly see, for example, PID 4496 Obs 4, which is paired with the dedicated background observation Obs 5

stscijgbot-jp commented 1 month ago

Comment by Tyler Pauly on JIRA:

Thanks Ian! That should be sufficient test data for us to get a solution in order.

stscijgbot-jp commented 1 month ago

Comment by Greg Sloan on JIRA:

Ian should get the bonus points. All of PID 4496 has been executed.

stscijgbot-jp commented 2 weeks ago

Comment by Tyler Pauly on JIRA:

Hi Ian Wong, in the linked JPPS ticket, Ernie looked at the program in APT and found no link between the science observation and the dedicated background observation. I don't know if this is an APT UI issue or a user error when building the APT program file - feel free to follow up there. From the Cal pipeline perspective, we aren't able to generate associations unless an association candidate exists; the candidate is populated in the PPS database when the link is created in APT. We'll need to resolve this "upstream" issue before Cal can work on association generation.

stscijgbot-jp commented 6 days ago

Comment by Gary Curtis on JIRA:

As Ernie noted in APT-94139, this is due to user error. There may be improvements we could make to the UI or documentation but APT is behaving as expected. Please comment APT-94139 if you would like to propose improvements.  

stscijgbot-jp commented 6 days ago

Comment by David Law on JIRA:

Perhaps a better test case then would be PID 1529, Obs 5 which looks like it is properly linked to the background Obs 6.

stscijgbot-jp commented 6 days ago

Comment by Tyler Pauly on JIRA:

Looking at 1529, I see c1003 background candidate associations, and processing the background candidate versus the science exposure alone produces the attached results (manually renamed the output of strun calwebb_spec2 jw01529-c1003_20240704t003936_spec2_00001_asn.json because the names would otherwise be the same). It looks like the pipeline is applying a background subtraction, though I can't tell if it looks as you would expect it to. [^jw01529005001_03103_00011_mirimage_cal_bkgsubtracted.fits] [^jw01529005001_03103_00011_mirimage_cal.fits]

And a comparison with fixed scale in ds9:

stscijgbot-jp commented 6 days ago

Comment by David Law on JIRA:

Looks like really bad EMI, likely because it's just 7 groups.  I didn't see this association on the Archive though, perhaps it's in the middle of reprocessing?  If this case is producing background-subtracted association products though it's unclear to me that there's anything for this ticket to do.  Ian Wong ?

stscijgbot-jp commented 2 days ago

Comment by Ian Wong on JIRA:

Yes, the associations for Obs 5 look good. Seems like the associations are working well.

stscijgbot-jp commented 2 days ago

Comment by David Law on JIRA:

Thanks for confirming Ian Wong ; in that case I'm going to close this ticket as no work required.