File Exchange

image thumbnail

netcdfobj - netcdf made easy.

version 1.2.0.0 (4.57 KB) by Aslak Grinsted
Easy interface for reading netcdf files.

5 Downloads

Updated 04 Feb 2015

View License

allows you to easily access atrributes and variables from a netcdf file.
And can also convert the netcdf dates to datenums.

Example1:
o=netcdfobj('e:\meanstationpressure.cdf');
o.vars
pressure=o.vars.pressure.value;

EXAMPLE2:
n=netcdfobj('ice5g_v1.2_21.0k_1deg.nc');
>> n.vars
lat
bounds_lat
long
bounds_long
orog
sftgit
sftgif
>> n.vars.lat.atts
bounds: bounds_lat
standard_name: latitude
units: degrees_north
axis: Y
>> lat=n.vars.lat.value;
>> imagesc(n.vars.long.value,lat,n.vars.orog.value')
>> axis xy

Comments and Ratings (2)

Tare

Excellent.. Works Great.. Thanks..

I invite all of you to contribute to the development of this code.

(I would like the code to support writing, and it would also be great if it automatically could insert NaNs and perhaps convert units according to the attributes for a variable).

Updates

1.2.0.0

fixed serious bug in cdfdate2num

1.1.0.0

added a netcdf date -> datenum parser

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux