ccdproc
ccdproc copied to clipboard
cosmicray_lacosmic does not return numpy.ndarray
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
Thanks for reporting this @ppmim -- would you happen to have time to open a pull request to fix the issue?