This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
Mathematica Import/Export Format

NetCDF (.nc)

MIME type: application/x-netcdf
NetCDF data file format.
Self-describing format for exchanging scientific data.
Used in atmospheric research, GIS, and related fields.
NetCDF is an acronym derived from network Common Data Form.
Binary file format.
Conceptually based on CDF, but incompatible with this format.
Developed by the Unidata center at the University Corporation for Atmospheric Research (UCAR).
  • Import supports version 3 of the netCDF format.
  • Import[""] imports a netCDF 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.
  • Import["", elem] imports the specified element from a netCDF file.
  • Import["", {elem, suba, subb, ...}] imports a subelement.
  • Import["", {{elem1, elem2, ...}}] imports multiple elements.
  • The import format can be specified with Import["file", "NetCDF"] or Import["file", {"NetCDF", elem, ...}].
  • See the reference pages for full general information on Import.
"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 "Datasets" element for the netCDF format.
  • Specifying and selecting datasets:
"Datasets", nn^(th) dataset
"Datasets", datasetnamed dataset
  • Meta-information elements:
"Annotations"meta-information for each dataset
"DataFormat"type used to represent each dataset
"Dimensions"data dimensions of each dataset
"Metadata"general meta-information as a list of rules
  • The following values can be given for "DataFormat":
"Integer8"8-bit integers
"Integer16"16-bit integers
"Integer32"32-bit integers
"Real32"IEEE single-precision numbers
"Real64"IEEE double-precision numbers
"String"strings of ASCII characters
Get the names of datasets stored in a netCDF file:
Click for copyable input
Import a dataset:
Click for copyable input
Render the imported data as graphics:
Click for copyable input
Read meta-information from a netCDF file:
Click for copyable input