Click here to see the SAS code. 
Click here to see the SAS code. (old style code)
Click here to see the example.

Many online weather services let users see a static snapshot of
the weather map for free, but charge $$ for the premium service
of seeing an animated weather map.  Since this is something that
people are willing to pay to see, then certainly this is something
that I know you'll want to know how to do with sas/graph ...   8-)

-----

Here's how I got the elevation data ...

   http://www.ngdc.noaa.gov/mgg/gdas/gd_designagrid.html
   Your Grid Id: bobsas2
   Grid Database: ETOPO2 - 2-minute global relief
   x - Windows
   Lat/Lon (left defaults - lat(up/down) = 33N-38N , lon (across)=85W -> 73W
   Cell size - 2-minute  
   Cell params - (4-byte floating point, tenths of meters precision)
   Format: XYZ (lon,dat,depth), No Header, Space delimited, omit empty grid cells

   Clicked 'Design-A-Grid' button.
   Clicked 'Next-->' button
   Clicked 'Compress and Retrieve' button
   Clicked 'Retrieve' button
   Clicked 'save'
   Saved bobsas2.zip to my U:
   Then, after saving it, I unzipped it, which created a directory structure...
   There's a lot of 'junk', but the file I wanted was ...

      /u/realliso/bobsas2_data/bobsas2/bobsas2.xyz
      (I renamed that to rise.xyz in the current directory)

-----

For each of the elevation long/lat coordinates, I created an 
annotate dot (pie), with the elevation determining what the 
color/shade should be.

I also created annotated text labels & dots for some city names,
for points-of-reference.

I combined the annotate data sets with a US county map, 
and 'gproject'd them, clipping along the boundaries for
the area of interest.

I then separated the map from the annotate, and then used 
gmap to draw the map outline (using an 'empty' fill pattern),
and then annotating the elevation color behind the map,
and the city labels on top of the map.

-----

For the clouds, I had to make up some data.  Instead of using
"random" data, I took some of the elevation data from the 
mountain regions, and then mapped it to the white/yellow/red
colors (rather than the shades of brown used for the mountains).
I applied successively larger x & y offsets, to similate these
clouds moving across the state.  Also, to give the illusion
of these clouds dissipating, I kept raising the level of the 
minimum elevation I used for clouds.

If you had real radar data, you would not have to do all this 
little 'trickery' I did to simulate cloud data - you could just
use the real thing :)

There are several ways to produce graphics animations in sas.
In this example, rather than using "ods html", I am scripting out
my own html file, and using dev=gifanim to write the gif animation.
Note that you can view the rain.gif animation directly, without using
the html file - but if you use the rain.htm file then you get the 
title= charttip/flyover text.

Back to Samples Index