🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: sci.astro.fits
Article #67

Re: VAX R*8 to FITS/IEEE R*8 conversion problem

#67
From: William Thompson, code 682.1, x2...
Date: Thu, 17 Dec 1992 20:04
42 lines
2926 bytes
In article <JENNINGS.92Dec17085450@antwrp.antwrp.gsfc.nasa.gov>, jennings@antwrp.antwrp.gsfc.nasa.gov (Don Jennings) writes...
>My organization often needs to convert data that is native to the VAX
>architecture into a FITS format. Since the VAX real*8 bit pattern is different
>from the FITS/IEEE real*8 bit pattern, it is not possible to completely
>encapsulate a VAX real*8 in a IEEE real*8; specificly, a loss of precision
>occurs when transforming a VAX real*8 into an IEEE real*8.
> 
>One solution we have devised is to save the 7th byte of VAX real*8 values, 
>where the loss of precision occurs, and add them to a column of the binary
>table where the real*8 values are being stored. The following is a suggested
>list of rules for the extra column:
> 
>   It would always be the last column of the table.

This statement alone raises warning flags in my mind.  I'm firmly of the
opinion that the structure of binary tables should not in any way depend on the
order in which the columns appear.  If you're going to do something like this,
you should indicate the column with an appropriate label (TTYPE).

> 
>   Each column entry would contain the 7th byte of all real*8 values
>   occurring in a given row. Thus, if a table row contained 5 real*8
>   values, then the extra column's TFORM code would be 8B, if the
>   row contained any real*8 variable length array entries then the
>   extra column's TFORM code would be PB(XXXX).
> 
>FITS readers residing on non-VAX architectures would be able to ignore the
>extra column, while VAX FITS readers could completely reconstruct the original
>real*8 value by reading the extra column's values.
> 
>Has anyone out there had this problem? Does anyone out there have a 
>different solution? If so, then I would like to hear from you. Please 
>send/post any general comments on the above scheme you might have as well. 
> 
>                    Don Jennings, COSSC/GSFC 

If that last byte is important, than it will be important regardless of what
computer you're analyzing the data on.  If so, then a better, more
machine-independent way of transferring the full significance of the data has
to be devised.  If it isn't important, then one shouldn't worry about it.

Bill Thompson
Technical Details
Message-ID: <17DEC199216040789@stars.gsfc.nasa.gov>
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!nsisrv!stars.gsfc.nasa.gov!thompson
References: <JENNINGS.92Dec17085450@antwrp.antwrp.gsfc.nasa.gov>

Show Full Headers
Complete Article Headers
Newsgroups: sci.astro.fits
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!nsisrv!stars.gsfc.nasa.gov!thompson
From: thompson@stars.gsfc.nasa.gov (William Thompson, code 682.1, x2040)
Subject: Re: VAX R*8 to FITS/IEEE R*8 conversion problem
Message-ID: <17DEC199216040789@stars.gsfc.nasa.gov>
News-Software: VAX/VMS VNEWS 1.4-b1  
Sender: usenet@nsisrv.gsfc.nasa.gov (Usenet)
Nntp-Posting-Host: stars.gsfc.nasa.gov
Organization: NASA/GSFC-Laboratory for Astronomy and Solar Physics
References: <JENNINGS.92Dec17085450@antwrp.antwrp.gsfc.nasa.gov>
Date: Thu, 17 Dec 1992 20:04:00 GMT
Lines: 42