Subject: More on units and scaling

From: "Clive Page, Leicester University, UK" <[email-masked]>
Date: Thu, 22 Apr 93 04:53:30 -0400

I agree with most of what Jonathan says, in particular I'd support the use
of "bin" as the 1-d analogue of "pixel".

(2) on the importance of conciseness: clearly "our" software (being by
definition good software) won't ever do anything so silly as to truncate
a units string, but we have to accept that an important reason for using
FITS is to make files that all the other FITS readers out there can handle.
Some of this may be nasty "not invented here" stuff, written by programmers
who haven't been to the right schools.  The shorter the units string the
better the chances of it surviving being handled by such nasty foreign
software.

(4) On the use of TSCAL/TZERO.
In theory this solves the problem, but if you work out what happens in
practice, each FITS reader has to take the values in the file and apply
the appropriate TSCAL and TZERO values to get an internal value.  If this
results in values outside the range 1e-38 to 1e38 (or thereabouts) it
will overflow in single precision on most computers I know.  On some
systems (e.g. Vaxes) it will even overflow in D-floating.  If such cases
are to be treated sensibly, the FITS reader software has to be alive to
such cases and convert to DOUBLE PRECISION.  But this won't solve the problem
in all cases, e.g. on a VAX using D-floating, or if the TSCAL value is as
large as 1e300.   These problems don't, of course, occur in the scaling
factor is put in the units string.  I can see that this argument goes 
against my preference for conciseness, but I think that pragmatism may
be an even more important principle.

Clive

---

From: "Jonathan McDowell" <[email-masked]>
Date: Thu, 22 Apr 93 09:51:13 -0400

> will overflow in single precision on most computers I know.  On some

 Oooh. You're right, aren't you, Clive? I hadn't thought that one
through. I withdraw my earlier recantation - the TSCAL problem
does you no good whatsoever with the  1.E44 erg/s case unless
you have a very clever reader. 

Now a way around this would be to mandate the TSCAL value to be 
considered part of the unit, and decree that our readers not
convert the FITS file value by applying the TSCAL/TZERO value,
but just leave it as it is. This goes against long FITS tradition
though. Perhaps we need an extra set of TUSCLnnn values which
are just like TSCAL except that they are considered to be part
of the unit rather than part of the FITS internal rescaling.
You can tell I quite like the idea of separating out the 
unit multiplier from the unit and want to save it if I can.

- Jonathan

---

From: "Clive Page, Leicester University, UK" <[email-masked]>
Date: Thu, 22 Apr 93 13:49:07 -0400

By the way, Jonathan, in an earlier message you said that there were now
standard prefixes from 1e-24 to 1e24.  This is new to me, indeed I thought
the standards committees stopped at around +-15 because they had run out
of greek words for things that were extremely small or extremely large.
What have they moved on to - Sanskit, Old Icelandic?   Seriously though,
it would be nice to see a complete list of them somewhere.

Clive