nc_dump.m is an m-file that can be used to interrogate
the structure of a netCDF file or OPeNDAP dataset. It's about the first command
that I use when I need to look at a new dataset.
For this first example, we look at some digital elevation map data on the opendap server at IMCS at Rutgers. Let's take a look at the structure of the data by typing the following commands into your matlab window. Yes, OPeNDAP URLs are ridiculously long... Cut-and-paste is your friend.
>> url = 'http://tashtego.marine.rutgers.edu:8080/thredds/dodsC/other/bathymetry/w100w20s10n90.nc';
>> nc_dump ( url )
netcdf http://tashtego.marine.rutgers.edu:8080/thredds/dodsC/other/bathymetry/w100w20s10n90.nc {
dimensions:
lat = 12000 ;
lon = 9600 ;
variables:
double lat(lat), shape = [12000]
lat:long_name = "Latitude"
lat:standard_name = "latitude"
lat:units = "degrees_north"
lat:_FillValue = -999
lat:valid_range = -90 90
lat:maximum = 89.9958
lat:minimum = -9.99583
lat:increment = 0.00833333
double lon(lon), shape = [9600]
lon:long_name = "Longitude"
lon:standard_name = "longitude"
lon:modulo = 360
lon:units = "degrees_east"
lon:_FillValue = -999
lon:valid_range = -180 180
lon:minimum = -99.9958
lon:maximum = -20.0042
lon:increment = 0.00833333
short elevation(lat,lon), shape = [12000 9600]
elevation:_coordinateSystem = "lat lon "
elevation:long_name = "Elevation"
elevation:standard_name = "height"
elevation:units = "meters"
elevation:_FillValue = -32768 s
elevation:valid_range = -13802 6543 s
//global attributes:
:title = "Digital Elevation Model Derived from SRTM30_PLUS"
:institution = "IMCS, Rutgers University"
:institution_url = "http://marine.rutgers.edu/"
: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."
:source = "spaceborne observation, NGDC Coastal Relief Model"
:comment = "Convertion to NetCDF made with MATLAB "
:references = "ftp://e0mss21u.ecs.nasa.gov/srtm/SRTM30"
:Conventions = "CF-1.0"
:Contact = "John Wilkin (wilkin@marine.rutgers.edu), John Evans (jevans@marine.rutgers.edu)"
}
So you can see that the m-file nc_dump.m basically does the
same thing as ncdump of the netCDF source distribution.