XREC (Rêver en couleurs)
User guide
Version 5.8
Yves Chartier – February 2007
Introduction
XREC is a visualization program used to display 2D meteorological fields stored in the RPN standard file format. This program has
been developed by the "Section Informatique" of RPN, to provide RPN scientists an efficient tool to browse through the voluminous
data sets produced by numerical models and analyses.
The origins of XREC date from summer 1990. In its first release the program offered only black and white contouring of the data. The
user interface was coded with the Athena widgets, and the program was known as "xquicklook". Color capability and basic animation
were added in the fall of 1990, and the name "xrec" was chosen. The user interface was converted to the "Motif" toolkit in spring
1991, and the "Contour", "Geography" and "Palette" panels were added in the summer of 1991. A common toolkit library was also
built in collaboration with the Graphics sections of CMC, which was starting work on "MAX" (Météorologie Appliquée sous
XWindows), the "designed-for-operations" cousin of "xrec". The Interactive vertical cross section capability was introduced in spring
1992 and the "Animation" panel, in fall 1992. The program then entered a dormancy period that went into summer 1994. A brief wake-
up occured in summer 1993, in Toulouse where the "Attributes" panel and the topography mask were introduced, the code was ported
to HP platforms. The "Vector Field" panel was introduced in summer 1994. At the same time NCSA color palettes were introduced in
the "Palette" panel, augmenting the number of available palettes from 8 to 54.
The program, now in version 5.4, offers the following features:
• Motif graphical user interface, floating control panels
• line and half-tone contouring of 2-D fields
• zoom/pan capability
• display of grid point values
• overlay of up to 32 different fields
• animation of time series or vertical levels
• display of vertical profiles or cross-sections, in static or scan mode
• simple arithmetic on pairs of superimposed fields
• up to 124 RPN standard files opened simultaneously
• a choice of 50 color palettes and 2 sliders to modify the color enhancement curve
• Display of horizontal winds using wind barbs, arrows, animated streamlines and LIC (Line Integral of Convolution)
• modification of grid point values for a given field
• integrated geographical navigation, with support of lat-lon and polar stereographic projections
• display of fields containing point values
• customization of graphical attributes of fields and geography (line thickness, line style, color, vector length and density)
• selection of a contour interval for a given field
• user definition of a personal dictionary of variables
XREC User Guide – Introduction
- 2005-03-21 -
Page 1 of 2
Hardware and software requirements
At the present time, "xrec" runs on the following platforms:
•
Silicon Graphics (IRIX 6.4)
•
Linux (on i386 architectures - Red Hat 5.2 or better, Mandrake 7.0 or better).
"xrec" is capable of displaying on most UNIX workstations equiped with 16- or 24 bit depth displays, or personal computers equiped
with an X emulator.
Environment variables
The program requires four environment variables:
$ARMNLIB
containing the path of data files used by the programs
$DISPLAY
to establish the X connection
$CMCLNG
containing the language preferred by the user (english or francais)
$TMPDIR
used to store scratch files
Normally, the user should be responsible for setting the correct values for DISPLAY and CMCLNG. The value of ARMNLIB should
be set by the system administrator. This document assumes that the reader has a basic knowledge of RPN standard files. If this is not
the case, the document "An introduction to RPN standard files", by the author, is available. A basic knowledge of UNIX and window
management under X is also assumed.
Calling arguments
xrec [-imflds file1 file2 file3 ... file124]
[-ar full/grid/none/square]
[-v]
[-ozsrt output-file]
-imflds
used to specify the names of the RPN standard files to be visualized. A maximum of 124 files can be opened
simultaneously. If this option is not used when invoking the program, a file selector will appear on screen, asking the user
to select one or more RPN standard files.
-ar
specifies the aspect/ratio of the display window. By default, the display window can take any proportion. The "square"
option will force the display window to adopt a square shape. The "grid" option will force the display window to have the
same aspect-ratio as the ni/nj ratio of the first field appearing in the record selector (e.g. if the first field appearing has a
dimension of 240x120, the display window will be twice as large as high). The "full" option will make the display window
fill the entire screen. Finally, the "none" option will allow the user to freely size the dimensions of the display window to
any aspect ratio. In that mode, the grid points are distorted to take the aspect ratio of the display window. By default the
grid points are restrained to a square shape.
-v
flag that sets on verbose mode. In that mode, diagnostics messages from the program will appear on screen. This option is
useful to detect any error messages that may be present when the program loads the user dictionary.
-ozsrt
specifies the name of a target RPN standard file. This option is useful only when the field editing panel is activated.
XREC User Guide – Introduction
- 2005-03-21 -
Page 2 of 2


A Quick Tour
In the standard RMNLIB distributions there are sample RPN standard files that are available for demonstration. There are normally
available under $ARMNLIB/data/SAMPLES/fstd_samples. It is assumed that the directory $ARMNLIB/bin is included in your
$PATH variable)
xrec -imflds $ARMNLIB/data/SAMPLES/fstd_samples/sample_fstd89 &
If everything is set properly, 3 windows should normally appear. The first window is the display window, with a black background and
on which the following message is written:
The window should then be enlarged following normal window manager methods. Then two other windows should appear, the
"Control Panel" window and the "Record Selector" window. The windows setup should look like this:
Most program commands are activated with the mouse. Unless mentioned explicitly, the left mouse button is the only one that has to
be used.
To get an idea of the functionality offered by the program, go in the record selector and click with the left mouse button on any record
that you find interesting. In this example, the record selected is the 36hr forecast of sea level pressure (PN). Press the OK button, at the
upper left of the selector.
XREC User Guide – A quick tour
- 2005-03-16 -
Page 1 of 7


After a few seconds, the field will first by displayed in colors. Then the geography will be drawn, followed by contours, labels and a
legend. The image displayed should look like the one just below, shown with the identification of its various components:
We will now change some display
attributes. Locate the "Display" menu
at the first row of the "Control Panel".
Click on the menu. A list of menu
items appears. These menu items are
toggles that can switch on/off a display
option. The items with a diamond to
their left are currently active.
XREC User Guide – A quick tour
- 2005-03-16 -
Page 2 of 7


On the image shown at right the
"Color" options has been turned off.
The image is redrawn in black and
white. Note that the background color
is gray, and can be configured from the
"Contour" panel.
In this image the "Central values",
"Geography" and "Labels" options have
been turned off. Now, only the contours
of the field are visible.
XREC User Guide – A quick tour
- 2005-03-16 -
Page 3 of 7


Here is another example, a 36 hour
forecast of relative humidity at 700 mb.
The field is displayed by default with
irregular contour intervals. The intervals
drawn are 50%, 70%, 80% and 90%.
We have re-activated the display of
most attributes.
We will now try the "Contour Interval"
menu. A list of intervals is displayed.
The current contour interval has a
diamond to its left. Here we have
selected the interval "10", which
translates for 10% for this field.
XREC User Guide – A quick tour
- 2005-03-16 -
Page 4 of 7


The same field with the 0% contour
interval selected. When this interval is
selected, no contour lines are drawn,
and the field is displayed in smooth
shading. The color table is linearly
spreaded over the minimum and
maximum values of the data.
Now here we have turned off the
"Legend" and "Color legend" items.
When these two items are turned off, the
display area of the data takes the whole
window. This feature can be useful
when one prefers to include a custom
annotation rather than the default one.
We will try the zoom and pan functions of the program. Locate the "Zoom" button, in the "Control" panel. Click that button, and go in
the display window. With the left mouse button, click on the upper left part of an area that you would like to enlarge. Keep the mouse
button pressed, and move to the right.
XREC User Guide – A quick tour
- 2005-03-16 -
Page 5 of 7


A selection rectangle will appear, and
will grow or shrink as you move the
mouse. When the desired area is
selected, release the mouse button, and
click again to confirm that the selected
area is correct. The selected area should
now fill the entire window, as shown on
the rightmost image.
XREC User Guide – A quick tour
- 2005-03-16 -
Page 6 of 7


To move within the enlarged area, click
the "Zoom" button, go in the display
window, press and hold the middle
button. A line will appear and will
follow the mouse. The end of the line
shows the next location of the anchor
point. In this example we move to
northern tip of Lake Superior to the
right. When done, clic with the left
mouse button. The panned image is
shown on the right.
To unzoom, click on the "Zoom" button, go in the display window and click with the right mouse button.
To quit the program, locate the "File" menu, at the upper left of the Control Panel. Select that menu. The last menu items are "Quit"
and "Quit and save configuration". When either item is selected, the program stops immediately and all windows disappear.
XREC User Guide – A quick tour
- 2005-03-16 -
Page 7 of 7





