Multigraph Workshop Exercises
September 9, 2009

Most of these exercises may be done in one of two ways:

  1. Locally, on your computer. This option has the advantage that it does not require logging in to the Linux server or editing files in Linux, but it has the disadvantage that it requires manually changing the security settings on your computer's Flash player. This isn't difficult, and is described on the Resources page. You will also not be able to create or modify scripts working locally.

  2. Remotely, on the workshop server. This option has the advantage of not requiring any Flash player security setting changes, and gives you full access to create or edit scripts, but requires some minimal familiarity with Linux. If you want to try this option but aren't familiar with editing in Linux (using command-line editors like 'vi' or 'emacs'), you can use WinSCP for editing; ask for details about this if you are interested.

Exercise 1
Download Multigraph and install it on your computer as described on the Resources page. Or, if you want to work on the workshop server, login to the server via ssh (host workshop.multigraph.org, username workshop, password workshop), cd into the projects directory, and create a subdirectory for yourself.

On your local computer, or in your project subdirectory, create a minimal MUGL file for a Multigraph graph, and an associated HTML file for viewing it. View it in a web browser to make sure it works. Consult the online users guide at http://www.multigraph.org if you need some tips.

Exercise 2
Download the file tp5min.csv to your computer or to your projects subdirectory on the server (on the server you can simply copy the file from the location /var/www/workshop-examples/tp5min.csv). This file contains 5-minute temperature and precipitation data. Create a graph that shows this data. Style it nicely with a title and legend.

Exercise 3
Download the file srstwhourly.csv to your computer or to your projects subdirectory on the server (on the server you can simply copy the file from the location /var/www/workshop-examples/srstwhourly.csv). This file contains hourly solar radiation, surface temperature, and wind speed data. Create a new graph that displays these three variables along with the 5-minute temperature and precipitaiton data from Exercise 2. Use the "fill" renderer for the solar radiation variable, and the "line" renderer for the surface temperature and wind speed variables.

Exercise 4 (can be done only on the server)
Write a Perl script to implement a web service to return fake temperature data: use the hour of the day as the temperature, so the temperature at 1:00 is 1 degree, at 2:00 it's 2 degrees, etc. You can copy the file /var/www/workshop-examples/dataservice.cgi as an example --- just edit out all the database stuff. Create a graph that displays data from this service.

Exercise 5
Create a graph that displays plots of several different NDFD variables using the translating proxy service used in the NDFD example (the first NDFD example --- the one that uses a web service, not the one with the dynamic MUGL file). Choose whichever variables you find interesting, and choose plot styles to match them. Consult the list of NDFD elements to see which variables are available (use an element's "Input Name" as the "var" value in the service URL). See ndfd.xml (use this download link, or copy the file on the server from /var/www/workshop-examples/ndfd.xml) as a starting point.

Exercise 6 (extra credit!)
Write a translating proxy web service to fetch multiple NDFD variables in a single request. Pay close attention to the time frequencies --- not all variables are available at the same set of time steps. Write a graph to display data from your service.