Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.




Researchers

The Common Data Format (CDF) is a conceptual data abstraction for storing, manipulating, and accessing multidimensional datasets. The basic component of CDF is a software programming interface that is a device-independent view of the CDF data model. The application developer is insulated from the actual physical file format for reasons of conceptual simplicity, device independence, and future expandability. CDF files created on any given platform can be transported to any other platform onto which CDF is ported and used with any CDF tools or layered applications. A more detailed introduction to CDF can be found in the CDF User Guide.

What libraries will read CDFs?

The Space Physics Data Facility (SPDF) supports a large archive of space physics files for many missions, many files are CDFs. If the files of interest are in the archive and supported by the CDAWeb system, the files can be read, plotted, listed, and downloaded from the browser based system. For users writing their own reading/analysis software, the CDF software distribution supports reading of files in many languages from many hardware platforms, e.g. Python, C, Fortran, Perl, Java, IDL, MATLAB and C#. Each language CDF library provides the routines to read attributes and variables in a variety of ways, see this page for information on all of the CDF language guides.

The CDF Library is used to read CDFs. For Python, there are two ways to read CDFs: (1) The Pure Python (CDFlib) package does not depend on the CDF library. (2) The SpacePy package depends on the CDF library. The CDFlib Package contains the basic CDF functionality; it can load data into Xarray objects and does not require installation of the NASA CDF software. The SpacePy package contains more advanced CDF functionality, loads data into a SpacePy data model, is more efficient than CDFlib because of the included CDF C libraries, and has the optional use of locally installed NASA CDF software. More information can be found in the Quick Start Guide-CDF with Python.

For Python, IDL®, and MATLAB®: How do I load a CDF into a data structure? Python: CDFlib is a pure Python implementation of the CDF libraries. It is capable of reading and writing CDF files and does not require the installation of NASA’s CDF software. CDFlib requires Python >= 3.8 and attempts to replicate the syntax structure of the CDF functions used in IDL.

IDL®: provides a complete set of built-in routines (functions and procedures) for working with locally stored CDF files. See the CDF IDL® Quickstart Guide for a quick introduction and IDL® Help for detailed description of all CDF routines (CDF routines begin with prefix “CDF_”). There are two approaches to using built-in CDF routines, reading an entire CDF or reading/writing data from/to individual variables and metadata from/to individual attributes.

MATLAB®: the language of technical computing. It is matrix-based and allows for the most natural expression of computational mathematics. Its high-level functions make it easy to read CDF files. Its low-level functions provide direct access to routines in the CDF C API library. The low-level functions should be utilized if users require more control over the import operation, such as data subsetting for large datasets, or to export data to a CDF file. To use the MATLAB® CDF low-level functions effectively, the user must be familiar with the CDF C interface. CDF distributed Java, Perl, and C# can also load a CDF into a data structure. More information can be found in the MATLAB Quick Start Guide.

How do I quickly look at the structure of a CDF? What tools will display/analyze CDF data?

Command line tools and data systems will display and point to reading cdfs. The Coordinated Data Analysis System (CDAS) Web services allow software developers to use CDAS services in their own application. While CDAWeb provides access to this data through an HTML-based user interface, the Web services provide a (Web) application programmming interface (API) to CDAS. For software developers who simply want to use the existing web (HTML) interface to CDAS, return to the main CDAWeb page. For those developing an application that requires science data from any of the datasets held by CDAS, the CDAS Web services will provide an interface to the data for the application. They are implemented as Representational State Transfer (REST) style web services. More information can be found in the CDAWeb Quick Start Guide.

CDFDump is a program that dumps the metadata/data in a CDF. It displays or extracts the contents of a CDF file to a screen (default) or text file. This program extracts and displays one variable at a time while the CDFexport programs extracts and displays the contents of a CDF file in a table format, each column representing a variable. CDFdump extracts the value of the variable attributes, but CDFexport does not extract the value of the variable attributes. The Reading CDFs page contains tools, examples, and more information about CDF data.

CDFDump and SKTEditor provide ways to quickly view the structure of a CDF. The SKTEditor is a simple graphical user interface (GUI) application for creating and editing International Solar Terrestrial Physics (ISTP)/Interagency Consultative Group (IACG) guidelines compliant skeleton CDF files.

How do I translate between scientific data formats?

Most of the translators are available either in binary or source code. The CDF-to-ASCII tool (cdfexport or cdfdump) is included in the CDF distribution package, and this tool is available in the <cdf_install_dir>/bin directory. CDF <=> XML tools are Java-based. They are in the cdfml.jar file in the CDF distribution’s classes (lib on Windows) directory. Its help information can be viewed here. CDF <=> Json tools are also Java-based. They are in the cdfjson.jar file in the same CDF distribution’s classes (lib on Windows) directory. Its help information can be viewed here. Other translators are: CDF<=>netCDF, CDF<=>FITS, HDF4=>CDF, CDF=>PDS. The Data Format Translation Tools page shows all of the translator tools.