![]() |
It is often the case that the data you wish to see cannot be easily displayed in the OPeNDAP Matlab GUI window. OPeNDAP allows much richer access to the data than the browser can accommodate. This means that you can often use the OPeNDAP Matlab GUI to help construct a URL, even though you may not use it to submit the data request.
Can't exec program: /usr/local/bin/giftext.pl
The following example shows how you might go about constructing and
displaying a time series from the OPeNDAP Matlab GUI datasets, even though there is
limited browser capacity for displaying this kind of data. The OPeNDAP Matlab GUI
actually is flexible enough to plot this example, but there are others
for which this technique is useful. It's also useful to become
familiar with loaddods in case you want to include access to
OPeNDAP datasets in your own scripts.
Reading: http://ferret.wrc.noaa.gov/cgi-bin/nph-nc/data/coads_air.nc
Constraint: AIR[1316:1316][57:1:57][140:1:140]
Server version: dods/2.15
Creating matrix AIR (2 by 2) with 4 elements.
Creating scalar TIME.
Creating vector LAT with 2 elements.
Creating vector LON with 2 elements.
..... data transfer complete
This request generated 1 separate URLs,
which are stored in the sets: R3_
Each individual argument is stored like so:
R3_Time R3_Longitude R3_Latitude R3_Air_Temp
The above URL indicates that your request asked for time index 1316 in the dataset, latitude index 57, and longitude index 140. (This corresponds to September, 1963, at about 24°N and 78°W.)
>> loaddods('http://ferret.wrc.noaa.gov/cgi-bin/nph-nc/data/
coads_air.nc?AIR[1316:1500][57:57][140:140]')
You will see a message like this:
Reading: http://ferret.wrc.noaa.gov/cgi-bin/nph-nc/data/coads_air.nc Constraint: AIR[1316:1500][57:57][140:140] Server version: dods/2.15 Creating vector AIR with 185 elements. Creating vector TIME with 185 elements. Creating scalar LAT. Creating scalar LON.
AIR, whose entries correspond to a vector of times,
TIME. The scalars LAT and LON give the location of
the data. You can display the data with Matlab functions. Type the
following at the Matlab prompt:
>> figure >> plot(TIME,AIR)
Caution: There are some pitfalls to using loaddods
directly. The OPeNDAP Matlab GUI does quite a bit of housekeeping for you,
including some unit conversions. When you use the browser, you get your
data back in consistent units, whatever dataset you are looking at.
When you use loaddods, you get the data are returned in the units
they are stored in. The COADS time data, used in the above example,
comes in units of days since 1700.
Similarly, different data providers use different values within
their datasets to indicate "bad" or "missing" data points.
Through the browser, these data flags are transformed into Matlab
NaNs. (See Matlab `help nan' if you are not familiar with the
NaN symbol.) Again, downloading the data directly with
loaddods skips this transformation.
If you like, you can save your data with the Matlab save command
and restore it with the load command. See the Matlab
documentation for more information about these commands.