The Control Panel
The “Control Panel” is one of the two “permanent” panels of xrec, the other being the “Record Selector”. Its main usage is to set
on/off display switches that change the appearance and layout of the displayed fields.
The first row contains pull-down menus, each of which will be explained in the following pages.
The “File” menu
The “File” menu offers the following items :
• About xrec... gives info about the program version
• Open other standard files invokes the file selector to open other standard files
• Close standard files closes one or more currently opened standard files
• Produce picture... opens a dialog box to write the contents of the drawing or cross-
section window into a file in the PNG format
• Produce sequence... creates a temporal sequence of PNG files that can be reused to
create an AVI or MPEG movie
• Quit quits the program without keeping the current configuration
• Quit and save configuration quits the program and saves part of the current
configuration into a file located in $HOME/.startrec
XREC User Guide – Section 05 - Control Panel
- 2005-04-20 -
Page 1 of 16





The “Display” menu
The “Display” menu offers the following items :
• “Colors” turn on/off the display of colors
• “Contours” turn on/off the display of colors
• “Labels” turn on/off the display of colors
• “Central Values” turn on/off the display of colors
• “Geography” turn on/off the display of colors
• “Source grid” turn on/off the display of colors
• “Output grid” turn on/off the display of colors
• “Legend” turn on/off the display of colors
• “Color Legend” turn on/off the display of colors
• “Smoothing” turn on/off the display of colors
• “Local Extrema” turn on/off the display of colors
• “Topography” turn on/off the display of colors
• “Missing Values” turn on/off the display of colors
• “Redraw Window after selection” turn on/off the display of colors
The “Color” Toggle
“On” status
“Off” status
The “Contours” Toggle
“On” status
“Off” status
XREC User Guide – Section 05 - Control Panel
- 2005-04-20 -
Page 2 of 16






The “Labels” Toggle
“On” status
“Off” status
The “Central Values” Toggle
“On” status
“Off” status
The “Geography” Toggle
“On” status
“Off” status
XREC User Guide – Section 05 - Control Panel
- 2005-04-20 -
Page 3 of 16






