reproject icon indicating copy to clipboard operation
reproject copied to clipboard

Reprojection changes floating point precision

Open NimSed opened this issue 1 year ago • 2 comments

Hi there.

This very line: https://github.com/astropy/reproject/blob/3bb79cdfab86da32169bbbb73e907e22ad9783aa/reproject/interpolation/core.py#L95 changes an input array with dtype=float32 to float64.

Could we replace it with a mere check (for all floating point types) instead, and raise an error in case the input isn't a float?

NimSed avatar Mar 16 '23 22:03 NimSed

I just created this PR: https://github.com/astropy/reproject/pull/354 Please feel free to scrap it if it doesn't make sense.

NimSed avatar Mar 16 '23 22:03 NimSed

Update: Of course, the PR fails for many of the dtypes in this test :face_with_head_bandage: But how did it pass the test before, since ALL_DTYPES seems to contain, all dtypes, including i, u (here) :thinking:

NimSed avatar Mar 16 '23 22:03 NimSed