Article View: sci.astro.fits
Article #64Re: VAX R*8 to FITS/IEEE R*8 conversion problem
From: Don Jennings
Date: Thu, 17 Dec 1992 19:41
Date: Thu, 17 Dec 1992 19:41
47 lines
3126 bytes
3126 bytes
In article <9212171630.AA05949@tetra.gsfc.nasa.gov> William Pence writes:
I think you mean 5B, not 8B (?)
Yes, I meant 5B not 8B; sorry for the dyslexia
My reaction to this is that it is not very useful to put information in a FITS file
that only a particular machine will be able to interpret. One of the main purposes of
FITS is to make the information in the file portable to any machine. So I think
you have 2 choices.
1. If this added precision in the VAX value is really significant, then you
need to find a portable way of including it in the FITS file. One way might be
to express the double precision value as 2 columns: one containing the integer
part, and the other containing the fractional part of the value.
2. If the added precision in the VAX value is not really significant (the VAX
G_floating datatype has effectively 4 more bits of precision than an IEEE R*8 value)
then one should not worry about it, and one should accept the fact that the
FITS file cannot preserve every last bit of information on every type of machine.
The precision is significant, in that we must be able to repoduce the original
data byte for byte. Breaking the VAX R*8 up into an IEEE R*8 + remainder would
still introduce roundoff error.
As an aside, I'm sure you are aware that the VAX has 2 different R*8 data
representations. The default D_floating representation which you are probably using
reserves 8 bits for the exponent and 55 bits for the mantissa. The G_floating
representation on the otherhand is similar to the IEEE R*8 representation: both
have 11 bits for the exponent and 52 bits for the mantissa. The G_floating
and IEEE values are still not identical though because the VAX interprets the
exponent and mantissa numbers as normalized, ("hidden bit normalization") which
effectively gives you another bit of precision compared to the IEEE value.
If you were to use G_floating on the VAX, you probably would not notice the
loss of precision in converting the data back and forth from FITS.
I was aware of the D_floating and G_floating compiler options, but did not
know that much about them. Unfortunately, the data is produced using D_floating
and there is nothing we can do about it.
Thanks for your interest Bill. I'll think about what you had to say.
Don Jennings
Technical Details
Message-ID:
<JENNINGS.92Dec17144132@antwrp.antwrp.gsfc.nasa.gov>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!caen!saimiri.primate.wisc.edu!ames!nsisrv!news2.gsfc.nasa.gov!jenningsReferences:
<9212171630.AA05949@tetra.gsfc.nasa.gov>Show Full Headers
Complete Article Headers
Newsgroups: sci.astro.fits Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!caen!saimiri.primate.wisc.edu!ames!nsisrv!news2.gsfc.nasa.gov!jennings From: jennings@antwrp.antwrp.gsfc.nasa.gov (Don Jennings) Subject: Re: VAX R*8 to FITS/IEEE R*8 conversion problem In-Reply-To: pence@tetra.gsfc.nasa.gov's message of Thu, 17 Dec 1992 16: 30:58 GMT Message-ID: <JENNINGS.92Dec17144132@antwrp.antwrp.gsfc.nasa.gov> Sender: usenet@nsisrv.gsfc.nasa.gov (Usenet) Nntp-Posting-Host: antwrp.gsfc.nasa.gov Organization: Compton Gamma Ray Observatory Science Support Center References: <9212171630.AA05949@tetra.gsfc.nasa.gov> Date: Thu, 17 Dec 1992 19:41:32 GMT Lines: 49