[fitsbits] Output array type when BZERO is an integer {External} {External}
Mark Calabretta
mark at calabretta.id.au
Tue Mar 12 12:16:15 EDT 2024
On Tue, 12 Mar 2024 10:02:05 +0000 (GMT)
Mark Taylor via fitsbits <fitsbits at listmgr.nrao.edu> wrote:
> ... I would say it's the job of the FITS standard
> to explain how values are represented in the serialization, and the
> job of implementors to make language-appropriate choices about how
> to decode that serialization into language-appropriate data structures.
Precisely. I believe this is also essentially what Bill Pence said in
explaining how cfitsio works (in reply to Gregory Dubois-Felsman - it
didn't appear on the list).
For the benefit of FITS implementors with fewer grey hairs, there is
something that should be pointed out. When FITS was devised in the
early 1980s there was no standard floating point format, IEEE 754 came
later. Thus it was not possible to devise a portable image format based
on floating point values. In that era, ALL FITS images were integer-
valued; BSCALE and BZERO were essential to convert them into meaningful
physical values. Your implementation could do the conversion on the fly
when the file was read, or later when the pixel values were used. (If I
rememmber correctly, AIPS allowed you to choose). Later, when IEEE 754
was adopted by FITS, BSCALE and BZERO essentially became redundant for
floating-valued images, which predominated.
The bottom line, though, is that it's up to you to decide how best to
store the data within your application. That is not the job of the
FITS standard.
Mark Calabretta
More information about the fitsbits
mailing list