-
-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cosmicray_lacosmic does not return numpy.ndarray #796
Comments
Thanks for reporting this @ppmim -- would you happen to have time to open a pull request to fix the issue? |
I was having a related issue that seems to stem from the same thing! I noticed that _astroscrappy_gain_apply_helper()'s docstring says that gain should actually be a float, but cosmicray_lacosmic() is passing it a Quantity. This causes it to output a Quantity with incorrect units instead of a numpy array (although even with correct units, the Quantity still causes issues when using other functions that expect a numpy array). I have more detailed example code showing the issue if needed, but here's the gist of it with a small test .fits file:
^ I think subtract_overscan() expects ccd.data not to have units at all--it throws an error even if the units are corrected. I've tested out passing the helper gain.value instead of gain, and it fixes both this issue and the earlier one as far as I can tell, so I'll send in a pull request shortly! |
Fixes #796 - cosmicray_lacosmic data type return
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 is a astropy.units.quantity.Quantity instead of numpy.ndarray.
The versions I am using are:
4.3.1
2.3.1
1.21.5
The text was updated successfully, but these errors were encountered: