CDF File Options

File Type

The SINGLE_FILE and MULTI_FILE keywords to CDF_CREATE allow CDFs to be written as either:

  1. all data in a single file, or
  2. a separate file for each variable, plus a master file for global information.

The default is MULTI_FILE. For more discussion on CDF file format options, see section 1.4.1 of the version 2.6 CDF User's Guide .

Data Encodings/Decodings

Keywords to CDF_CREATE allow files to be written in a variety of data encoding and decoding options. (For example, the /SUN_ENCODING keyword creates a file in the SUN native encoding scheme). The default encoding/decoding is network (XDR). All CDF encodings and decodings can be written or read on all platforms, but matching the encoding with the architecture used provides the best performance. If you work in a single-platform environment most of the time, select HOST_ENCODING for maximum performance. If you know that the CDF file will be transported to a computer using another architecture, specify the encoding for the target architecture or specify NETWORK_ENCODING (the default). Specifying the target architecture provides maximum performance on that architecture; specifying NETWORK_ENCODING provides maximum flexibility.

For more discussion on CDF encoding/decoding methods and combinations, see sections 2.2.7 ("Encoding") and 2.2.8 ("Decoding") of the version 2.6 CDF User's Guide .

Creating CDF Files

The following list details the basic IDL commands needed to create a new CDF file:

CDF_CREATE: Call this procedure to begin creating a new file. CDF_CREATE contains a number of keywords which affect the internal format of the new CDF file.

CDF_VARCREATE: Define the variables to be used in the file.

CDF_ATTPUT: Optionally, use attributes to describe the data.

CDF_VARPUT: Write the appropriate data to the CDF file.

CDF_CLOSE: Close the file.

Reading CDF Files

The following commands are the basic commands needed to read data from a CDF file:

CDF_OPEN: Open an existing CDF file.

CDF_INQUIRE: Call this function to find the general information about the contents of the CDF file.

CDF_CONTROL: Call this function to obtain further information about the CDF file

CDF_VARINQ: Retrieve the names, types, sizes, and other information about the variables in the CDF file.

CDF_VARGET: Retrieve the variable values.

CDF_ATTINQ: Optionally, retrieve the names, scope and other information about the CDFs attributes.

CDF_ATTGET: Optionally, retrieve the attributes.

CDF_CLOSE: Close the file.

If the structure of the CDF file is already known, the inquiry routines do not need to be called--only CDF_OPEN, CDF_ATTGET, CDF_VARGET, and CDF_CLOSE would be needed.