[fitsbits] 16-bit floats {External}
Richard J. Mathar
mathar at mpia-hd.mpg.de
Mon Jul 28 08:27:40 EDT 2025
There are two pairs of shoes here: i) support of the 16bit "half" float on
processors is very unlikely to happen, because on every architecture in the past the
designs went towards wider float types. (AI may change that ..?)
ii) support of the 16bit float in libraries (C23 for example) is added by implementing
parsers that expand these to 32bit "single precision" float and continuing artihmetics
with the "single precision" floating point libraries. This is for example the
current ARM status
https://developer.arm.com/documentation/100067/0611/Other-Compiler-specific-Features/Half-precision-floating-point-data-types
and the gcc handling
https://gcc.gnu.org/onlinedocs/gcc/Half-Precision.html
iii) In the TIFF format there are rumors in https://pypi.org/project/tifffile/
(see "Notes") that TIFF supports 16bit floats, but I suspect this claim is wrong;
I have not found a TIFF documentation to support that view.
If the TIFF file supports these floats, one may use the Foreign File Encapsulation
Convention of https://gcc.gnu.org/onlinedocs/gcc/Half-Precision.html
to include TIFF images in FITS files. This is very efficient because
TIFF supports a wide range of compression algorithms.
In summary, even if the storage format is supported (as disk capacities
and streaming bandswiths *are always* an issue), there will be a small run-time
overhead by parsing the 16bit-floats in and out of their 32bit-float processor registers.
Richard Mathar
Heidelberg
More information about the fitsbits
mailing list