A Matlab toolbox for working with common data model datasets
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/
Two words: it's simple
Download it and run the setup_nctoolbox. Thats it.
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)
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.
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;