NetCDF-Java Library


The NetCDF-Java Library is a Java interface to NetCDF files, as well as to many other types of scientific data formats. 

The library is freely available and the source code is released under the (MIT-style) NetCDF C library license. Previous versions use the GNU Lesser General Public License (LGPL).

The preferred place to ask questions, discuss problems and features and get support is in the NetCDF-Java email list, which you can subscribe to from this page. Also you might want to search or browse previous netCDF-Java support questions.


Overview

The NetCDF-Java library implements a Common Data Model (CDM), a generalization of the NetCDF, OpenDAP and HDF5 data models. The library is a prototype for the NetCDF-4 project, which provides a C language API for the "data access layer" of the CDM, on top of the HDF5 file format. The NetCDF-Java library is a 100% Java framework for reading netCDF and other file formats into the CDM, as well as writing to the netCDF-3 file format. Writing to the netCDF-4 file format requires installing the netCDF C library. The NetCDF-Java library also implements NcML, which allows you to add metadata to CDM datasets, as well as to create virtual datasets through aggregation. The THREDDS Data Server (TDS) is built on top of the NetCDF-Java library.

CDM/TDS source is hosted on GitHub. To build the latest stable version from source or contribute code to the THREDDS project, see here. Most projects use netcdfAll.jar or toolsUI.jar (see below for links), or include the desired artifacts in their maven or gradle builds. See Build Dependencies for details.

Unidata CDM/THREDDS Software Engineering tools:

Current stable release version 4.6 (requires Java 7)

  • The complete netCDF library jar implements the full CDM model, with all dependent jars included.
  • The toolsUI.jar also includes UI classes, and allows you to run the netCDF ToolsUI application directly from it such as "java -Xmx1g -jar toolsUI.jar"
  • The ncIDV.jar is for the development branch of the IDV.
  • Public javadoc. This is the public interface. Future changes to the API will attempt to remain backwards compatible with this API.
  • All javadoc. This is the javadoc for all packages and all methods except private. CAREFUL, much of this will change.
  • Try out the 4.6 version of ToolsUI application: launch from webstart.
  • Unidata public Maven repository for maven artifacts
  • All source is on GitHub

Previous release version 4.5 (requires Java 7)

  • The complete netCDF library jar implements the full CDM model, with all dependent jars included.
  • The toolsUI.jar also includes UI classes, and allows you to run the netCDF ToolsUI application directly from it such as "java -Xmx1g -jar toolsUI.jar"
  • The ncIDV.jar is for the development branch of the IDV.
  • Public javadoc. This is the public interface. Future changes to the API will attempt to remain backwards compatible with this API.
  • All javadoc. This is the javadoc for all packages and all methods except private. CAREFUL, much of this will change.
  • Try out the 4.5 version of ToolsUI application: launch from webstart.
  • Unidata public Maven repository for maven artifacts
  • All source is on GitHub

Previous release version 4.3 (requires Java 6)

  • The complete netCDF library jar implements the full CDM model, with all dependent jars included.
  • The toolsUI.jar also includes UI classes, and allows you to run the netCDF ToolsUI application directly from it with "java -Xmx1g -jar toolsUI.jar"
  • The ncIDV.jar is for the released version of the IDV.
  • Public javadoc. This is the public interface. Future changes to the API will attempt to remain backwards compatible with this API.
  • All javadoc. This is the javadoc for all packages and all methods except private. CAREFUL, much of this will change.
  • Try out the 4.3 version of ToolsUI application: launch from webstart.
  • Unidata public Maven repository for maven artifacts
  • All source is on GitHub

File format types

The NetCDF-Java library can read various file types and remote access protocols.

Notes to GRIB users:

  • You must use 4.6+ branch to read GRIB files. Many bug fixes and improvements are on that branch. Other branches are not supported.
  • If your GRIB files are using non-WMO-standard tables, please closely examine the output from the CDM and report problems. Obtain the tables from the producer is possible and send them to us.
  • Indexing has changed since 4.3 (this will be detected automatically).
  • Evolving documentation for GRIB is at:

Caveats and not-so-stable APIs:

  • Writing to netCDF-3 format is supported, but extended features in the CDM, e.g. groups, structures, long data types are not yet supported.
  • Writing to netCDF-4 format is supported, if you have the netCDF C library loaded.
  • The catalog API will be redone, however the current API will remain supported if possible.

Related Documents:

CF Conventions

Coordinate Systems

Working notes and documentation on the coordinate system layer of the CDM

Feature Types

Working notes and documents on the scientific feature type layer of the CDM

Streaming NetCDF (Experimental)

Metadata:

Miscellaneous Resources

  • Netcdf-Java Blog
  • Talk at netCDF workshop 2012 (pptx)
  • On the suitability of BUFR and GRIB for archiving data (short paper Dec 2011 docx pdf)
  • Streaming NetCDF (netCDF workshop 2011) (pptx)
  • Talk at netCDF workshop 2010 (pptx)
  • Talk at netCDF workshop 2009 (ppt)
  • ToolsUI demo (You may need to download the free WebEx Player)

Software libraries used by the Netcdf-Java library:

Applications using the Netcdf-Java library (partial list):

  • ERDDAP (Environmental Research Division Data Access Program), from National Marine Fisheries Service's Southwest Fisheries Science Center
  • EDC (Environmental Data Connector) plug-in for ArcGIS
  • ncWMS (Web Map Service for NetCDF data) and demo site (University of Reading (UK) E-Science Center/Jon Blower)
  • Globally Leveraged Integrated Data Explorer for Research (aka GLIDER) (Univ. of Alabama at Huntsville)
  • Integrated Data Viewer (Unidata)
  • NOAA's Weather and Climate Toolkit (NOAA/NCDC)
  • Live Access Server from NOAA/OAR/PMEL (Pacific Marine Environmental Laboratory)
  • MATLAB toolkits
    • njTBX (Rich Signell/USGS, Sachin Bhate/Mississippi State University)
    • nctoolbox (Brian Schlining/MBARI)
  • MDArray is a multidimensional array library for JRuby similar to NumPy
  • My World GIS (Northwestern University)
  • ncBrowse (EPIC/NOAA) (this uses an earlier version of the library)
  • Panoply netCDF viewer (NASA/Goddard Institude for Space Studies/Robert B. Schmunk)
  • VERDI ( Community Modeling and Analysis System (CMAS) Center at the University of North Carolina at Chapel Hill / Argonne National Laboratory)
  • MICAPS, Meteorological Information Comprehensive Analysis and Process System (National Meteorological Center, CMA, Beijing, China)
  • Google Earth Engine

This document was last updated May 2015