[fitsbits] 16-bit floats {External}
Lucio Chiappetti
lucio at lambrate.inaf.it
Thu Jul 24 15:31:09 EDT 2025
On Thu, 24 Jul 2025, jaffe via fitsbits wrote:
> Whether a FITS storage format is supported by any programming language,
> or even any machine processor architecture is irrelevant, FITS is a
> transport standard. ... FITS reader/writers for any language or
> architecture have to be adapted to convert the FITS data into a locally
> functional format
That is true, and it was what I referred to as the early times when one
could write a reader of FITS magtapes on 36-bit or 60-bit mainframes. Or
different endianness.
However FITS evolved beyond a transport format and is very often used as a
working format.
On Thu, 24 Jul 2025, Barrett, Paul via fitsbits wrote:
> I suggest asking the question: What FITS library cannot handle 16-bit
> and 128-bit floats? We know that half-precision is supported in C/C++
> and FORTRAN, which means that it is potentially available in FITSIO,
> CFITSIO, and Python/numpy that depend on these languages.It is also
> available in Java ...
OK, this is part of the answer to my question on programming languages.
However even if a language supports a given data type, the programs (or
"apps" in "modern" talk :-(), from ds9 to ftools to whatever you like or
use, have to be rebuilt adding variable declarations for the new type/s.
On Thu, 24 Jul 2025, Seaman, Robert Lewis - (rseaman) via fitsbits wrote:
> This discussion would benefit from describing explicit science or
> engineering use cases. Which is to say, how much time and effort is it
> worth to the FITS community to add this to the standard and to the
> various libraries and applications? Will current software fail
> gracefully on encountering 16-bit floats?
I endorse above statement.
Also I seem to remember in the past there was a rule, or at least a
practice, that a new feature has tp be supported by two independent
existing implementattions.
> There is no reason to tie adopting a 16-bit format to support for
> 128-bit floats.
That's true and appropriate, specially if the standard changes have to be
voted according to the current IAU FWG voting rules. They might pass or
not pass separately.
> Statements like “16-bit floats would perform a lot better” and “16-bit
> floats would perform a lot better than using compression on 32-bit
> floats” need to be supported in such a proposal.
I endorse this too (see also the rule/practice above).
> And statements like “16-bit floats would allow a larger dynamic range
> than using 16-bit ints with BSCALE/BZERO” call out for exploration
I was just going to quote BSCALE/BZERO. For instance direct support to
unsigned data types was never included in FITS but could be emulated using
BSCALE/BZERO.
> Does anybody here regularly use 16-bit float ?
Personally I'd not even heard of them, and do not see any advantage (but
perhaps space saving). Even if I was used to use (!) 16-bit int, I see no
reason now to save memory space wrt 32-bit int. While I've seen lots of
lazy people using 64-bit float for items not requiring the precision and
exponent range of a double.
> And finally, even in the few messages so far in this thread, there have
> been arguments built on top of the original vision of FITS purely as an
> interchange format, and others built on the evolution of FITS into an
> archival format. The two kinds of format don’t necessarily benefit from
> the same features or suffer from the same bugs.
That's true (see also first statement on top). Which could also lead to an
usage scheme where one first "expands" ("converts" ?) files in the
mew/exotic/unusual/complex format to a simpler one, and then uses "good
old plain tools". For instance I support compression to save space for
storage and transmission, but never used it programmatically, but just use
fpack/funpack utilities.
> And finally, finally, discussions like this and about JPEGXL demonstrate
> that we need to revive the IAU FITS WG.
And that's even more true than all the rest, specially for a delicate item
like basic data formats.
--
Lucio Chiappetti - INAF/IASF - via Corti 12 - I-20133 Milano (Italy)
For more info : http://www.iasf-milano.inaf.it/~lucio/personal.html
------------------------------------------------------------------------
"Se si maneggiassero di più i libri che le armi, non si vedrebbero tante
stragi, tanti misfatti e tante brutture" (Aldo Manuzio, ca. 1506)
"If people would handle more books than weapons, we would not see so msny
carnages, misdeeds, and awful things." (Aldus Manutius, ca. 1506)
More information about the fitsbits
mailing list