[fitsbits] Output array type when BZERO is an integer {External}

Pearson, Timothy J. tjp at astro.caltech.edu
Tue Mar 12 14:59:15 EDT 2024


On Mar 12, 2024, at 9:16 AM, Mark Calabretta via fitsbits <fitsbits at listmgr.nrao.edu> wrote:

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.

Precisely what I was going to say myself! And I would add that in the early days the presence or not of  decimal point in the value for BSCALE or BZERO was not intended to convert any information about how the conversion should be done in code. If BSCALE or BZERO has an integer value but is being used to convert to a floating-point internal representation, then it should be obvious that floating-point arithmetic should be used (even if the standard implies something different).

Tim Pearson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listmgr.nrao.edu/pipermail/fitsbits/attachments/20240312/0114b65d/attachment.html>


More information about the fitsbits mailing list