File Exchange

image thumbnail

netcdfobj - netcdf made easy.

version 1.2 (4.57 KB) by

Easy interface for reading netcdf files.

10 Downloads

Updated

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

Tare (view profile)

Excellent.. Works Great.. Thanks..

Aslak Grinsted

Aslak Grinsted (view profile)

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

fixed serious bug in cdfdate2num

1.1

added a netcdf date -> datenum parser

MATLAB Release
MATLAB 7.10 (R2010a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video