1.3 Example Sessions 1.3 Example Sessions 1.3.2 Creating a Time Series Index
NVODS Home

1.3.1 Drawing a Simple Picture

Can't exec program: /usr/local/bin/giftext.pl Start Matlab, and start up the browser. (See here).

  1. The Bookmarks and Variables menus should already be visible. If not, use the Data,Show Data Bookmarks button. The Bookmarks menu will look roughly like the figure. Look under "SST," then click on the entry marked "Reynolds Daily Long Term Mean SST."

    NOTE: When you click on this dataset, you'll see a little message come up labeled "Policy." This describe where you can download this data yourself. Data providers often require messages like this when programs like the OPeNDAP Matlab GUI incorporate their data.

     

    The Bookmarks Menu

    This dataset contains sea surface temperatures for the entire globe, in one degree squares, for each day since about 1800. You will see a rectangle in the main window outlining the entire globe. The time window contains a small line starting around 1800, and moving forward.

    Can't exec program: /usr/local/bin/giftext.pl

  2. Click the Zoom button, and click the left mouse button near the Reynolds time line a few times, until the time is measured in days or months. (If you find the default colors hard to see, click on the Preferences,Colors button to adjust them to your liking. Use the Preferences,Save Preferences button to save your colors for the next time.) The left mouse button zooms in, and the right button zooms out. You can also select a small range by clicking and dragging, and that range will be mapped over the timeline. 
  3. Click on Set Data Range, and select a time range by clicking and dragging in the time window (be patient). Remember that this dataset has a global grid recorded every day. Be careful not to select more than you'r willing to wait for.

    While you are selecting the range, you might notice the Datasets or Variables menus changing. These menus are dynamically loaded with all the datasets and variables that might overlap the data range you select. However, the changes will not affect your selection.

    NOTE: If you select a date or geographic range not covered by the dataset you've selected, the browser will unselect it. Messages for such events are printed in the main Matlab window.

    Can't exec program: /usr/local/bin/giftext.pl

  4. Now select a geographic range by clicking and dragging in the main window. By default, the whole world is selected, so if you skip this step, you will still get data. When selecting a time range, remember that this dataset is made up of weekly means, so be careful you don't ask for too much.
  5. Click the Get Details button. This will put a star at each point on the time line where data is available. You may see that you've selected 29 points, which could bring a lot of data back. You can refine your selection at this point to select the few data points of interest.
  6. Click the Get Data button. You will see a dialog box that says: "Hang on, transferring data," and some other stuff, like a dialog announcing what number this request is. Eventually, the browser will pop up the Data Display dialog (the figure), asking how you wish to display the Can't exec program: /usr/local/bin/giftext.pl data returned. Unless you've been careful in selecting your time range, it's likely that the temperature array returned will have three dimensions. The browser is designed to allow this, so it's not a problem. If you want to see a plot of something besides the first time array, you may have to click on the text box for the Z values, and add a Matlab indexing expression. That is, if the box reads SST, and you want to see the twelfth array in the series, you should change the Z value text box to something like SST(:,:,12) to get it.

     

    The "Display Data" menu

  7. Watch the data display. A message will announce when the data have been returned to the Matlab workspace, and what the new variable names are. You can examine and display these variables like any other Matlab variable.

A Short But Edifying Digression About the Internet

Can't exec program: /usr/local/bin/giftext.pl The OPeNDAP Matlab GUIgets its data over the internet, and the way it specifies the location of the data it wants is with a URL very similar to the URL you might use in a web browser, such as Netscape. In fact, the OPeNDAP Matlab GUI can be thought of as a very specialized web browser, that can only look at a very particular kind of web page. When you type a URL into a web browser, the browser "de-references" the URL to produce the page you can read. When you enter a URL into an OPeNDAP Matlab program called loaddods, that program de-references the URL to produce data in the Matlab workspace.  

It's a lot to type, but try typing the following at the Matlab prompt (all one line):

>> loaddods('http://ferret.wrc.noaa.gov/cgi-bin/nph-nc/data/
          COADS_climatology.nc?SST[7:7][0:1:89][0:1:179]') 

When loaddods dereferences this long URL, it prints something like this in the terminal window (not in the Matlab window, but in the terminal you were using when you started Matlab):

Reading: http://ferret.wrc.noaa.gov/cgi-bin/nph-nc/data/COADS_climatology.nc
  Constraint: SST[7:7][0:1:89][0:1:179]
Server version: dods/2.15
Creating matrix SST (90 by 180) with 16200 elements.
Creating scalar TIME.
Creating vector COADSY with 90 elements.
Creating vector COADSX with 180 elements.

and it puts the four arrays (SST, TIME, COADSX, and COADSY) into your Matlab workspace.

>> whos
  Name               Size         Bytes  Class

  COADSX           180x1           1440  double array
  COADSY            90x1            720  double array
  SST               90x180       129600  double array
  TIME               1x1              8  double array

The loaddods program is the heart of the OPeNDAP Matlab GUI. The rest of the OPeNDAP Matlab GUI is simply a "front-end" to the loaddods program that you use to construct URLs and make some housekeeping chores somewhat easier.

You can use this to your advantage, as is shown in the next example.

Incidentally, when the OPeNDAP Matlab GUI returns data, one of the returned variables is the exact URL that was used to issue the request for that data. This provides a unique identifier should you want to recreate a request or expand on it, perhaps in your own Matlab script.


Tom Sgouros, December 21, 2004