[AstroPy] Changing table column from float64 to float32

Benjamin Weiner bjweiner at gmail.com
Tue Jul 12 12:52:34 EDT 2022


 Ivan Valtchanov <ivvv68 at gmail.com> wrote:

> Yes, I managed to do the change of float64 to float32 columns using
> astropy.table.Table.
> It's funny how people keep float64 columns in huge catalogues for
something
> that's perfectly well stored with float32, e.g. RA, Dec, LII, BII, MJD,
> etc... It's true that RAM is cheap nowadays but this laziness puzzles me a
> lot (/rant_over).

Hi,

Glad you found a solution.

For quantities that have a large value but where small differences may be
important, using double precision is often warranted.  Single precision has
a precision of 1 in 2^23 or about 6.9 dex in log. This translates to of
order 0.1 arcsecond in RA/Dec, or 9 minutes of time on an MJD of 50000.
Propagating truncation errors through further code or processing can
magnify these effects, which is one reason that catalog makers carry around
the extra digits and internal routines/constants are often written in
double where explicit typing is needed.

Cheers,
Ben


>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/astropy/attachments/20220712/c00846ad/attachment.html>


More information about the AstroPy mailing list