View Single Post
  #1  
Old April 30th 07, 05:37 PM posted to sci.astro.fits
William Pence
external usenet poster
 
Posts: 66
Default [fitsbits] Packed binary values

Mike Nolan a écrit :
We're trying to data formats a new spectral instrument. It will produce
binary tables in a vaguely SDFITS-like format, with a table column
that contains a data array. The array will have multiple axes: time,
frequency, polarization, etc., usually with only the frequency axis
being nondegenerate, with table rows generated (say) once per second.
At moderate data rates, the header information changes slowly compared
to the spectral dump rate, and the time axis may become nondegenerate
within a record. However, at the highest data rates packed binary data
(say 2 bits per sample) will have to be stored, and we're trying to figure
out how to best describe those in a way consistent with "principle of
least astonishment". Do others have experience or suggestions with this?


One could write the packed data to a bit column in the binary table
with TFORMn = 'rX'. The TDIMn keyword could be used to convey the number
of bits per sample. For example, a 1-dimensional 256-sample spectrum
with 2 bits per sample could be stored with

TFORMn = '512X'
TDIMn = '(2,256)'

This could be extended to higher dimensional data. If the record
contained the spectrum that was read out a 4 successive times, then it
could be stored with

TFORMn = '2048X'
TDIMn = '(2,256,4)'

I might be clearer however to write the 4 spectra as separate rows in
the table.

Bill
--
__________________________________________________ __________________
Dr. William Pence
NASA/GSFC Code 662 HEASARC +1-301-286-4599 (voice)
Greenbelt MD 20771 +1-301-286-1684 (fax)