The CDF_CREATE function creates a new Common Data Format file with the given filename and dimensions. If successful, this function returns the CDF ID for the new file.
Note that when you create a CDF file, you must specify both encoding and decoding methods. Encoding specifies the method used to write data to the CDF file. Decoding specifies the method used to retrieve data from the CDF file and pass it to an application (IDL, for example). Encoding and decoding methods are specified by setting the XXX _ENCODING and XXX _DECODING keywords to CDF_CREATE. If no decoding method is specified, the decoding method is set to be the same as the encoding method.
All CDF encoding 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 .
Set this keyword to indicate DEC ALPHA/OSF1 data encoding/decoding.
Set this keyword to indicate DEC ALPHA/VMS data encoding/decoding using Digital's D_FLOAT representation.
Set this keyword to indicate DEC ALPHA/VMS data encoding/decoding using Digital's G_FLOAT representation.
Set this keyword to erase the existing file (if the file already exists) before creating the new version. Note that if the existing file has been corrupted, the CLOBBER operation may fail, causing IDL to display an error message. In this case you must manually delete the existing file from outside IDL.
Set this keyword to select that the file will use native data encoding/decoding.
Set this keyword to select SGI (MIPSEB) data encoding/decoding (Silicon Graphics Iris and Power series).
Set this keyword to select Decstation (MIPSEL) data encoding/decoding.
Set this keyword to cause all CDF control information and attribute entry data to be placed in one
.cdf
file, with a separate file created for each defined variable. If the variable in an rVariable, then the variable files will have extensions of
.v0
,
.v1
,
etc.
; zVariables will be stored in files with extensions of
.z0
,
.z1
,
etc.
This is the default format, and is usually more efficient than the SINGLE_FILE format. See section 2.2.7 ("Format") in the version 2.6
CDF User's Guide
for more information. If both SINGLE_FILE and MULTI_FILE are set the file will be created in the MULTI_FILE format.
id=CDF_CREATE('multi', /MULTI_FILE)
Set this keyword to select network-transportable data encoding/decoding (XDR). This is the default method.
Set this keyword to specify row major (C-like) array ordering for variable storage. This is the default.
Set this keyword to cause all CDF information (control information, attribute entry data, variable data, etc.) to be written to a single
.cdf
file. The default is to use the MULTI_FILE format where a separate file is created for each variable. See section 2.2.7 ("Format") of the version 2.6
CDF User's Guide
for more information.
Use the following command to create a 10-element by 20-element CDF using network encoding and Sun decoding:
id = CDF_CREATE('cdf_create.cdf', [10,20], /NETWORK_ENCODING, $
CDF_CLOSE, id ; close the file.
Now suppose that we decide to use HP_DECODING instead. We can use the CLOBBER keyword to delete the existing file when creating the new file:
id = CDF_CREATE('cdf_create.cdf', [10,20], /NETWORK_ENCODING, $
CDF_CLOSE, id ; close the file.
The new file is written over the existing file. Use the following command to delete the file: