MATLAB is a general-purpose high-level language and user
interface for matrix mathematics. Using the
OPeNDAP Structs Command Line Tool the user can
can visualize a remote HDF-EOS file in MATLAB through an OPeNDAP
command-line interface to the Network Data Access Protocol. In this
example, we assume that the user has both MATLAB software and the OPeNDAP
Structs Command Line Tool (also known as 'loaddap
') library
installed on your system. MATLAB is commercial software that requires
purchase of a license. The user can download versions of the OPeNDAP
Structs Command Line Tool for Windows, MacOS-X and Linux from
this link for free.
The Windows loaddap binary distribution contains all the additional
libraries you need. loaddap
for MacOS-X and Linux require
libdap
and possibly libxml2
packages.
The first step is to add the MATLAB OPeNDAP Structs Command Line Tool installation location to the path for dynamically-loaded shared libraries. In Linux:
Once in the running MATLAB session, add the path to the OPeNDAP Structs
Command Line Tool installation bin
directory, where it is
installed on your local system.
Load the HDF data file into MATLAB using the loaddap
command.
For this example, we are using a GESDISC AIRS Swath HDF file.
The user can examine the HDF file's attributes using the OPeNDAP web
services interface at the following URL:
https://eosdap.hdfgroup.org:8080/opendap/data/NASAFILES/hdf4/AIRS.2002.12.31.001.L2.CC_H.v5.0.14.0.G07282131425.hdf.das.
loaddap
reports that it creates the following structures in
matlab
:
"-A"
option to loaddap
.
The HDF file attribute names can be obtained via the OPeNDAP web
services interface at the previous
URL,
or they can be found by examining the structures in MATLAB using the
datatipinfo
command.
Now we are ready to plot the dataset defined above.
surfacem
function is faster than
contourfm
, but produces a less desirable graph in this
example.
Please see the complete code for this example here.
Edward T. Olsen, ed., AIRS/AMSU/HSB Version 5 Data Release User Guide, Goddard Space Flight Center, NASA