spacetelescope / jwst

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

TSO3 outlier_detection step does not use time-dependant information on spectroscopic TSOs #5276

Closed stscijgbot-jp closed 7 months ago

stscijgbot-jp commented 4 years ago

Issue JP-1655 was created on JIRA by Nestor Espinoza:

Currently, the outlier_detection step for spectroscopic TSOs is set to go by default by the outlier_detection_step.py script to the outlier_detection.py algorithm (https://github.com/spacetelescope/jwst/blob/02d64bc2d4871f5f0e11d11e9f1653519e2cf7d5/jwst/outlier_detection/outlier_detection_step.py#L125), which does not re-scale the median image to each of the frames when performing outlier detection on spectroscopic TSOs.

I believe this might be dangerous for most TSO observations (e.g., transiting exoplanets, variable stars), in which individual pixels might have better than 1% uncertainties. Very deep transits for instance can be as large as 4%. Depending on the number of out-of-transit points, for instance, the median frame might either resemble the counts in or out-of-transit, and depending on that flag either in or out-of-transit pixels. On top of that, the whole algorithmic performance might depend on whether or not there is an astrophysical event at place at a given integration.

I have already seen that even in its current form, transit events significantly change the behavior of the algorithm. For instance, I have followed one of the many pixels the algorithm is (I believe, wrongly; see https://jira.stsci.edu/browse/JP-1654) detecting as outliers in NIRISS/SOSS simulations (see that same ticket for details on those simulations). Image of this experiment is attached (code to reproduce it, here: https://github.com/nespinoza/dat_pyinthesky/blob/test/jdat_notebooks/soss-transit-spectroscopy/HAT-P-1b-CheckOutlierDetection.ipynb). In it, it can be seen that inside the transit event (happening between integrations 500 to 700), lower counts are detected as outliers much more often that higher counts.

Moving forward, I think both spatial (see, e.g., Section 2.1 here: https://arxiv.org/abs/2008.05480) and spatio-temporal (see, e.g., Section 2.1 here: https://ui.adsabs.harvard.edu/abs/2014MNRAS.437...46N/abstract and Section 2.4 here: https://ui.adsabs.harvard.edu/abs/2018MNRAS.474.1705N/abstract) algorithms should be implemented in the pipeline for TSOs. The latter algorithms mentioned in those references are from Nikolov et al. (2014, 2018), and are extremely simple and effective. These involve checking grouped frame-to-frame differences in the flux (in our case, those would correspond to integration-to-integration changes in the flux), so astrophysical signals do not impact on the outlier-detection procedure (the same can be accomplished through, e.g., median filters in time). We might benefit from the fact that Nikolay Nikolov (lead author of those works) is a staff member of the institute to implement those, which has given very good results on HST TSOs.

I've marked the priority as high, as I believe not implementing those could heavily impact on the kind of science that can be done with the TSO3 products.

stscijgbot-jp commented 2 years ago

Comment by Anton Koekemoer on JIRA:

This has been scheduled for discussion at JWST Cal WG meeting 2020-10-27

 

stscijgbot-jp commented 2 years ago

Comment by Anton Koekemoer on JIRA:

This was discussed at JWST Cal WG meeting 2020-10-27

 

stscijgbot-jp commented 2 years ago

Comment by Anton Koekemoer on JIRA:

After further iteration on possible dates, this has been scheduled for a full discussion at JWST Cal WG meeting 2021-01-05 where Nestor Espinoza  will give a presentation on the algorithm and how it would be expected to fit into the pipeline.

stscijgbot-jp commented 2 years ago

Comment by Anton Koekemoer on JIRA:

This was revisited in a follow-on JWST Cal WG meeting 2020-05-04 where Nikolay Nikolov  gave a presentation on the proposed TSO3 algorithm after having run it on simulated data from MIRAGE. The consensus from the meeting was that it's not yet clear whether enough CRs escape the Stage 1 jump detection that this TSO3 outlier algorithm is needed in the automated pipeline at this stage, and there was also a desire to examine in-flight data first before the next steps, but it was felt important enough to continue its development, for offline use initially, with resources coming from the TSO WG.

Meanwhile some of the problems identified in this ticket may be related to issues in the Stage 1 jump detection step, so this ticket will remain open until Stage 1 jump detection has been further investigated.

stscijgbot-jp commented 7 months ago

Comment by David Law on JIRA:

Superseded by https://jira.stsci.edu/browse/JP-3584, closing.