spacetelescope / dat_pyinthesky

Notebooks for "notebook-driven development" for the Data Analysis Tools efforts
https://dat-pyinthesky.readthedocs.io/en/latest/
8 stars 44 forks source link

Added notebook testing optimal extraction #163

Closed ojustino closed 2 years ago

ojustino commented 2 years ago

This is another test for specreduce, this time looking at optimal/Horne extraction. Steps are adapted from another JDAT notebook on the same topic and I've written a template class for performing the extractions since specreduce only currently supports boxcar extraction.

It was written using 2D spectra from VLT as data so that we also have a non-JWST frame of reference to use when building from here and #158. I believe I ran into the same kosmos error as in #158, so anyone testing will need to make a local fix to their installation before everything works.

review-notebook-app[bot] commented 2 years ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

PatrickOgle commented 2 years ago

Science review: 1) Seems to follow the Horne algorithm pretty closely, which is good. 2) An constant/mean kernel profile will not work for JWST or other data sets where the profile FWHM changes with wavelength. Need to add the option of computing a wavelength dependent kernel (perhaps boxcar of image in spectral direction). 3) I would like to see a comparison of the outputs of boxcar extract (constant weighting) with HorneExtract for the same spectrum, to demonstrate that the signal to noise is significantly improved. 4) It looks like columns with NaNs are discarded completely. It would be better to mask bad pixels individually, as there may be good signal in some rows of a column that has NaNs or bad data. 5) Are weights used only as a Boolean mask, or to they also factored in to the optimal extraction weighting? 6) Want to add an option to provide a reference star spectrum to derive the kernel, rather than the object itself.

Good progress!

ojustino commented 2 years ago

Reviews of this notebook have moved over to astropy/specreduce#84 and we have no intention of adding it to dat_pyinthesky, so I will close this pull request.