astropy / specreduce

Tools for the reduction of spectroscopic observations from Optical and NIR instruments
https://specreduce.readthedocs.io
61 stars 38 forks source link

Improper use of mask in HorneExtract #167

Open cshanahan1 opened 1 year ago

cshanahan1 commented 1 year ago

A user may (optionally) provide a mask along with their data to HorneExtract. Any NaNs in the image are added also to this mask (or used to create one, if one wasn't provided). If the dispersion axis is X, and there are ANY masked pixels in that column even outside of the trace, that column will not be fit.

I've attached some images below to demonstrate the issue. I created a flat spectrum with a gaussian profile, masked a single pixel in a subset of columns, and the extracted spectrum shows no values in those columns with masked pixels were fit. The mask wasn't being used to omit pixels from the fit, it is used to discard entire rows/columns.

cshanahan1 commented 1 year ago
Screen Shot 2023-04-05 at 1 11 37 PM
cshanahan1 commented 1 year ago
Screen Shot 2023-04-05 at 1 15 49 PM
cshanahan1 commented 1 year ago
Screen Shot 2023-04-05 at 1 12 18 PM