astropy / astroscrappy

Speedy Cosmic Ray Annihilation Package in Python
70 stars 34 forks source link

required numpy array dtype inconsistent with standard image data ranges #27

Closed michaelaye closed 6 years ago

michaelaye commented 7 years ago

The doctext of detect_cosmics says that the input should be a float numpy array, but the parameter satlevel default is given as 65538, which indicates that the function expects a uint16 data-type? By convention, float dtype image data should be 0.0...1.0 (or sometimes -1.0...1.0) but not use uint16 numbers up to 2**16. Could you clarify if detect_cosmics requires

Thanks!

cmccully commented 6 years ago

@michaelaye Sorry for the long delay on this. The default is to use the standard uint16 bit value, but it is only the default. The code automatically converts the image to a 32-bit floating point internally. For making a cosmic ray mask, this is nearly always sufficient. If you need higher precision for some reason, we should talk. In that case, I would recommend not using the "cleaned" array, but only take the mask. Feel free to close this if it answers your question.

michaelaye commented 6 years ago

Thanks. Just to be clear, that seems to mean that detect_cosmics works with all input ranges and all input data-types?

cmccully commented 6 years ago

As far as I know it should. If you run into issues let me know. You just need to set the saturate and gain values accordingly.

On Tue, Dec 19, 2017 at 4:40 PM K.-Michael Aye notifications@github.com wrote:

Thanks. Just to be clear, that seems to mean that detect_cosmics works with all input ranges and all input data-types?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/astropy/astroscrappy/issues/27#issuecomment-352930228, or mute the thread https://github.com/notifications/unsubscribe-auth/AFFcHDcRNedbEsRAAv3weIprlSdsDGatks5tCFdygaJpZM4M2VOM .

cmccully commented 6 years ago

@michaelaye Does this answer your question so I can close this?

cmccully commented 6 years ago

Closing this. Let me know if I need to reopen.