Chapter 5. NC_ATTGET

Retrieving attributes is even easier than variables. To get, say, the units of the elevation variable, that's as easy as

>> url = 'http://tashtego.marine.rutgers.edu:8080/thredds/dodsC/roms/nena/SRTM/w100w20s10n90.nc';
units = nc_attget ( url, 'elevation', 'units' )

units =

meters

    

And to retrieve a global attribute, use the mnemonic m-file nc_global.m in place of the variable name.

>> history = nc_attget ( url, nc_global, 'history' )

history =

10-May-2005 10:08:11:  NetCDF version created by jevans
Land topography and bathymetry data from the SRTM30_PLUS V1.0 
data set of November 11, 2004, created by Joseph J. Becker jjbecker@ucsd.edu 
and David T. Sandwell. Grid resolution is 30 minutes or roughly 1 km.  Data 
and documentation are available at 
ftp://edcsgs9.cr.usgs.gov/pub/data/srtm/SRTM30.  Land data are based on 1-km 
averages from the NASA Shuttle Radar Topography Mission. Ocean data are based 
on the Smith and Sandwell global 2-minute grid with higher resolution data from 
the NGDC Coastal Relief Model. This regional subset was extracted from the 
original data by Jay O'Reilly and John Wilkin.