What is it?
SRVIEW is meant to be an easy-to-use tool to quickly visualize the contents of a PUMA SERVICE file. Since it does not require any format conversion or the setting of parameters, as opposed to software such as GrADS, Vis5D, or Ferret, it is the most effective way to look at a SERVICE file. It also includes some of the interesting features found in those other software packages like animation support and map projections in a single-key interface. However, it does not try to be a replacement for those more sophisticated tools and should not be used for final plots, since it does not include e. g. vector output or the Gaussian latitudes.
Another interesting feature of SRVIEW is that it can read data from a pipe. So it is possible to have PUMA, PUMAburn, and SRVIEW running at the same time with SRVIEW interactively visualizing the data as it is being output by the running model.
Running SRVIEW
Running SRVIEW is as simple as srview [--link / --link2] filename. The commandline options are only useful if the data is being read from a pipe (see Advanced Features below). For static files srview filename is all there is to it.
As soon as it is started, SRVIEW will print the list of key functions to the terminal and open a graphics window. Note that there is a problem with the SDL library which SRVIEW uses for its graphical output: If SRVIEW is started via telnet and your local machine runs XFree 4 (SuSE Linux 7.0 and higher or equivalent), the program will hang trying to open the graphics window. Please install the program on your local machine in that event
As soon as SRVIEW starts, it tries to animate the first variable on the first level at a slow speed. You can pause the animation with the SPACE key, choose a different variable via the FUNCTION KEYS, a different level via the 1-0 KEYS, and a different animation speed via the LEFT and RIGHT ARROW KEYS. The detailed functions of keys will be described in detail further down.
To quit SRVIEW, hit ESCAPE or close the graphics window.
Downloading SRVIEW
Linux binary (requires libsdl and libsdl_ttf, which in turn needs libfreetype):
Source:
Simple DirectMedia Layer library RPMs (local copy):
SRVIEW keys
The FUNCTION KEYS are used to access the variables in the file in the order they first appear in the file. If the file contains more than twelve variables, you can use TAB to go to the next variable. After the last variable, TAB will cycle to the first one.
The digits 1, ..., 9, 0 are used to access the pressure / model levels in the file in the order they first appear in the file. If the files contains more than ten levels, you can use ARROW UP / ARROW DOWN to go to the level that is numerically smaller / larger than the present one. There is also a difference between the two ways to change level in terms of scale adjustment: If you jump to a level using 1, ..., 9, 0 the scale will be adjusted at any rate. If you use ARROW UP / ARROW DOWN the scale will only be adjusted if too many values fall outside the scale range. So the ARROW UP / ARROW DOWN function is supposed to be used if you want to compare field values at nearby levels.
As noted in the previous paragraph, the scale usually stays the same, unless too many (more than about 25%) of values fall outside the scale range. In that event, the scale is adjusted by looking at the current minimum and maximum of the field and expanding that interval so that the individual contour lines fall on sane values. So the color bar range is somewhat larger than the range of the current data field. It may also be necessary to adjust the scale at other times, which can be done by pressing A.
The scale is a linear colour gradient with a default of 16 colours. The number of colours can vary between 8, 16, 32, 64, 128. KEYPAD + increases and KEYPAD - decreases the number of colour levels used. Each variable has a default palette, which you can change with BACKSPACE.
For some variables there are shortcut keys (P, R, S, T, U, V, W, Z). Of course these will only be effective if the given variable is in the file. If not, the display will no longer update. Choose a different variable then.
Animation speed can be set to one of five frame rates with ARROW LEFT / ARROW RIGHT, additionally it can be forward or backward. There is also a pause mode (SPACE). If T wrap is active (END), SRVIEW will jump back to the beginning of the file if it hits the end. Otherwise, it will "bounce" at the end of the file (speed is reversed). The beginning of the file always causes the animation to change direction.
| Speed | secs / frame | fps |
| 1 | .800 | 1.25 |
| 2 | .600 | 1.67 |
| 3 | .400 | 2.50 |
| 4 | .200 | 5.00 |
| 5 | .040 | 25.00 |
Table 1. Speeds and framerates overview
Additionally, you can use KEYPAD 4 / KEYPAD 6 to decrement / increment the timestep. This works in pause mode as well. PAGE UP / PAGE DOWN will jump to the beginning / end of the file and enable a slow animation speed.
The standard map projection is Lat/Lon. KEYPAD 8 / KEYPAD 2 activates north / south polar orthographic (parallel) projection. KEYPAD 7 / KEYPAD 1 activates north / south polar stereographic projection. In all spherical projections, the very edge of the disk is the equator. The Greenwich meridian and the 90° W meridian are at 6 and 9 o'clock or 12 and 9 o'clock in the northern / southern projections, respectively. KEYPAD 5 switches to Lat/Lon, KEYPAD ENTER toggles meridional section. In this view, the north pole is to the left and the south pole to the right. The numerically smallest level is at the top of the section. The values are zonally averaged for each timestep.
Another useful feature is the level lock (RETURN): Normally, all non-surface variable's levels move in unison -- change the level for one variable and switch to another variable and it will be displayed on the same level. However, sometimes it is necessary to compare variables on different levels, e. g. u (300 hPa) and t (900 hPa). To do this, switch to u at 300 hPa, activate level lock, switch to t at 900 hPa, and activate level lock as well. Subsequently, switching between u and t will make the displayed level jump as well. Hit RETURN again to deactivate level lock for that variable.
There are some other display related keys such as G to save a screendump of the current graphics window to a file in Windows Bitmap format, KEYPAD 0 to toggle zoom mode (no title / colour bar), F to switch to full screen mode. You can also resize the window as you would any other by dragging the edge with your mouse pointer. The window content will adjust, and the aspect ratio will change. This makes sense if your data is not well represented at a default 2:1 aspect ratio. There is also a monochrome mode (grey tones, black, white) for printing (M).
Finally, there are a number of toggles -- I for bilinear interpolation, HOME for X wrap (assume data is cyclic in longitude direction), INSERT for map overlay (actually the PUMA-2 T21 land sea mask), and DELETE for display of current date in the graphics window.
Advanced features
As mentioned previously, SRVIEW can be used to display PUMA data as it is generated by PUMA. For that to work, two to three named pipes have to be set up for PUMA, PUMAburn, and SRVIEW to exchange data. You can download the required scripts below.
The difference between the simplex --link and duplex --link2 link mode to PUMAburn, is that for the former mode, you can use any version of PUMAburn, whereas for the second mode, the special supplied version of PUMAburn2 must be used which will read after output of every field the code and level of the next field from a named pipe.
Author & license
This program was written by Martin Doege and is subject to the Artistic License. SDL is provided here for convenience only and you should get the latest version from http://www.libsdl.org/. It is licensed under the LGPL.



