NCTOOLBOX

A Matlab toolbox for working with common data model datasets

Summary:
nctoolbox is a Matlab toolbox that provides read-only access to common data model datasets. Under the hood, nctoolbox uses NetCDF-Java as the data access layer. This allows nctoolbox to access NetCDF, OPeNDAP, HDF5, GRIB, GRIB2, HDF4 and many (15+) other file formats and services using the same API. It works with Matlab 2008a and later.

Checkout the Published Demos Gallery

Take a look at the WIKI Documentation

Get Started

Older instructions and documentation at: http://code.google.com/p/nctoolbox/

We are in the progress of moving the project hosting https://github.com/nctoolbox/nctoolbox.

The new documentation will be here at http://nctoolbox.github.io/nctoolbox/

Why Use nctoolbox?

Two words: it's simple

It's simple to install!

Download it and run the setup_nctoolbox. Thats it.

It's simple to use!

All types of datasets (NetCDF, HDF5, OpenDAP) are read exactly the same way. Want to read data from an OpenDAP URL?

ds = ncgeodataset('http://geoport.whoi.edu/thredds/dodsC/coawst_2_2/fmrc/coawst_2_2_best.ncd')
time_run = ds.data('time_run');

Want to subset data, NetCDF style (i.e Start, End, Stride)?

lwrad = ds.data('lwrad', [10000 100 400], [10100 105 400]) % No Stride
lwrad = ds.data('lwrad', [10000 100 400], [10100 105 400], [1 1 1]) % With Stride

Want to subset data, Matlab style?

lwrad = ds{'lwrad'}(10000:10100, 100:105, 400)

Prequisites

Matlab R2008a+. You can verify the version of Matlab by typing:

version

Java 6+. You can verify the version of Java used by Matlab by typing:

version('-java'). 

The version returned should start with 'Java 1.6'. If it starts with 'Java 1.5' you can try updating the Matlab JVM: http://www.mathworks.com/support/solutions/en/data/1-1812J/ or use the older nctoolbox-20091112 version of this toolbox.

Setup

In Matlab, change to the nctoolbox directory. For example,

cd ~/Documents/MATLAB/nctoolbox

Run the setup_nctoolbox.m function

setup_nctoolbox

This sets up nctoolbox for the current Matlab session only. You will need to add the follwing lines to your startup.m file if you would like nctoolbox automatically when you start Matlab:

% Edit '/Path/to/nctoolbox' to correct nctoolbox directory
addpath('/Path/To/nctoolbox');
setup_nctoolbox;

Demos

Documentation