[fitsbits] Packed binary values

William Pence pence at milkyway.gsfc.nasa.gov
Mon Apr 30 12:37:54 EDT 2007


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                       pence at milkyway.gsfc.nasa.gov
NASA/GSFC Code 662       HEASARC        +1-301-286-4599 (voice)
Greenbelt MD 20771                      +1-301-286-1684 (fax)






More information about the fitsbits mailing list