ccdproc icon indicating copy to clipboard operation
ccdproc copied to clipboard

cosmicray_lacosmic does not return numpy.ndarray

Open ppmim opened this issue 3 years ago • 1 comments

I have found that cosmicray_lacosmic does not return numpy.ndarray, but a astropy.units.quantity.Quantity. The problem comes from _astroscrappy_gain_apply_helper(), where the comparison with gain != 1 is always true, and I think it should be as 'gain.value != 1'.

So, when we run:

newdata, mask = cosmicray_lacosmic(data, sigclip=5)

newdata is a astropy.units.quantity.Quantity instead of numpy.ndarray.

The versions I am using are:

import astropy
print(astropy.__version__)
import ccdproc
print(ccdproc.__version__)
import numpy
print(numpy.__version__)

4.3.1 2.3.1 1.21.5

ppmim avatar Oct 05 '22 08:10 ppmim

Thanks for reporting this @ppmim -- would you happen to have time to open a pull request to fix the issue?

mwcraig avatar Oct 06 '22 02:10 mwcraig