This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

NASACDF (.cdf)

MIME type: application/x-cdf
CDF data file format.
General-purpose, self-describing format for storing multidimensional datasets.
Used for storage, management, and exchange of scientific data and images.
CDF is an acronym for Common Data Format.
Developed since 1985 by the National Space Science Data Center at NASA.
Binary file format.
Related to, but incompatible with, netCDF.
  • Import supports the NASA CDF 3.1 and earlier versions.
  • Mathematica by default exports NASA CDF 2.7 files, and can also generate 64-bit enhanced NASA CDF 3.1 files.
  • Import imports a CDF file, returning the names of the datasets stored in the file.
  • Import returns a list of strings representing the names of all datasets contained in the file.
  • Export creates a CDF file, storing the arrays or Graphics objects as separate datasets.
  • Import imports the specified element from a CDF file.
  • Import imports multiple elements.
  • Export creates a NASA CDF file by treating expr as specifying element elem.
  • Export treats each as specifying the corresponding .
  • Export exports expr with the specified option elements taken to have the specified values.
  • Export uses rules to specify the elements to be exported.
  • See the reference pages for full general information on Import and Export.
"Elements"list of elements and options available in this file
"Rules"full list of rules for each element and option
"Options"list of rules for options, properties, and settings
  • Data representation elements:
"Data"all datasets imported as a list of arrays
"Datasets"names of all datasets
  • Import by default uses the element for the CDF format.
  • Specifying and selecting datasets:
"Datasets",n dataset
"Datasets",datasetnamed dataset
  • The following values can be given for :
"Date"dates, given as DateList specifications
"Integer8"8-bit integers
"Integer16"16-bit integers
"Integer32"32-bit integers
"UnsignedInteger8"unsigned 8-bit integers
"UnsignedInteger16"unsigned 16-bit integers
"UnsignedInteger32"unsigned 32-bit integers
"Real32"IEEE single-precision numbers
"Real64"IEEE double-precision numbers
"String"strings of ASCII characters
  • Meta-information elements:
"Annotations"meta-information for each dataset
"DataEncoding"specifies how each dataset is compressed
"DataFormat"type used to represent each dataset
"Dimensions"data dimensions of each dataset
"Metadata"general meta-information as a list of rules
  • can take the following values:
Noneno data compression is used
"AdaptiveHuffman"adaptive Huffman encoding
"GZIP"GZIP compression
"Huffman"Huffman encoding
"RLE"run-length encoding
"Append"Falsewhether to append to an existing file
"LargeFileSupport"Falsewhether to export a 64-bit NASA CDF file
  • With the default setting False, the exported file uses a 32-bit data representation conforming to Version 2.7 of the CDF format.
  • 64-bit enhanced CDF 3.1 files can be created with True.
Get the dataset names:
Show the import elements available in the example file:
Read all meta-information:
Import the and datasets:
Importing the dataset returns a date in the form given by DateList:
Read a data array from the example file and render it using MatrixPlot:
Rasterize the earlier graphics and export them as an array of color values to NASA CDF:
Export a list of integers to NASA CDF, explicitly specifying the dataset name:
This imports the generated NASA CDF file:
Get the dataset names:
In[1]:=
Click for copyable input
Out[1]=
 
Show the import elements available in the example file:
In[1]:=
Click for copyable input
Out[1]=
 
Read all meta-information:
In[1]:=
Click for copyable input
Out[1]=
 
Import the and datasets:
In[1]:=
Click for copyable input
Out[1]=
 
Importing the dataset returns a date in the form given by DateList:
In[1]:=
Click for copyable input
Out[1]=
 
Read a data array from the example file and render it using MatrixPlot:
In[1]:=
Click for copyable input
Out[1]=
Rasterize the earlier graphics and export them as an array of color values to NASA CDF:
In[2]:=
Click for copyable input
Out[2]=
 
Export a list of integers to NASA CDF, explicitly specifying the dataset name:
In[1]:=
Click for copyable input
Out[1]=
This imports the generated NASA CDF file:
In[2]:=
Click for copyable input
Out[2]=