Subject: Re: CDF question

From: Jason Mathews <[email-masked]>
Date: 27 Dec 1995 20:47:40 GMT

[email-masked] (William Thompson) wrote:
>
>I'm reading some FITS binary table files that were converted from CDF format.
>The original CDF files have descriptions such as
>
>!-------------------------------------------------------------
>!   Variable         Data             Number     Record       Dim      
>!   Name             Type             Elements   Variance     Variance 
>!   -------          ----             --------   --------     -------- 
>    "LAT_SPACE"   CDF_REAL8             1          T            F 
>
>!  Attribute   Data          Value
>!  Name        Type        
>!-----------   -----         ------
>   "FIELDNAM"  CDF_CHAR      { "Heliographic Lat of the Craft" }
>   "VALIDMIN"  CDF_REAL8     { -1.570796327 }
>   "VALIDMAX"  CDF_REAL8     { 1.570796327 }
>   "SCALEMIN"  CDF_REAL8     { -1.570796327 }
>   "SCALEMAX"  CDF_REAL8     { 1.570796327 }
>   "LABLAXIS"  CDF_CHAR      { "Helio Lat" }
>   "UNITS"     CDF_CHAR      { "rad" }
>   "FORMAT"    CDF_CHAR      { "F7.3" }
>   "DEPEND_0"  CDF_CHAR      { "Epoch" }
>   "FILLVAL"   CDF_REAL8     { -1.0E31 }
>   "VAR_TYPE"  CDF_CHAR      { "data" }
>   "DICT_KEY"  CDF_CHAR      { " " }.
>
>It appears that the data in the FITS binary table file has the same resolution
>as that given in the FORMAT statement, rather than the full resolution of the
>Real*8 data type.  In the above example, the numbers are quantized to 0.001
>radians, even though the double precision numbers are theoretically much more
>precise than this.
>
>I'm not very familiar with CDF, so I have some simple questions:
>
>1.  Are all CDF files written out to the resolution given by the FORMAT
>    statement?  Or is there a mode of writing CDF files that automatically
>    applies this quantization?

Not necessarily and no. In most cases the metadata attributes
FORMAT in particular are edited by people and/or the software
that generates the data and may or may not reflect the true
data values, but this has no effect on how the data is written to CDF or 
read. It is, however, used by CDF applications (such as CDFlist) to 
format the output of the values, so an incorrect format value will 
produce funny output listings.

>2.  If not, is it possible that the process of reading the CDF file
>    unintentionally quantized the values?  In other words, is there a mode of
>    reading CDF files that automatically applies this quantization?
>

As above, there is no effect. The real* value is read as whatever is
stored regardless of FORMAT attribute.

>3.  Failing the above two possibilities, is it standard practice for CDF files
>    written by some of the groups here at Goddard to write out data to a
>    quantization given by the FORMAT specification?
>
>Please excuse these possibly naive questions.
>
>Thank you,
>
>Bill Thompson

It is standard practice NOT to format the data to fit the FORMAT 
specification but to select a FORMAT specification that matches the
precision of the data.

Any detailed quesitons about CDF should be forwarded to
[email-masked]

Jason

------------------------------------------------------------------------
Jason Mathews, Code 633.2       |National Space Science Data Center
NASA/Goddard Space Flight Center|Email: [email-masked]
URL: http://coney.gsfc.nasa.gov/Mathews/