The “Source Grid” Toggle
When this option is activated every grid point of the source grid is displayed as an hollow circle.
“On” status
“Off” status
The “Output Grid” Toggle
When this option is activated every grid point of the output grid (any grid selected from the grid menu which is not “Field #1”) is
displayed as an black square.
“On” status
“Off” status
The following figures show the display when both the “Source grid” and “Output grid” options are activated. The grid point values are
always shown on the output grid.
XREC User Guide – Section 05 - Control Panel
- 2005-04-20 -
Page 4 of 16




The “Legend” Toggle
“On” status
“Off” status, “Colors” deactivated
“Off” status, “Colors” activated.
“Off” status, “Colors” deactivated. Note that when the “Legend” and
“Color Legend” are de-activated the field display fills the whole
window.
XREC User Guide – Section 05 - Control Panel
- 2005-04-20 -
Page 5 of 16





The “Color Legend” Toggle
“On” status
“Off” status
“Off” status, “Colors” deactivated. Note that when the “Legend” and “Color Legend” are de-activated the field display fills the
whole window.
The “Smoothing” Toggle
“On” status. The field is interpolated at every pixel.
“Off” status. Each grid point is represented by a square.
XREC User Guide – Section 05 - Control Panel
- 2005-04-20 -
Page 6 of 16




The “Local Extrema” Toggle
This option is used to alter the color scale of the field. When off, the colors are calibrated to the global variations of the field (max –
min). When on, the colors are calibrated on the local variations of the field within the visible window. This option has for effect to
increase the color spread. When on, the contents of the color legend give an indication of the range of values within the visible
window.
“On” status
“Off” status
The “Topography” Toggle
This option masks the parts of the displayed field that are below the ground. To work, this option needs a surface pressure field (P0),
valid at the same date, to be present in the input files. This option works only in pressure coordinates.
“On” status
“Off” status
XREC User Guide – Section 05 - Control Panel
- 2005-04-20 -
Page 7 of 16


The “Missing Values” Toggle
When activated, this option masks the portions of the field that are considered missing. See Section 20, “Handling missing values” for
details.
“On” status
“Off” status
XREC User Guide – Section 05 - Control Panel
- 2005-04-20 -
Page 8 of 16






The Grid menu :
The “Grid” menu offers the following items :
“Field #1” : the source grid on which the displayed field is defined
... : a list of grids defined :
from a GRILLE statement in the files
$ARMNLIB/data/dict_rec.e
$HOME/.recrc
Each of these grids define an output grid on which the source grid is interpolated
Here are some samples
GRILLE('North Hem./Amer. - PS 40km',PS,401,401,200.5,200.5,40000.,21.,NORD)
GRILLE('Southern Hem. - PS 40km',PS,401,401,200.5,200.5,40000.,21.0,SUD)
GRILLE('Canada - PS 20km',PS, 351,261, 121.5, 281.5,20000.0,21.0, NORD)
GRILLE('Global Latlon 721x361- 0.5deg',LATLON,721,361,-90.0,180.0,0.5,0.5)
XREC User Guide – Section 05 - Control Panel
- 2005-04-20 -
Page 9 of 16






The Vectors menu :
The “Vectors” menu provides some control about how the program
handles vector fields (currently only the pair UU-VV is recognized as
vectors). By default, when either a UU or VV field is selected, the
program tries to load its companion field (VV or UU respectively) and
displays the pair as vectors. The “Process as vector, display as vector” is
set by default.
The “Vectors” menu can also be used to display the selected component
as a scalar field instead of vector. Moreover, when the output grid is not of the same nature as the source grid, vector interpolation
needs to be done on the source fields to get accurate results. So if you want to display the wind component as a scalar field but you are
displaying the field on a different grid, you will want to use the “Process as vector, display as scalar” option.
If the option “Process as scalar, display as scalar” is activated, then the selected wind component will be interpolated (if needed) and
displayed as a scalar, like the temperature or geopotential. Use this option with caution, since the interpolation results of the wind
component on an incompatible grid will be meteorologically wrong.
“Process as scalar, display as scalar” :
“Process as vector, display as vector” :
“Process as vector, display as scalar” :
“Process as scalar, display as scalar (E source grid, OK)” :
“Process as scalar, display as scalar” (PS output grid, WRONG) :
XREC User Guide – Section 05 - Control Panel
- 2005-04-20 -
Page 10 of 16







The “Calc” menu :
The “Calc.” menu offers the possibility of performing simple arithmetic
operations on super-imposed fields :
• “No calculation” does not perform any calculations on the
superimposed fields.
• “Field1 – Field2, Field3 – Field 4” subtracts the superimposed
fields, by pairs.
• “Field1 + Field2, Field3 + Field 4” adds the superimposed fields, by
pairs.
• “ABS(Field1 – Field2), ABS(Field3 – Field 4)” subtracts the
superimposed fields and computes the absolute values of the differences, by pairs.
• “ABS(Field1 +Field2), ABS(Field3 + Field 4)” adds the superimposed fields and computes the absolute values of the sums, by
pairs.
See section 19, “Comparing Fields” , for more details about this option.
The “Contours” menu :
The “Contours” menu allows the user to select the contour interval of the last selected field.
The list of the contour intervals is taken from the definition of the variable that the program finds in the
$ARMNLIB/data/dict_rec.e file or the $HOME/.recrc file. If no variable is found, then the program does a wild guess
about the typical magnitude of the variable and displays a default list of intervals.
Pressure field selected with the default contour interval (4 mb)
Pressure field selected with the 0.2 mb contour interval
XREC User Guide – Section 05 - Control Panel
- 2005-04-20 -
Page 11 of 16





Pressure field selected with the “0” contour interval. No contour lines are drawn and the field is displayed in
smooth shading. The “0” contour interval is normally present in every field.
The same pressure field on which the 24 hr accumulated precipitation (PR) is superimposed. Note
that the contour menu now displays the values applicable to the PR variable. If you want to
change the PN contour interval, you need to de-activate superposition, change the contour
interval, re-activate superposition and re-select the PR field.
XREC User Guide – Section 05 - Control Panel
- 2005-04-20 -
Page 12 of 16


The “Options” menu :
The “Options” menu offers the following items :
• “Legend / Interpolation...” invokes a panel in which the user
• can adjust the font size of the elements that make up the legend text
• can adjust the smooting factor
• can select the interpolation level
• See Section 7 for details
• “Contours...” invokes a panel in which the user can adjust various drawing elements for
each of the superimposed fields. See Section 8 for details.
• “Geography...” invokes a panel in which the user can set various display options for
geographical elements (latlon lines, lakes, rivers, etc.). See Section 9 for details.
• “Palettes...” invokes a panel in which the user can select a set of pre-loaded color palettes
and simple enhancement curves. See Section 10 for details.
• “Min-Max / Missing values...” invokes a panel in which the user can define manually the
min-max values of a named variable (eg. PN, GZ, TT, etc.). See Section 11 for details.
• “Vector fields...” invokes a panel in which the user can select various options of
displaying vector fields. See Section 12 for details.
• “Point Values...” invokes a panel in which the user can select various options of displaying point values (clouds of values defined
on latlon points. See Section 13 for details.
• “Field Editing...” invokes a panel in which the user can modify the contents of a field. See Section 14 for details.
• “Time Animation” invokes a panel in which the user can use time animation to analyse the temporal evolution of a 2D field. See
Section 15 for details.
• “Time Series” invokes a panel in which the user can analyse time series and Hovmoller diagrams for various points of the field.
See Section 16 for details.
• “Vertical Cross-sections...” invokes a panel in which the user can display vertical cross sections of the field. See Section 17 for
details.
“Vertical Animation across vertical...” invokes a panel in which the user can use vertical animation to analyze the vertical structure
of a 3D field. See Section 18 for details
XREC User Guide – Section 05 - Control Panel
- 2005-04-20 -
Page 13 of 16






The 2nd row of the Control Panel is composed of two buttons : “Zoom”, that allows to zoom in/out the data, and “Grid point values”,
that displays the values of the data at grid points.
The “Zoom” button :
The “Zoom” function is activated with the 3 buttons of the mouse. The left mouse buttons is used to zoom in, the middle mouse button
is used to pan, and the right mouse button is used to unzoom the field to its original size. There is no intermediate “unzooming”;
unzooming always reverts to the original domain.
To zoom in : click the “Zoom” button, click in the drawing windows with left mouse button, draw rectangle until the desired area is
covered, click again to confirm, otherwise select another area.
To pan : click the “Zoom” button, click in the drawing window with middle mouse button, drag anchor point to another part of the
window, click with left mouse button to confirm, otherwise select another anchor point.
To unzoom : click the “Zoom” button, click with right mouse button.
Before zoom
After zoom
Before pan
After pan
XREC User Guide – Section 05 - Control Panel
- 2005-04-20 -
Page 14 of 16







The “Grid Point Values” button :
This button is used to get numerical values at grid points. Once activated, a click in the drawing window with the left mouse button will
print the numerical value of the fields displayed (up to a maximum of 4) at the nearest grid point, along with the grid coordinates
(following RPN standard files and FORTRAN conventions). A click with the middle mouse button will redraw the window, causing
previously displayed values to be erased, and a click with the right button will de-activate that function. Here follows two examples,
with one field displayed (left) and 4 fields displayed (right).Note that the wind fields are displayed following the <dir,speed>
convention, where "dir" is the true wind direction (relative to the pole) and "speed" is the modulus of the wind.
The 3rd row controls the overlay of fields. “Activate superposition” allows the selected field to be overlayed among those already
displayed. “Redraw Window(s)” redraws the Windows that may have been damaged by the other windows of the graphics
environment. “Erase all Fields” cleans the drawing area and erases all the fields from the display stack.
The “Stop” button stops the program during long operations.
XREC User Guide – Section 05 - Control Panel
- 2005-04-20 -
Page 15 of 16




The last part of the “Control panel” contains the coordinates of the displayed area. It is <1,1> .. <ni,nj> when the field is zoomed out,
and shows intermediate values when the field is zoomed in.
Whole field displayed
Zoomed area displayed
XREC User Guide – Section 05 - Control Panel
- 2005-04-20 -
Page 16 of 16



The Record Selector
The "Record Selector" is one of the key elements of "xrec". It provides an efficient way to locate and access the thousands of records
that RPN standard files can contain. Here its basic configuration follows.
To display the PN field, just click on the PN record and click the OK button (in the upper left). Double-clicking on the PN record has
the same effect.
The panel has only one row of buttons (3) and labels (2).
“OK” has for effect to display the selected field.
“Clear selection” deselects all fields.
“Erase sel. Criteria” clears all the filters use to filter the records.
“XX/YY” is an information label giving the number of filtered fields / the total nimber of fields in the file(s). Here 10 fields match the
selection criteria on a total of 198.
“n : 000” is the number of selected fields.
An interesting feature of this panel is its ability to create an inventory of all the items included in the standard files. These items can
then be individually selected to create filters that provide a more direct access to the records of interest. To access this feature, just
click on any button representing a standard file attribute (Field, Type, Level, etc). A popup menu will appear:
XREC User Guide – Section 6 – Record Selector
- 2005-04-05 -
Page 1 of 3



In this example hear we click on the “HR” token from the “Field” column.After having pressed the “Return” button only the records
whose name is HR are shown.
The selector also allows more than one field to be displayed at any given time. Multiple fields can be selected by first selecting a
record with the left mouse button and by dragging the mouse up or down. Only adjacent fields can be selected with this option.
Non-adjacent fields may be selected as well. This type of selection can be made by selecting fields with the left mouse button while
pressing the "CTRL" key on your keyboard.
XREC User Guide – Section 6 – Record Selector
- 2005-04-05 -
Page 2 of 3


Using multiple filters
Multiple filters can be activated at any time. They work as a big OR inside each column and a big AND between the columns.
In the example above we ask the selector to display only the records “whose NAME is either GZ or TT” and “whose level is 200 mb
OR 400 mb”. Here is the result.
Important note :
The filters of the record selector act only as a visual aid to help you to focus on the records you really want to analyze. They do
not filter the contents of the files to the program operations like loading an animation sequence or a vertical cross section.
XREC User Guide – Section 6 – Record Selector
- 2005-04-05 -
Page 3 of 3


The Legend / Interpolation Panel
This panel is used to control the degree of smoothing, and permits some fine tuning of the font size used to display various elements of the
display window. Smaller font sizes, especially for legends, maximize the space available to display the data fields. On the other hand, larger
font sizes make printouts or transparency more legible.
The “Smoothing factor” option was used to optimize the smoothing algorithm used in older versions of xrec. It is now inoperative and will be
remove in the next version.
XREC User Guide – Section 07 - Legend / Interpolation Panel
- 2005-04-05 -
Page 1 of 5




The “Interpolation level” option controls the level of interpolation used when xrec displays a field on an output grid different from the source
grid. There are three options : “Nearest neighbor”, “Bilinear” and “Bicubic”. The default interpolation level is “bicubic”.
Nearest neighbour interpolation
Bilinear interpolation
Bicubic interpolation
XREC User Guide – Section 07 - Legend / Interpolation Panel
- 2005-04-05 -
Page 2 of 5



The “Font Size” panels offer five font sizes that the user can use for formatting contour labels, color table labels and the legend.
This shows the effect of changing the font size of the contour labels
Font size 12
Font size 24
XREC User Guide – Section 07 - Legend / Interpolation Panel
- 2005-04-05 -
Page 3 of 5



This shows the effect of changing the font size of the Color table labels
Font size 12
Font size 24
XREC User Guide – Section 07 - Legend / Interpolation Panel
- 2005-04-05 -
Page 4 of 5



This shows the effect of changing the font size of the legend.
Font size 12
Font size 24
XREC User Guide – Section 07 - Legend / Interpolation Panel
- 2005-04-05 -
Page 5 of 5



The Contour Panel
XREC can superimpose up to 32 fields on the same chart. The appearance of each field (i.e. color, line thickness, etc.) is defined by its
rank in the display stack. The appearance and behavior of each stack element is defined in the “Contour” panel.
The panel is split in 2 parts. The left part shows the selected display stack element. The right part shows all the display attributes that
can be set for each element. Basically, the user selects the display stack element to be modified (eg. “Field 1”) and sets the attributes.
There are 32 elements, one for each field, plus one for the background and one for the grid.
One of the major attributes is color. A choice of 9 colors is proposed.
The other element is line thickness. Thicknesses from 1 to 5 can be selected.
XREC User Guide – Section 8 - Contour Panel
- 2005-04-06 -
Page 1 of 4




The next element is the contour line styles. The user is given a choice of 4 line dashes, and 3 dash patterns visible only when the
values of the field are negative.
The next part offers an overriding control on the presence / absence of element. For “Contours”, “Labels” and “Central values”, for
a given field rank, the user can choose to obey to the toggles of the “Display” menu of the “Control Panel”, or to ignore them by either
always or never showing an element.
In the “Label size” option menu the user can fine tune the size of the labels. “Auto” uses the size defined in the “Legend /
interpolation” panel, the other units are fixed pixel sizes.
The last item is the “Central value size”, that the user can set for each field.
XREC User Guide – Section 8 - Contour Panel
- 2005-04-06 -
Page 2 of 4







Here are a few examples.
We start with a forecast run from the regional configuration of the GEM model. We display the geopotential at 850 mb for 4 forecast
times, 00hr, 06hr, 12hr and 18hr. We superimpose the 4 fields, and put the “Colors” option off from the display menu. This is what
xrec gives us by default.
We can make this chart more legible by setting the background to white and the line thicknesses of the 0 hr field to 2. Here are the
different settings for the contour panel.
XREC User Guide – Section 8 - Contour Panel
- 2005-04-06 -
Page 3 of 4












In the following chart, the background color is set to black, the contour lines of “Field 1” are set to white, those of “Field 2” to
yellow, those of “Field 3” to red and those of “Field 4” to green. Remark also the different dash patterns for “Field 3” and “Field 4”.
In the following chart, the “Contours” attribute is set to “Off” in the “Display” menu, but set at “Always” for fields 2, 3 and 4.
XREC User Guide – Section 8 - Contour Panel
- 2005-04-06 -
Page 4 of 4




The Geography Panel
XREC offers 2 geographical outlines by default : a default, low resolution one and an optional, high resolution one. The low resolution
is activated by default.
As in the “Contours” panel, this panel is split in two parts : the left part is composed of the geographical elements to be customized,
and the right part contains the list of customizable attributes (color, line thickness, line dash). On the left side, each element has a
toggle that can be set on/off, indicating the state of the element.
Low resolution geography
In low resolution mode, this panel is somewhat misleading. In fact only the “Continents” and “Lat-lon” elements can be configured.
This will be fixed in a future version. Also in the low resolution version the “Cities”, “Lakes”, “Rivers” and “Roads” elements are
dimmed, since there is no data associated with them.
The “Color” attribute gives the user a choice of nine colors to draw the geographical element.
The “Line Thickness” attribute can be set from 1 to 4 pixels.
The “Style” attribute offers 4 choices of dash lines.
XREC User Guide – Geography Panel
- 2005-04-06 -
Page 1 of 4






Here are some possible customizations
Default configuration – The geography and the latlon lines are drawn in black.
Coastlines in blue, continuous lines, and latlon lines in magenta, dashed lines.
Coastlines in blue, continuous lines, latlon toggle is off, hence no latlon lines.
XREC User Guide – Geography Panel
- 2005-04-06 -
Page 2 of 4



Continents toggle is off, leaving only latlon lines (not that useful).
High Resolution Geography
To use the high resolution geography, an environment variable, GDB_PATH, must be set and exported before calling xrec (after it is
too late !)
export GDB_PATH=/opt/DBGeo
It is the responsibility of the user to find out whether or not this high resolution geography is available on his system, and where it is
installed. If you are not sure, please contact your system administrator, or ask advice from MRB computer support
(service.rpn@ec.gc.ca).
The high resolution geography package has been written by Michel Grenier (CMC), and I thank him for providing us the results of his
hard work. The package optimizes the level of the detail in the geography depending upon the spatial resolution of the viewable area.
So even if all the geography items are checked and supposed to be active they will show up when the resolution of the physical area
meets some predefined thresholds.
This is the appearange of the “Geography” panel when all the GDB_PATH variable is defined
XREC User Guide – Geography Panel
- 2005-04-06 -
Page 3 of 4





Here are some examples of this high resolution geography.
Not much is shown in this low resolution chart, even if all the
As we zoom in, more information is displayed
elements are to be drawn are “ON”.
When we turn on the display the city names, there is much
... that disappears if we turn it off...
clutter...
... or becomes more tolerable as we zoom in.
XREC User Guide – Geography Panel
- 2005-04-06 -
Page 4 of 4





The Palette Panel
The “Palette” panel allows the user to choose the color palette used to display fields in colors. The program offers a choice of more
than 50 color palettes, as well seven enhancement curves and two sliders to modify the range of the colormaps.
To change the current color map, select a new one and press the “Redraw” button. Here are a few selected colormaps.
Col. Std1
N&B2
Volcano
Waves
XREC User Guide – Color Palette Panel
- 2005-04-11 -
Page 1 of 3





The “Enhancement” option menu changes the way the colormap is applied on the data. The default is linear.
The following pictures show the effect of changing the enhancement curve on accumulated precipitation data (PR).
Linear
Extrema
Square Root
Cubic Root
XREC User Guide – Color Palette Panel
- 2005-04-11 -
Page 2 of 3






The following pictures show the effect of modifying the variation range of the colormap.
Min set to 20 %, Max unchanged
Min set to 20 %, Max set to 80 %
Min set to 40 %, Max set to 60 %
XREC User Guide – Color Palette Panel
- 2005-04-11 -
Page 3 of 3






The Min-Max / Missing Values Panel
This panel allows the user to set manually the upper/lower limits of the displayed fields. This option is useful to produce multiple
charts that share the same limits; since their bounds are consistent, they can easily be compared between each other.
The panel is split in three parts : on the left there is the list of the variables known to xrec. On the upper right there is the min/max
settings mode : Auto (the default) or fixed. When set to Auto, the values in the fields Max and Min are also set to Auto. When set to
Fixed, the limits of the field are taken from the “Max” and “Min” values set by the user.
Example of use
To get the chart on the right, which has for limits 540-560 dam, we clicked on GZ, then entered the new min and max limits, and then
click the Fixed toggle.
XREC User Guide – Min Max Panel
- 04/07/2005 -
Page 1 of 1




The Vector Field Panel
The “Vector Field” panel gives the user many options to visualize vector fields. In XREC, a vector field is defined as a pair of UU and
VV components. In vertical cross sections, it is defined as a UU-VV-WW triplet.
At the present time, only UU, VV and WW are recognized as vector variables. Future version may hopefully allow the user to define
his own vector variables association.
This panel is split in three parts : in the upper left there are toggles to turn on/off
the display of glyphs (wind barbs, arrows), the wind modulus and line integral
of convolution (from now on called LIC). In the upper right there are various
options to fine tune the appearance of arrows and wind barbs. In the bottom part
there are various options to fine tune the display of streamlines.
Let's start with the upper left part.
By default xrec displays vector fields with arrows. Selecting Wind barbs changes the arrows for wind barbs.
Selecting None does not display anything. The None option is useful if the user wants to look only at the wind
modulus, LIC or streamlines.
Wind Display with arrows
Wind display with wind barbs
XREC User Guide – Vector Field Panel
- 2005-04-11 -
Page 1 of 9





The Wind modulus toggles allows the user to display the wind modulus. The wind modulus can be shaded and contoured as any other
scalar field.
Wind Modulus with wind barbs, contoured every 5 knots
Wind Modulus with arrows, contoured every 5 knots
Wind Modulus, contoured every 5 knots
Wind Modulus, displayed in smooth shading
XREC User Guide – Vector Field Panel
- 2005-04-11 -
Page 2 of 9







The Line Integral of Convolution is a texturing technique used to display the fine details aspects of the flow. Its use is mutually
exclusive with the display of the wind modulus. You can have either one, but not both.
LIC with N&B1 (gray scale) palette
LIC with B&B1 (blue to white scale) palette
A zoom on southern Quebec
The same area, without geography (shows all the details)
Same picture, with arrows added
Same picture, with arrows and streamlines added
XREC User Guide – Vector Field Panel
- 2005-04-11 -
Page 3 of 9




The next part of the panel offers some adjustment options on the attributes of wind arrows and barbs, such as density and length.
The first attribute is the “Increment”. It defines the space between grid points used to display the symbols. Xrec uses automatic
spacing to avoid clutter. The options allow the user to override the default. Here some examples.
Auto
Every 10 grid points
Every grid point
Every 0.25 grid point
XREC User Guide – Vector Field Panel
- 2005-04-11 -
Page 4 of 9





The second attribute is the “Length”. It defines the length, in pixels, of the maximum wind speed. The default is 32.
32
16
64
128
XREC User Guide – Vector Field Panel
- 2005-04-11 -
Page 5 of 9





The third element is “Arrow Thickness”. This attributes changes the thickness of the arrows along with their speed, the arrows getting
thicker as the wind speed increases. This option is useful to enhance the areas where the wind is strongest.
Arrow Thickness of 1
Arrow Thickness of 2
Arrow Thickness of 3
Arrow Thickness of 4
XREC User Guide – Vector Field Panel
- 2005-04-11 -
Page 6 of 9





The next attribute is “Arrow Growth”, which defines the rate of increase of the thicknesses of the arrows.
Quadratic Arrow Growth
Cubic Arrow Growth
Square Root Arrow Growth
Cubic Root Arrow Growth
XREC User Guide – Vector Field Panel
- 2005-04-11 -
Page 7 of 9




The next attribute is “Amplif. WW”, which is only used in vertical cross-sections. If defines the exageration factor of the vertical wind
speed so that the vertical motion is “visible” in vertical cross sections of the triplets UU-VV-WW. The user can find applications of
this option in the section 21 of this document, “Displaying vertical cross-sections of the wind”.
The last option of this sub-panel is “Arrows Legend”, that turns on/off the small legend at the lower left part of the window that
displays 4 typical wind values, the one at the top being the maximum value.Turning that option off can be useful when the user wants
to insert a picture in a publication but want to insert his own legends.
Arrow Legend ON
Arrow Legend OFF
XREC User Guide – Vector Field Panel
- 2005-04-11 -
Page 8 of 9





The “Streamlines” sub-panels gives the user various options to customize the display of streamlines. This part of xrec is an
implantation in the program of the “xstream” utility. This algorithm uses some simple image animation trick plus simple wind
advection to produce animated displays of the wind circulation. What the algorithm does is that it inject 2000 points (by default) at
random locations on the grid, and advects each of these points with the wind for 64 (by default) time steps of 1800 (by default)
seconds. Each streamline is displayed in groups of 4 (by default)segment increments, each of segment length 3 (by default).
This shows the instantanous wind circulation, and highlights nicely zones of convergence and divergence.
To use it, simply press on the “Start” button at the bottom of the window... To stop the animation, press the “Stop” button.
Wind display using default options
npts = 2000, time steps=64, seg. Inc. 4, Seg. Len = 3
npts = 10000, time steps=64, seg. Inc. 4, Seg. Len = 3
npts = 2000, time steps=64, seg. Inc. 4, Seg. Len = 3
npts = 2000, time steps=256, seg. Inc. 4, Seg. Len = 3
The wind advection algorithm requires for the moment that the output grid has to be Polar Stereographic. If you are trying to use this
option on a different type of grid you will get the following warning.
XREC User Guide – Vector Field Panel
- 2005-04-11 -
Page 9 of 9






The Point Values Panel
This panel allows the user to fine tune the visual settings of xrec to view clouds of lat-
lon values.
Older versions of xrec (prior to version 5.2) had more limited capabilities to visualize
clouds of lat-lon values. Newer version add more functionality. The fields can now be
displayed in colors, and the size of the symbols can be more finely adjusted.
Here is a sample output from xrec5.4 (Data courtesy of Dr. Louis Garand).
The first parameter that can be adjusted is the color, that can set on (as above) or off
(as below).
A zoom of the same data on Africa, without colors (left) and with colors (right)
XREC User Guide – Point Values Panel
- 2005-04-18 -
Page 1 of 9




The next parameter than can be adjusted is the symbol shape : a cross, a circle (the
default) or a square.
6-pixel Cross
6-pixel Circle
6-pixel Square
XREC User Guide – Point Values Panel
- 2005-04-18 -
Page 2 of 9





The next parameter is the display of the value of the field at the lat-lon point.
Here is a sample with values on :
The next parameter is the display of lat-lon position.
The picture below is the same as above with the lat-lon added. The plotting model is
(NNN) <lat, lon> where (NNN) is the rank of the value in the field (aids debugging!),
lat is the latitude (-90, 90 deg.) and lon is the longitude (0-360 deg.)
The size of the font used to display values can be adjusted from the “Label size” option in the “Legend / Interpolation” panel. The
following picture shows the effect of setting this parameter to 24 points.
XREC User Guide – Point Values Panel
- 2005-04-18 -
Page 3 of 9


The last two items go together : Symbol size and symbol units. “Symbol size” defines the size of the symbol in the units selected in
“Symbol Size units”. The range of values is fairly large; here are some suggested values
Units
Size
Pixels
1-10
Degrees
0.1-1
Km
0.1-50
Nautical Miles
0.1-25
XREC User Guide – Point Values Panel
- 2005-04-18 -
Page 4 of 9




Here are a few examples when units are in Pixels
1 Pixel
2 pixels
5 pixels
10 pixels
XREC User Guide – Point Values Panel
- 2005-04-18 -
Page 5 of 9




Here are a few examples when units are in Degrees
0.1 degrees
0.25 degrees
0.5 degree
1.0 degree
XREC User Guide – Point Values Panel
- 2005-04-18 -
Page 6 of 9




Here are a few examples when units are in kilometers (km)
1 km
20 km
33 km
50 km
XREC User Guide – Point Values Panel
- 2005-04-18 -
Page 7 of 9




Here are a few examples when units are in nautical miles
1 nautical Mile
10 nautical miles
20 nautical miles
50 nautical miles
XREC User Guide – Point Values Panel
- 2005-04-18 -
Page 8 of 9




Compared units
10 Pixel
10 degrees (not much useful!)
10 km
10 nautical miles
XREC User Guide – Point Values Panel
- 2005-04-18 -
Page 9 of 9




The Field Editing Panel
The “Field Editing” panel is a useful, albeit crude, tool to edit the values of a field. The
modified field is saved under the file name provided by the “-ozsrt” option when calling
xrec. If this option was not given, then file is saved in the HOME directory under the name
“modified_field”.
Let's demonstrate the use of this tool by a practical example. Suppose we want to study the
effect of the New-Foundland island on the atmospheric circulation. One way to study the
effect of the island is to make it disappear and see how the flow evolves in the absence of the
island.
When invoked, the panel has only 3 active buttons : “Modify grid point values”, “New
value” and “New stamp”. Before starting to edit the field, you have to decide what will be
the new values. So the first field that has to be changed in this editing process is the “New
value” one. In this example, we kept the default value of “0.0” since this is what we want.
The action of alterating values is done with the left mouse button, after having clicked the
“Modify grid point values” button. Its effect is pretty much the same as the Zoom function :
Dragging the left mouse button defines a rectangle. Simply clicking changes only the grid point under the mouse.
Each click counts as one action that can be undone if a mistake was made. Clicking the middle mouse button refreshed the window
contents. Right-clicking ends the edition session. The edition process can be continued by pressing the “Modify grid point values”
again.
Original Topography field
First action : draw a rectangle with the left mouse
Second action : click left mouse after drag
XREC User Guide – The Field Editing Panel
- 2005-04-18 -
Page 1 of 4





Clicking the middle-mouse button refreshes the window
Four more rectangles were added
We realize that the last rectangle we added was wrong. At this point we stop the editing process with right-clicking, and then we press
the “Undo button”.
On the panel we have the choice to further undo our modifications (“Undo edition #4”) or redo the last one (“Redo edition #5”).
XREC User Guide – The Field Editing Panel
- 2005-04-18 -
Page 2 of 4




Then, for not losing what we have done so far, we click on the “Save modifications” button. The following message appears. Before
writing the field into the file pay attention to the “New stamp” field, since this is this value that will be written in the modified file as
the new “ETIKET” stamp.
This is what we have done so far.
We now finish the job by removing the points of the island that remain. Notice all the single grid point clicks in the upper part of the
window.
XREC User Guide – The Field Editing Panel
- 2005-04-18 -
Page 3 of 4





We zoom back on the field to evaluate the changes made. On the right image the geography was removed.
In the images above 27 editing actions were done : 25 grid point clicks and 2 area clicks.
If we click the “Redraw” button from the “Field editing” panel the last points edited
appear.
We finally push the “Save modifications” button. The final result appear in a new session of xrec. Look at the new stamp of the field,
“EXPERIMENTAL” instead of “R1558V0N” that appears in the legend.
XREC User Guide – The Field Editing Panel
- 2005-04-18 -
Page 4 of 4



The Animation Panel
The “Animation” panel of xrec allows the user to visualize the temporal evolution of
meteorological fields.
To use this function, at least one field needs to be selected. Then clicking on any icon
of the bottom row (except stop) starts the animation.
The animation is first done by looking in the standard file(s) for the records that match
all the attributes of the field(s) displayed except time. All the relevant fields are then
loaded into memory, and the animation sequence starts.
Here is a brief explanation of the functions of the elements of this panel.
Fast animation toggle : This toggle, when activated, keeps the images in memory, so
that when all images are generated, the animation sequence is done by only flipping the
images. This gives the fastest animation, but is the most memory intensive, especially
during very long sequences (100 + frames) On the modern workstations we have
nowadays, this option is getting less and less useful or needed..
When this option is de-activated, more animation speed can be gained by removing
display elements from the display window, such as smoothing, colors, heavy lines, etc.
Zooming on a smaller area also increases animation speed.
Standard / back and forth toggle : This toggle is used to define the direction of
animation, from the first to last frame (standard) or back and forth (first to last, last to first going backwards, etc.). For a 7 frame
animation sequence, the order of animation when “Standard” is selected is 1-2-3-4-5-6-7-1-2-3-4-5-6-7-1-2-3-4-5-6-7-1-2-3... When
“Back and forth” is selected, the order of animation is 1-2-3-4-5-6-7-6-5-4-3-2-1-2-3-4-5-6-7-6-5-4-3-2-1-2.
Time interpolation : This toggle activates the use of temporal interpolation to smooth the animation. For instance, frames can be
interpolated to 10-minutes intervals even if the original frames are defined at every 3 hours. The interpolation between fields is done
through linear point-to-point interpolation. The time between frames is set by moving the slider. For mass fields, this technique gives
reasonable results when the time step between the original frames is not too big (6 hours or less). The derived fields like precipitation,
this techniques introduces “slinky” effects between frames. Use with caution.
Delay between frames (sec.) : This slider sets the delay between frames. The default (0.12 seconds) gives about 8 frames / second.
Animation speed can be less if the field takes more time to generate. The slider can go from 0.00 sec (no delay) to 1.00 second
between frames.
The icons from the last row have the following function, by order of appearance :
<< : Fast backwards animation; < : one frame backwards; STOP : stops the animation;
> one step forward; >> : Fast forward animation.
XREC User Guide – The Animation Panel
- 2005-04-11 -
Page 1 of 1





The Time Series Panel
This panel is used to display time-series of the fields shown in the main Display window.
The first thing to do when the panel appears is to click on any of the three top buttons
: “New Profile of Xsection”, “Scan Profile” or “Scan Xsection”. In this example,
we click on “New Profile of Xsection”.
Then a new window appears :
Once enlarged, you get a black window with some instructions written :
“In the drawing window...
click left button --> profile
drag middle button + click --> cross section
click right button --> exit”
That is, clicking with the left mouse button gives a time series profile, clicking and
dragging the left mouse button draws a line, which will yield an hovmoller diagram.
The “Scan Profile” button lets you explore the time series across the grid area.
Simply press and hold the left mouse button and watch the times series being
dynamically updated.
The “Scan XSection” button lets you generate and explore the Hovmoller diagrams
across the grid area. Simply press and hold the left mouse button and watch the
diagrams being dynamically updated.
Left clicking in southern Quebec
XREC User Guide – The Time Series Panel
- 2005-04-13 -
Page 1 of 3





Left dragging and clicking in southern Quebec
Another region
The “Y axis scan” and “X axis scan” buttons let you generate Hovmoller diagrams
back and forth across the whole domain. The increment between each step can be
fine tuned by playing with the cursor just below. This allows you to concentrate on
the data, and to analyse the whole domain very rapidly. To stop the scan, simply
press the “Stop” button.
XREC User Guide – The Time Series Panel
- 2005-04-13 -
Page 2 of 3

The last part of the panel allows the user to fine tune the limits of the field so that the min-max limits are taken from the profile /
cross-section data (Auto (local)), the grid as as whole (Auto (global)), or limits fixed by the user (Fixed).
XREC User Guide – The Time Series Panel
- 2005-04-13 -
Page 3 of 3



The Vertical Cross Section Panel
The first thing to do when the panel appears is to click on any of the three top
buttons : “New Profile of Xsection”, “Scan Profile” or “Scan Xsection”. In this
example, we click on “New Profile of Xsection”.
Then a new window appears :
Once enlarged, you get a black window with some instructions written :
“In the drawing window...
click left button --> profile
drag middle button + click --> cross section
click right button --> exit”
That is, clicking with the left mouse button gives a vertical profile, clicking and
dragging the left mouse button draws a line, which will yield a vertical cross-
section.
The “Scan Profile” button lets you explore vertical profiles across the grid area.
Simply press and hold the left mouse button and watch the vertical profiles being
dynamically updated.
The “Scan XSection” button lets you generate and explore vertical cross-sections
across the grid area. Simply press and hold the left mouse button and watch the
cross-sections being dynamically updated.
XREC User Guide – The Vertical Cross Section Panel
- 02/16/2007 -
Page 1 of 6






A vertical profile obtained by clicking over Southern Alberta, at the location marked by a cross. By default, all the vertical levels
present in the standard file are loaded.
A vertical cross-section obtained by clicking and dragging over Southern Alberta.
The vertical scale can be changed to log instead of linear
XREC User Guide – The Vertical Cross Section Panel
- 02/16/2007 -
Page 2 of 6




The vertical scale can also be reversed
A new option has been implemented in xrec5.62 and above that maps the vertical cross-section in eta coordinates into pressure
coordinates, warping the surface with the underlying topography. For this mapping to work a corresponding P0 pressure field has to be
present with the same validity date and the same 'ETIKET' as the field in the cross section.
This option can be controlled in the left lowest third box. "Native" will display the cross-section in native coordinates, and "Pressure"
will display the field in pressure coordinates.
This option also allows the superimposition of fields in pressure and hybrid coordinates, and of fields that do not have necessarily the
same number or distribution of vertical pressure levels.
Cross-section in hybrid coordinates
Cross-section in pressure coordinates
XREC User Guide – The Vertical Cross Section Panel
- 02/16/2007 -
Page 3 of 6






The data range of the profiles or cross-sections can be changed three ways : by using the min-max values from the cross-section only
(Auto (local)), the min-max values from the whole 3-D domain (Auto (global)), or set to arbitrary values by the user (Fixed).
Data range set to Auto (local)
Data range set to Auto (global)
Data range set to Fixed
XREC User Guide – The Vertical Cross Section Panel
- 02/16/2007 -
Page 4 of 6


On the second row of buttons, the “Y axis scan” and “X axis scan” buttons let the user generate dynamic vertical cross-sections that
scan the whole domain back and forth, along the horizontal or vertical axes. The increment between each step can be fine tuned by
playing with the cursor just below. This allows you to concentrate on the data, and to analyze the whole domain very rapidly. To stop
the scan, simply press the “Stop” button. During the scan process, all the elements from the Display menu can be changed (like colors,
contours, labels, hi-lo values, etc.).
Additional remarks
Xrec can superimpose as many vertical profiles or cross-sections as there are fields on the Main Display window. The only limitations
are that the vertical levels must be the same for all the fields, and that loading fields defined on huge grids and/or having a large
number of vertical levels can have adverse effects on the system memory.
A vertical profile of the temperature from the same prog,
The same profiles, with the lower vertical limit set to 1000 mb.
at 6 hr intervals
XREC User Guide – The Vertical Cross Section Panel
- 02/16/2007 -
Page 5 of 6




Using the topography as a mask
If the vertical coordinate of the field is in pressure, and the P0 field is available, then selecting the “Topography” option in the
Display menu activates a mask in the vertical cross section window that shows the topography enveloppe.
Topography option off
Topography option on
In the main drawing window, regions shaded in dark blue show the area where the data is “invalid”, in the sense that it is below the
ground.
XREC User Guide – The Vertical Cross Section Panel
- 02/16/2007 -
Page 6 of 6



The Vertical Animation Panel
The “Vertical Animation” panel of xrec allows the user to quickly scan the vertical
structure of a 3D as a collection of 3D slices.
To use this function, at least one field needs to be selected. Then clicking on any icon of
the bottom row (except stop) starts the animation.
The animation is first done by looking in the standard file(s) for the records that match
all the attributes of the field(s) displayed except pressure level (IP1). All the relevant
fields are then loaded into memory, and the animation sequence starts.
Here is a brief explanation of the functions of the elements of this panel.
Fast animation toggle : This toggle, when activated, keeps the images in memory, so
that when all images are generated, the animation sequence is done by only flipping the
images. This gives the fastest animation, but is the most memory intensive, especially
during very long sequences (100 + frames) On the modern workstations we have
nowadays, this option is getting less and less useful or needed..
When this option is de-activated, more animation speed can be gained by removing
display elements from the display window, such as smoothing, colors, heavy lines, etc.
Zooming on a smaller area also increases animation speed.
Standard / back and forth toggle : This toggle is used to define the direction of
animation, from the first to last frame (standard) or back and forth (first to last, last to first going backwards, etc.). For a 7 frame
animation sequence, the order of animation when “Standard” is selected is 1-2-3-4-5-6-7-1-2-3-4-5-6-7-1-2-3-4-5-6-7-1-2-3... When
“Back and forth” is selected, the order of animation is 1-2-3-4-5-6-7-6-5-4-3-2-1-2-3-4-5-6-7-6-5-4-3-2-1-2. For vertical levels, the
“Back and forth” option is worth using.
Vertical interpolation : This toggle activates the use of vertical interpolation to smooth the animation. For instance, frames can be
interpolated to 10-mb intervals even if the original frames are defined at every irregular levels. The interpolation between fields is
done through linear point-to-point interpolation. The spacing between levels is set by moving the slider. Use the results with caution.
Delay between frames (sec.) : This slider sets the delay between frames. The default (0.12 seconds) gives about 8 frames / second.
Animation speed can be less if the field takes more time to generate. The slider can go from 0.00 sec (no delay) to 1.00 second
between frames.
The icons from the last row have the following function, by order of appearance :
<< : Fast backwards animation; < : one frame backwards; STOP : stops the animation;
> one step forward; >> : Fast forward animation.
XREC User Guide – The Vertical Animation Panel
- 2005-04-15 -
Page 1 of 1




Comparing fields
Comparing fields
"XREC" allows the superposition of up to 32 fields. The fields can be displayed one over the other, or subtracted by pairs (fld2 - fld1,
fld4 - fld3, fld 6 - fld5, etc). The switch to alter this behavior is located in the "Computations" menu of the "Control panel".
The following images show examples of this feature. On the left.gifure, the "No operation" item is selected, on the right, the "Field 1 =
Field2 - Field1...". On the left image, we have in black a 1000 mb height field, in gray a 500 mb height field. On the right, the
difference between the two fields, the 1000-500 thickness.
A similar operation is displayed below. On the left image, we have in black the 00 hr prog of a 500 mb height field, in gray the 03
hour prog of the same field. On the right, the difference between the two fields, a 3-hour height tendency.
The following.gifures showa 1000 mb and 850 mb wind fields. The left.gifure shows the original fields, the right.gifure shows the
vector difference between the two fields.
XREC User Guide – Comparing fields
- 2005-03-21 -
Page 1 of 2




The computation mode also changes the way grid point values are displayed. The following.gifure shows how superimposed fields are
displayed when computation is off (left) and on (right). The difference of vector fields is shown component by component.
XREC User Guide – Comparing fields
- 2005-03-21 -
Page 2 of 2

Handling of missing data in RPN standard files
Yves Chartier – February 2005
It happens sometimes that a user wants to define some parts of gridded data as missing. The following
documents provides some suggestions about how to handle this task in RPN standard files.
It is a fairly common practive in FORTRAN programs to use a special numerical value to flag missing data. For
instance, one might use a numerical code (eg. 999.0) to define areas of the grid where a given field (say,
temperature) data is missing. Unless such a data record is encoded without compression (ie X32 or E32), this is
generally a bad idea, for two reasons :
• With the compression schema currently used in the standard files, the numerical value used to flag
the missing data has good chances to be different than the one originally encoded, especially if this
value is not the minimum value of the field.
• The precision of the whole dataset will be severely affected since it will artificially expand its
numerical range, meaning that fewer bits will be available to encode the valid portion of the data.
An implicit method that has been suggested to encode missing values - and that recent versions of XREC were
trained to recognize - is to define a special value according to the following formula
SPVAL = max + 0.1 * (max – min)
For instance, if a temperature field has a maximum value of 100.0, a minimum value of 0.0, then SPVAL =
110.0.
However a better scheme is desired, if only for the case where some data fields may exist where the difference
between the maximum and 2nd maximum values exceed 10 % of the range of the field.
The now recommanded procedure to encode missing values is as follows :
1. Fields with missing values have a special TYPVAR variable, in which the 2nd character is @ (eg.
TYPVAR=P becomes TYPVAR=P@)
2. These fields have a companion field, a bitmask indicating the absence or presence of data. The
bitmask has exactly all the attributes of the master field, with the following exceptions :
• TYPVAR = @@
• datyp = 2 (unsigned integer)
• nbits = 1
• In this field, absence of data (missing) = 0, and presence of data (non-missing) = 1
Here is an exemple from xvoir on a sample dataset.
Handling of missing data in RPN standard files
Page 1


This is how a field with missing values looks in XREC when the “Missing Values” option is not activated from
the “Display” menu.
This shows how to activate the “Missing Values” option from xrec5.3
Handling of missing data in RPN standard files
Page 2



This is the field with the “Missing Values” option activated.
This is the bitmask.
This is a zoomed portion of the field with contours.
Handling of missing data in RPN standard files
Page 3



When interpolating missing values onto a target grid, it needs only one cell with missing data among those from the source
field to invalidate the interpolation result. This restriction is the most severe with bicubic interpolation, where 16 grid points
from the source grid are needed.The following pictures show the effect of the mask when interpolating fields with missing
values onto another grid.
Nearest neighbor interpolation
Bilinear interpolation
Bicubic interpolation
Handling of missing data in RPN standard files
Page 4
How to encode the masks in FORTRAN
The following code is an excerpt from a program that writes a mask from a field where the missing values have
been encoded with the method
SPVAL = max + 0.1 * (max – min)
! Open the input (unit 1) and output (unit 2) files
iunin = 1
iunout = 2
ier = fnom(iunin, val(1),'RND+OLD+R/O',0)
ier = fnom(iunout, val(2),'RND',0)
ier = fstouv(iunin, 'RND')
ier = fstouv(iunout, 'RND')
! Initialize the FST parameters attributes to collect all the fields
datev = -1
ip1 = -1
ip2 = -1
ip3 = -1
etiket = ' '
typvar = ' '
nomvar = ' '
! Loop on all the fields found
key = fstinf(iunin, ni, nj, nk, datev, etiket, ip1,ip2,ip3,typvar,nomvar)
do while (key.ge.0)
ier = fstprm(key, dateo, deet, npas, ni, nj, nk, nbits, &
datyp, ip1, ip2, ip3, typvar, nomvar, etiket2, grtyp, &
ig1, ig2, ig3, ig4, swa, lng, dltf, ubc, &
extra1, extra2, extra3)
allocate(buf(ni,nj))
allocate(masque(ni,nj))
ier = fstluk(buf,key,ni,nj,nk)
! The “sminmax2” function returns the 1st and 2nd min and max values found in the field
call sminmax2(rmin, rmax, rmin1, rmax1, buf, ni, nj, 1, 1, ni, nj)
print *, rmin, rmin1, rmax1, rmax
threshold = rmax1 + 0.1 * (rmax1 - rmin)
! Look if the “missing value” criterion is found and fills the mask values accordingly
if (threshold < 1.001*rmax .and. threshold > 0.999 * rmax) then
print *, 'Trouve...', threshold, rmax, rmax-threshold,rmax*1.001, rmax*0.999
typvarvm(1:1) = typvar(1:1)
typvarvm(2:2) = '@'
typvarm = '@@'
do j=1,nj
do i=1,ni
if (buf(i,j) .eq. rmax) then
masque(i,j) = 0
else
masque(i,j) = 1
endif
enddo
enddo
ier = fstecr(buf,unused,nbits,iunout,dateo,deet,npas,ni,nj,nk,ip1,ip2,ip3,
typvarvm,nomvar,etiket2,grtyp,ig1,ig2,ig3,ig4,1,.false.)
ier = fstecr(masque,unused,1,iunout,dateo,deet,npas,ni,nj,nk,ip1,ip2,ip3,
typvarm,nomvar,etiket2,grtyp,ig1,ig2,ig3,ig4,2,.false.)
else
! If the treshold is not met then just rewrite the field as is
ier = fstecr(buf,unused,-nbits,iunout,dateo,deet,npas,ni,nj,nk,ip1,ip2,ip3,
typvar,nomvar,etiket2,grtyp,ig1,ig2,ig3,ig4,1,.false.)
endif
key = fstsui(iunin,ni,nj,nk)
deallocate(buf)
deallocate(masque)
end do
Handling of missing data in RPN standard files
Page 5




Vertical cross-sections of the wind using xrec5.4
Yves Chartier
April 2005
xrec has the capabilities to display vertical cross sections of the wind. The following document gives some details about the method used to
display the winds.
To get a vertical cross-section of the wind, you need to display UU or VV on a given level, and in the “Vector” control panel, have the “Vector”
option selected.
The image below shows a cross-section of the wind, using default parameters.What exactly are we seeing here ?
XREC User Guide – Vertical Xsections of the wind
- 2005-04-20 -
Page 1 of 4

To display a vertical cross-section of the wind, xrec needs to load 3 fields, UU-VV-WW. One of the problems we have here is units. UU and
VV are in knots, and WW is in pascals / seconds. So we need to convert WW to knots.
To do this conversion, we need the temperature field for each level (TT) and we need to assume that we have an hydrostatic atmosphere. Using
the approximation
ω ≈ - ρgw ≈ - pgw/RT
w ≈ - ω/ρg ≈ - ωRT/pg
we can quickly convert the vertical motion extracted from the RPN standard files from pa/s to knots.
For example, for ω = -7.0 pa/s, T = 250 K, p = 500 mb, we get
w ≈ - ωRT/pg ≈ -7.0 pas-1* 287 J deg-1kg-1* 250 deg / (50000 pa* 9.81 ms-2) ≈ 1.02 m/s ≈ 1.99 knots
At the same location where ω=-7.0 pas-1 the associated wind components are 22.0 and -9.0 knots for UU and VV. This gives a northwest wind of
23.7 knots.
When displaying vertical cross-sections of the wind, xrec shows only the component of the horizontal wind that is tangent to the angle of the
cross-section. This component is computed as
utang = UV * cos(XSectionAngle – WindDirection)
where utang is tangent wind component, UV the modulus of the horizontal wind, XsectionAngle is atan2(dy, dx) and
WindDirection is atan2(VV, UU).
In the example above, -7.0 pas-1 is a relatively high value for ω. Even then, displaying the 3D wind as a vector gives mostly horizontal
directions. To get a feeling of the vertical circulation, the vertical scale of ω needs to be exaggerated. The level of exaggeration can be set in
xrec using the “Amplif. WW” toggle in the Vector panel.
←
XREC User Guide – Vertical Xsections of the wind
- 2005-04-20 -
Page 2 of 4






WW Amplification = 1
WW Amplification = 100
WW Amplification = 400
XREC User Guide – Vertical Xsections of the wind
- 2005-04-20 -
Page 3 of 4


The same cross-section but with the LIC displayed.
Amplification WW = 100
Amplification WW = 400
XREC User Guide – Vertical Xsections of the wind
- 2005-04-20 -
Page 4 of 4
Personalized User dictionary
In "xrec", the identification of variables, as well as the definition of contour intervals, is done by loading a dictionary in memory.
This dictionary is located in $ARMNLIB/data/dict_rec.e ($ARMNLIB/data/dict_rec.f in the french version). Users have the
possibility to modify the default settings of variables existing in the "official" RPN dictionary, or to add new variables not present
in the dictionary.
To create a personalized dictionary, follow these steps
1) create a file named ".recrc" in your $HOME directory.
2) insert DEFVAR statements in the file for every variable you want to add or modify.
Actually the dictionary supports three statements :
●
DEFVAR
●
GRILLE
●
VECTEUR
The syntax of the DEFVAR statement is as follows:
DEFVAR(variableName, identification, units, paletteName,
scalingFactor, defaultIntervalIndex,
interval1, interval2, interval3,
interval4, interval5, ..., interval24)
Some definitions :
variableName
the 4-letter code used for "NOMVAR" in the RPN standard files (ex. ’GZ’, ’HR’, etc.)
Identification
a 64-character string used in the legend; this represents the "meaningful name" of the variable
(ex. ‘Geopotential height’ for ‘GZ’, ‘Relative humidity’ for ‘HR’, etc.)
Units
a 32-character string used to identify the physical units of the variable (ex. ‘decametres’ for ‘GZ’, ‘deg C’
for ‘TT’, etc.)
paletteName
a 32-character string used to associate a color palette to a variable. This option is currently not
implemented and ignored. Use ‘none’ as default.
scalingFactor
a floating point number representing the typical order of magnitude of the variable.
Here are some examples:
Variable
Units
Magnitude
DD
s**-1
1.0E-06
GZ
dm
1.00
HR
%
0.01
TT
deg.C
1.00
The "defaultIntervalIndex" is an integer, ranging from 1 to 24, and represents the interval number that will be used in the list of
intervals (following after this value), used for the variables.
XREC User Guide – User dictionary
- 03/16/2005 -
Page 1 of 3
The remaining parameters, whose number may range from 1 to 24, allow the definition of the intervals that will appear in the
"Contour Interval" menu. These values are multiples of the scaling factor. For example, if one wants to contour the divergence field
(‘DD’) every 5.E-5 s -1 , and the scaling factor of ‘DD’ is 1.0E-6, the value to insert will be 50. (50.*1.0E-6 = 5.E-5).
These intervals can take two forms:
•
a floating point number. This gives the ordinary contour interval.
•
a list of floating point numbers, surrounded by square brackets ([---]). In that case, only the values appearing in that list
will be contoured, and the color scaling will depend on the length of the list rather than the numerical spread of the data.
This list can contain up to 32 values, which must be sorted by ascending order.
Here is an example for the TT variable.
defvar(’TT’, (variable name)
’Air Temperature’, (identification)
’deg C’, (physical units)
’none’, (color palette - ignored)
1.0, (scaling factor)
5, (default interval index (4.0))
0.1, 1., 2., 3., 4., 5., 10., 20., (list of intervals)
[-1., 0., 1.], [-10., -5., 5., 10.])
In this example:
•
the identification of TT is ’Air Temperature’,
•
units are ’deg C’,
•
the name of the color palette is ‘none’,
•
scaling factor is 1.0,
•
the default interval used to display the variable will be the 5th on the list (which is 9 items long), and is 4.0.
•
the list of intervals is composed of 7 ordinary intervals (0.1, 1., 2., 4., 5., 10., 20.) and 2 list of numbers (([-1., 0., 1.], [-10.,
-5., 5., 10.]).
Some syntax rules apply:
•
a line should not be more than 80 characters.
•
tabs should not be used to align text.
•
floating point numbers must end with a period at the end (ex. "1." instead of "1").
•
in exponential notation, a capital "e" ("E") must be used (as in 1.0E-5)
•
A character string must not contain apostrophes.
The GRILLE statement
The GRILLE statement allows the user to define its own output grids. The syntax is almost identical to the GRILLE command used in
PGSM. The exception is that the first argument of the statement is the name that the defined projection will have in the "GRID" menu
of xrec.
Some examples
grille('GEM LAM- PS 10km' , PS, 1201,776, 536., 746., 10000.0, 21.0, NORD)
grille('GEM LAM- PS 15km' , PS, 801,517, 357., 497., 15000.0, 21.0, NORD)
grille('GEM LAM- PS 30km' , PS, 401,259, 179., 249., 30000.0, 21.0, NORD)
grille('GEM LAM- PS 50km' , PS, 241,155, 107., 149., 50000.0, 21.0, NORD)
grille('Maritimes - PS 10km', PS, 351,241, 103., 595., 10000.0,-20.0, NORD)
grille('Quebec - PS 10km', PS, 401,310, 103., 559., 10000.0, 0.0, NORD)
grille('GEM LAM- PS 2km' , PS, 1201,931, 301., 1681., 4000.0, 0.0, NORD)
grille('Prairies - PS 10km', PS, 351,241, 175., 491., 10000.0, 20.0, NORD)
grille('Colombie - PS 10km', PS, 351,241, 207., 491., 10000.0, 30.0, NORD)
grille('USA - PS 10km', PS, 701,521, 243.0, 775., 10000., 21.0, NORD)
grille('NorthPole - PS 10km', PS, 501,501, 250.0, 250., 10000., 0.0, NORD)
grille('SouthPole - PS 10km', PS, 501,501, 250.0, 250., 10000., 0.0, SUD)
XREC User Guide – User dictionary
- 03/16/2005 -
Page 2 of 3
The VECTEUR statement
The "VECTEUR" statement allows the user to define pairs of variable that will be interpreted as vectors in xrec.
The default association for vector fields is "UU", "VV" and "WW", which define respectively the x-component, the y-component and
the z-component of the wind.
The syntax is
vecteur(uu_component, vv_component, ww_component)
Some examples
vecteur('UUOC', 'VVOC', 'WWOC')
vecteur('WATX', 'WATY', ' ')
In the latter example there is no vertical component of vector pair (WATX-WATY).
In the current implementation the ww_component is read but not processed. This will be addressed in future versions.
XREC User Guide – User dictionary
- 03/16/2005 -
Page 3 of 3
Customisation of X Resources
Most X applications allow customization of their appearance or functionality through the use of resources. This is achieved by storing
special commands in a file stored in $HOME/.Xdefaults. "xrec" offers this capability.
Here is a list of configurable parameters, that apply mostly to control panels.
•
background color
•
foreground (font) color
•
font used (font, fontList)
•
position and dimension of control panels (geometry)
The syntax is as follows:
applicationName*item: value
ex. xclock*background: black
Ensure there is a space between the colon ":" and the first character of "value". Here follows
the list of parameters for all the panels available
English version
French version
Nature
Attributes
geometry, fontlist,
xrecDisplay
xrecAffichage
Display window
background,
foreground
xrecControlPanel
xrecTableauDeBord
Main Control Panel
" "
xrecAnimation
xrecAnimation
Animation
" "
xrecAttributesPanel
xrecPanneauAttributs
Attributes Panel
" "
xrecContourPanel
xrecPanneauContours
Contour Control
" "
xrecEditingPanel
xrecPanneauEdition
Field Editor
" "
xrecGeoPanel
xrecPanneauGeo
Geography
" "
xrecPalettePanel
xrecPanneauPalette
Palette
" "
xrecVectorPanel
xrecPanneauVents
Winds
" "
xrecXSection
xrecCoupe
Profiles and Cross Sections
" "
xrecRecordSelector
xrecSelecteurEnr
RecordSelector
" "
The following option is available for the Record Selector.
recordList.visibleItemCount (english)
listeRecords.visibleItemCount (french)
To know more about resources, the reader is invited to consult volume #3 of "O’ Reilly" series on X Windows.
XREC User Guide – Customization of X Resources
- 2005-03-16 -
Page 1 of 2
Sample $HOME/.Xdefaults file
xrecDisplay*geometry: 1270x760+0+0
!
xrecControlPanel*geometry: -0+800
xrecControlPanel*background: lightblue
xrecControlPanel*fontList: 6x13
!
xrecRecordSelector*recordList.visibleItemCount: 6
xrecRecordSelector*background: lightblue
xrecRecordSelector*geometry: -320+800
xrecRecordSelector*fontList: 6x13
!
xrecContourPanel*background: lightblue
xrecContourPanel*fontList: 6x13
!
xrecGeoPanel*background: lightblue
xrecGeoPanel*fontList: 6x13
!
xrecPalettePanel*background: lightblue
xrecPalettePanel*geometry: -720+800
xrecPalettePanel*fontList: 6x13
!
xrecEditingPanel*background: lightblue
xrecEditingPanel*fontList: 6x13
XREC User Guide – Customization of X Resources
- 2005-03-16 -
Page 2 of 2
Document Outline
- 01-02-03-intro.pdf
- 04-quick-tour.pdf
- 05-control-panel.pdf
- 06-record-selector.pdf
- 07-legend-interpolation.pdf
- 08-contour.pdf
- 09-geography.pdf
- 10-palette.pdf
- 11-min-max.pdf
- 12-vector-field.pdf
- 13-point-values.pdf
- 14-field-edition.pdf
- 15-animation.pdf
- 16-time-series.pdf
- 17-vertical-cross-section.pdf
- 18-vertical-animation.pdf
- 19-comparing-fields.pdf
- 20-missing-values.pdf
- 21-wind-xsections.pdf
- 22-user-dict.pdf
- 23-x-resources.pdf