Chapter 11: Contour  


The contour application contours and performs gradient analysis for two- and three-dimensional, regularly gridded data. Only two-dimensional views are possible however. Three-dimensional data sets can be viewed along X-Y, X-Z, and Y-Z planes. Profile lines along the contoured surface can also be plotted.

NOTE: contour can read both grid centered and node centered meshes, but node centered meshes are converted to grid centered meshes inside the application. This is necessary because of several internal algorithms. This has the effect of averaging the grid values slightly.

The contour application is composed of two sections (Figure 11.1); the main menu-bar and the drawing or plot area. The menu-bar is used to select all contour commands and the drawing area is the display area for the contour maps.

(11-1)Figure 11.1


Menu Items
Examples
Command Line Arguments
File Formats
Mathematics
Bibliography

The Main Menu:

The main menu controls nearly all the program operations; files can be opened and saved, graphics can be plotted, the appearance of the graphic can be modified, help can be requested, and the results can be sent to the printer. For contour there are ten items on the main menu: File, Blanking, Contour, Gradient, Posting, Graph, Palette, Plot, Profile, and Help (Figure 11.1). File controls file handling (opening, saving, naming files), directs printing, and allows the user to quit the application. Blanking allows the user to blank out, cover, or hide portions of the contour map results. Contour is used to specify contour interval and extents, and contour line characteristics. Gradient is used to specify the color values for slope gradients, and define how the gradient will be displayed on the map (color only, or vector). Posting is used to position important information of the contour map (field data points, well locations and ID's, etc.). Graph is used to define details about the graph border, fonts, label, mesh, and scale. Plot plots the contour map. Profile allows the user to generate section profile lines anywhere across the contour map. Help gives the user a selection of pop-up help topics. Each menu item is fully described below with all the available options.

[TOP] [SYNTAX]


File:

The File sub-menu options control file and print handling, and exiting the program. The options include Open, View, Save Preferences, Print Setup, Print, and Quit.

Open:

Selecting File:Open generates a pop-up dialog which allows the user to select an existing data file. This dialog operates as the File:Open dialog in Chapter 5 (plotgraph Figure 5.2). However, the standard file extension for contour is "*.srf" (SURFER - *.grd).

View:

File:View pops up a simple screen editor with the last saved version of the data file being used.

Save Preferences:

When using programs with many user options, it is not possible for the program to always pick reasonable default values for each parameter or input variable. For this reason preference files were created (See Appendix C). These allow the user to define a unique set of "defaults" applicable to the particular project. When File:Save Preferences is selected, contour determines how all the input variables are currently defined and writes them to the file "contour.prf."

WARNING: if "contour.prf" already exists, you will be warned that it is about to be over-written. If you do not want the old version destroyed you must move it to a new file (e.g. the UNIX command mv contour.prf contour.old.prf would be sufficient). When you press OK the old version will be over-written! This cannot be done currently from within the application. To rename the you will have to execute the UNIX mv command from a UNIX prompt in another window.

If "contour.prf" does not exist in the current directory, it is created. This is an ASCII file and can be edited by the user. See Appendix C for details.

Print Setup:

File:Print Setup works exactly as explained in Chapter 5.

Print:

File:Print generates a Postscript file of the calculated spatial measure, and depending on how the print options are define in Print Setup, directs this file to the specified print queue, or to the specified file.

Quit:

File:Quit terminates the program.

[TOP] [SYNTAX]


Blanking (& Line Drawing):

When gridding field data, most algorithms generate a rectangular grid, and most contouring routines require a rectangular grid (UNCERT modules included); often the area of concern, however, does not fill the entire area. As a result portions of the gridded map are based on no local data and are basically meaningless. A simple approach to deal with this situation is to blank out or hide areas of the contour map that are not of interest. This is what the blanking option accomplishes. By specifying one, or a series of polygons (See Setting up a Blanking File below for details), with the appropriate X-Y map coordinates, an area of the contour map and the contour lines will be hidden or blanked out (Figure 11.2). This same method can be used to locate surface features such as buildings or roads (Figure 11.3).

(11-2)Figure 11.2

(11-3)Figure 11.3

This is a simple blanking method. More sophisticated contouring packages are available which force the contour lines to meet the edge of a blanked out area at right angles. For ground water flow, this method is more accurate, but it not supported by contour.

Selecting Blanking:Modify pops up the blanking input dialog (Figure 11.4). The default is no blanking. To use blanking, set the blank zones toggle to true, and select a blank filename (the default extension is *.blk). Once the file has been selected, the file can be viewed using the view file button option. If blanking is no longer desired, set the blank zones toggle to false.

(11-4)Figure 11.4

NOTE: The polygons in the blanking file are not drawn on the contour map until, either the Apply or the Done dialog button is pressed.

It is also possible to just draw lines on the contoured surface, or draw lines and blank out different zones. By default the Fill Closed Blank Zones option is True. In this state, all closed loops in the blanking file will be blanked out. If the loop is not closed, only a line will be drawn. If the Fill Closed Blank Zones option is set to False, closed loops will also be drawn as lines (Figure 11.5).

(11-5)Figure 11.5

[TOP] [SYNTAX]


Contour:

The Contour menu option allows the user to specify parameters concerning the spacing and appearance of the contour lines, and if the data set is three-dimensional, which plane of the data grid will be viewed.

Active Plane:

When a three-dimensional grid file is loaded, this option becomes available. Contour:Active Planes allows the user to specify which plane of the grid will be displayed and contoured. The pop-up dialog shown in Figure 11.6 controls these options. The contour map can be cut along the X-Y, X-Z, or Y-Z Plane. Once the Plane orientation has been selected the Layer, Column, or active Row may be selected. Pressing the Previous or Next buttons will step contour through the selected planes. To determine which plane you want to select, refer to Figure 11.7.

(11-6)Figure 11.6

(11-7)Figure 11.7

Parameters:

When the contour map is initially drawn, contour will select minimum and maximum contour levels and a contour interval. The minimum contour level will be set to the minimum grid value in the grid file (NOTE: this is not necessarily the same as the minimum value in the field data set; the grid file is composed of interpolated values). The contour interval will be set so that there are nine contour lines equally spaced between the minimum and maximum grid value (See Appendix C, Preference Files, or the Running from the Command Line section below on how to override default values). These values are often not exactly what the user needs. This menu selection allows the user to specify details about the contour interval and range, and the appearance of the contour lines themselves.

Selecting Contour:Modify shows the pop-up dialog show in Figure 11.8. The minimum and maximum grid file values are shown; these are the default minimum and maximum contour levels (i.e. contour lines (representing equal Z values) will only be drawn if they fall between these two values). In some cases it is desirable not to contour the entire data range. For example, the propose of the map might be to examine subtle differences in relatively flat portions of the map; by contouring the entire map with the desired contour interval, steep zones can become overly cluttered, and if a larger contour interval is selected, the desired detail in the flat areas are lost. Note that the base contour interval is the minimum contour level. The character of the contour lines themselves are also user definable. There are there methods with which contour lines can be drawn through the grid; Linear, Akima Spline, and Cubic Spline. With the linear method, straight lines are drawn between grid block borders (Figure 11.9). Using either of the splining techniques will smooth the contour lines. Determining which method to use is a matter of personal preference. Some argue that a linear plot best represents the data, and other find the splined contour lines visually more pleasing. There are also two types of contour lines, main and minor. By default the main contour line is twice the thickness of the minor. On the computer screen, these values represent the thickness of the line in pixels (one is the smallest valid value for the screen; one will be assumed for smaller entries). For Postscript output, the values represent 1/144th's of an inch. Frequency is used to specify how often a main contour line is drawn. The base contour line is a main contour line, and contour lines are drawn from minimum to maximum grid values. Note, a frequency of five means that for every five contour lines, there will be one main and four minor lines. By pressing the appropriate toggle, either or both the main and minor contour lines can be dashed. By default, the main contour lines have a Spacing of approximately three inches (on different size monitors, this will vary). The default label Format is "general" (See Appendix A). Contour labels can be removed by setting the Label Contours toggle to false.

(11-8)Figure 11.8

(11-9)Figure 11.9

Sometimes when new files are loaded, the contour interval used for the previous map or the contour values set in the preference file, are inappropriate; pressing the Auto-Reset Contour Range button will recalculate "reasonable" values. These values will probably not be ideal, but they give a starting point.

By default, the contour map is drawn with a color (or gray) shaded background and white (black on Postscript output) contour lines. This makes an attractive map on the screen which quickly identifies differing Z values and trends. Drawing this background does slow the screen refresh down however, and when printing to a gray scale printer, the higher levels print dark gray to black and this makes reading the contour lines themselves difficult. This option can be turned on or off by toggling the Color Contour Grid Blocks toggle.

NOTE: When the color contour grid blocks option is turned off, the contour lines are drawn using the specified color palette. See the Palette section below on how to specify different color palettes.

[TOP] [SYNTAX]


Gradient:

Rather then viewing just the elevation contour lines, it is sometimes useful to examine the gradient or slope of the contour lines or field data. Examining the gradient can be useful for identifying areas where there might be slope stability problems, ground water flow direction, or problem areas in the grid itself (The grid is interpolated from field data, and different algorithms can generate significant problems that bear no relation to the field data (Wingle, 1992)). In this package the gradient can be indicated by color coded block (no directional information, (Figure 11.10a)), by a color coded arrow (Figure 11.10b), or by variable length arrows (Figure 11.10c).

(11-10)Figure 11.10a, (11-10)Figure 11.10b and (11-10)Figure 11.10c

The gradient at a particular point is not explicitly known, and therefore has to be extrapolated from the gridded data. To calculate a gradient vector three points are required (three points define a plane), but because the grid file uses rectangular cells four are used. This unfortunately over defines the plane and the gradient represents an averaged gradient over the cell. A complete description of how the gradient is calculated is presented in the Mathematics section below.

Gradient:Modify pops up the dialog shown in Figure 11.11. This dialog allows the user to activate the gradient option and specify values for the appropriate parameters. In the dialog, there is a color scale reference. The color scale range can also be extended or narrowed by modifying the Gradient Color Range Minimum and Maximum values. These values are, by default set to the minimum and maximum gradients found for the grid file. This is linear scale, and sometimes a few spots with very steep gradients dominant the color scale. By reducing the maximum gradient for the color scale (often significantly), low gradient zone are better defined, with minimal detail loss to the steep zones. If these values have been changed, or specified on the command line or in a preference file, when a new file is loaded the extents of the gradients are not recalculated. Pressing the Maximize Gradient Range button will recalculate and respecify the gradient range and color palette.

(11-11)Figure 11.11

Normally when plotting the contour maps, gradients are not plotted. To plot gradients, set the Draw Gradient Vectors toggle to true (setting this toggle to false prevents gradients from being plotted). When activated, the default settings plot the gradients using uniform length, color coded arrows (the arrows point down gradient). The arrows may also be scaled in length to indicate relative gradients; set the Scale Gradient Vectors to true. The arrow tip size can be adjusted using the Arrow Tip Length text field. The arrow tip size should be reduced on very fine grids, otherwise they tend to overlap. If arrows make the map appear to busy, or directional information is not required, the Gradient Indicator Type can be switched from Arrow Vector to Block Fill. Block Fill fills an entire cell with one color representing the average cell gradient (Figure 11.10a).

[TOP] [SYNTAX]


Posting:

In many cases it is useful to post the location and values of the field data (do the calculated grid values match the field data). It is also convenient to mark the location of wells and there ID's or other such information. When posting a file a "+" will mark the data point position, and a label may be associated with it. The label will be placed above and to the right of the symbol.

Posting:Modify pops up the dialog (Figure 11.12) which controls data posting. By default nothing is posted. To post the data locations, set the Post Data toggle to true. To post the data labels, both Post Data and Post Labels must be set to true. Once Post Data is set to true, a file can be selected (the default extension is *.lbl) by pressing the Post Filename button. Note that this does not load the file; it just selects the file name. If labels will be associated with the data location, specify the Label Column. Valid labels are any character string with no spaces; the first space marks the end of the label (See Setting up a Posting File below for more details). Once all the needed information is selected, press the dialog Apply or Done button. This will load the label file and post the data as requested.

(11-12)Figure 11.12

[TOP] [SYNTAX]


Graph:

Graph allows the user to specify various attributes about the appearance of the graph. Attributes about the graph Border, Error-bar Styles, Fonts, Labels, Legends, Mesh, and Line Styles.

Border:

Graph:Border is described in Chapter 5 in the Graph:Border section (Figure 5.9).

Fonts:

Graph:Fonts is largely described in Chapter 5 in the Graph:Fonts section (Figures 5.10 and 5.11), but the font selection for contour is slightly different (Figure 11.13). Different fonts may be selected for the Main Title, the Secondary Title, the Axes Labels, the Division Labels, the Contour Labels, the X-Section Labels (End labels on profile/cross-section line), the Annotations (Posted Labels), and the mouse Position labels.

(11-13)Figure 11.13

Labels:

Graph:Labels is described in Chapter 5 in the Graph:Labels section (Figure 5.12).

Mesh:

Graph:Mesh is described in Chapter 5 in the Graph:Mesh section (Figure 5.13).

Scale:

Graph:Scale controls the scale bar at the bottom of the contour map. By default it is on and the units are in feet. The width of the error-bar is divided into three width units; where each width unit is the X Major Tic Frequency wide (See the Border section below). Eventually the scale-bar width will be specified from this menu, but that is not currently supported.

The scale-bar can be turned on or off by pressing the Use Scale-Bar toggle shown if Figure 11.14. The units label can be changed in the Units text field. The Scale Width option is not currently supported.

(11-14)Figure 11.14

[TOP] [SYNTAX]


Palette:

Color in contour is used to aid the user in interpreting the contour and gradient information. Under different circumstances for different user's different color palettes are more appropriate, or better at displaying specific information. Several color palettes are available in contour.

Set Palette:

There are six palettes selectable by the user. Using Scale:Set Palette menu the user can select Gray, Hue, Hue (Looped), Spectrum, Spectrum (Looped), White, or User Defined. The active selection is highlighted in red. The "looped" palettes refer to palettes where the same color represents both the minimum and maximum values.

Color Legend:

To specify the range of the color palette, or view the numerical scale associated with the color palette, select Palette:Color Legend. The dialog shown in Figure 11.15 will be displayed. The color scale limits are set to the minimum and maximum values of the grid value by default. These limits can be changed by respecifying the Minimum and Maximum Color Scale Range. If the values have been reset, or specified from the command line or a preference file, and a new file is loaded, the color scale will probably not be correct. Pressing Maximize Scale Range will reset the color scale to the extents of the new data file. By default, values above and below the Minimum and Maximum Color Scale Range will also be identified with the minimum and maximum color code. By setting the Cutoff Color Outside Range toggle to true, values outside the range will not have any color coding. This can be useful for emphasizing only a specific contour range on the map (Figure 11.16). User Palettes may also be loaded, and any palette may be saved to a file (See Setting up Palette File section below). These files, by default have a *.pal extension. To make the User Palette active, the Scale:Set Palette:User Defined must be selected.

NOTE: It common to print color output to a black and white Postscript printer. This works because the color is dithered to a gray scale equivalent. Be careful with this though, because distinctly different colors (e.g. red and blue) can be dithered in such a way that they are difficult to differentiate.

TRICK & WARNING: When printing, if the background of the map is color contoured (colored blocks) and you are printing to a black and white printer, some regions will be dithered to black. The contour lines are also drawn black. As a result, in some areas on the map, the contour lines will be very difficult to read. To avoid this problem, just before printing, select the gray color palette (Palette:Set Palette:Gray), then lower the Minimum Color Scale Range value. For a map with a minimum value of 0.0, a maximum value of 100.0, setting the Minimum Color Scale Range value to -33.0 would yield good results. Lowering the Minimum Color Scale Range value by one-third the data range is a good rule of thumb.

(11-15)Figure 11.15

(11-16)Figure 11.16

[TOP] [SYNTAX]


Plot:

Plot:Now and Plot:Refresh are described in Chapter 5 in the Plot:Now and Plot:Refresh sections.

[TOP] [SYNTAX]


Profile:

It is often of interest to see a profile or cross-sectional view of an arbitrary line across a contour map. Selecting the Profile:View menu-bar option generates a pop-up dialog similar to that shown in Figure 11.17. Once the profile dialog is generated, the middle mouse button can be used to select profile lines on the contour map. The features of this dialog are discussed below.

(11-17)Figure 11.17

File:

File is similar to File for the main contour program. This menu-bar option controls file handling, printing, and terminating the profiling session.

Save:

File:Save saves the X-Y coordinates of the latest profile line to a MULTIPLE LINE formatted plotgraph file (See Chapter 5 for file format). The default file extension is *.dat. If a save file has already been opened, the data are simply saved. If a save file has not been selected yet, a pop-up dialog similar to that used in File:Open (Figure 5.2) is created. The main difference between the Open and the Save dialog is that to save a file, the file does not have to pre-exist. For a description of how the dialog works, see the Open section above and substitute Save for Open wherever appropriate.

Save as:

File:Save as is used to save the profile line X-Y coordinates to a user specified file. A pop-up dialog similar to that used in File:Open (Figure 5.2) is created.

Print Setup:

File:Print Setup works exactly as explained in Chapter 5.

NOTE: This Print Setup dialog is shared by both the main contour program and the line profile graphing tool. Changes made in one, will effect the other.

Print:

File:Print generates a Postscript file of the calculated spatial measure, and depending on how the print options are define in Print Setup, directs this file to the specified print queue, or to the specified file.

Quit:

File:Quit terminates the line profiling session.

Line:

The Line menu-bar option control how profile lines will be created and drawn on the contour map. A new line is drawn each time this is repeated.

Random Line:

Using Line:Random Line, a new profile line is created between where the mouse button (middle) is first pressed, and where it is released. The X-axis of the graph is set to the length of the profile line.

Fixed Start Line:

Using Line:Fixed Start Line ties the start point to where the middle mouse button is first pressed. As the mouse is moved, with the middle mouse button held down, the profile line is continuously redrawn. While in this mode, the X-axis is set to the maximum diagonal distance from the start point to the furthest map corner. When the mouse button is released, the final profile line is redrawn and the X-axis is scale to the length of the profile line.

Specify Line Coordinates:

If the desired line coordinates are known, using Line:Specify Line Coordinates can to used. This option generates the pop-up dialog shown in Figure 11.18. With this dialog the A (starting point) and A' (ending point) X and Y coordinate can be explicitly specified.

(11-18)Figure 11.18

Graph:

Graph allows the user to specify various attributes about the appearance of the graph. Attributes about the graph Border, Error-bar Styles, Fonts, Labels, Legends, Mesh, and Line Styles.

Border:

Graph:Border is described in Chapter 5 in the Graph:Border section (Figure 5.9). Note that the values are not necessarily the same as those in from the same dialog in the main portion of contour. This same dialog is used by both contour and contour:profile, but the entries are separate.

Labels:

Graph:

Graph:Labels is described in Chapter 5 in the Graph:Labels section (Figure 5.12). Note that the values are not necessarily the same as those in from the same dialog in the main portion of contour. This same dialog is used by both contour and contour:profile, but the entries are separate.

Section:

Labels:Section is used to enter the Starting Label (A) and the Ending Label (A') for the profile line. These values are entered using the pop-up dialog shown in Figure 11.19.

(11-19)Figure 11.19

Mesh:

Graph:Mesh is described in Chapter 5 in the Graph:Mesh section (Figure 5.13). Note that the values are not necessarily the same as those in from the same dialog in the main portion of contour. This same dialog is used by both contour and contour:profile, but the entries are separate.

General Comments:

In addition to the features of the profiler, several additional comments about the appearance of the graph, plotting the profile section line on the contour map, and removing the profile line from the contour map are needed.

Graph Appearance:

The Section Profile graph is scaled on the X-axis to the length of the profile line, and on the Y-axis between the minimum and maximum contour interval. The X-axis division labels are positioned at every 0.2 * profile line length units. The Y-axis division labels, by default, are placed at every major contour interval. The start of the profile line is placed to the left (A), and the end is to the right (A'). Font sizes can be controlled using the Fonts:Modify option on the main contour menu-bar.

Plotting Profile Line on Contour Map:

When a profile line is drawn on the contour map, initially only a thin dashed line is drawn. This line is used to show how the mouse has been moved. To plot a correct profile section line (Figure 11.20), replot the contour map (Double click with the left mouse button in the contour map window, or select the contour menu-bar item Plot:Now).

(11-20)Figure 11.20

Removing Profile Lines:

To remove the profile line from the contour map, select the File:Quit menu-bar option. Quitting the profiling session removes all profile lines.

[TOP] [SYNTAX]


Help:

Help works exactly as explained in Chapter 5 (plotgraph, Figure 5.15) Help section.

[TOP] [SYNTAX]


Zoom and Mouse Control:

Position of Mouse on Map:

When viewing the map on the monitor, when the mouse pointer is within the map boundary, its X-Y coordinate position within the map area will be reported in the upper-left corner of the drawing area. In addition to the X-Y position, if the map is a regular contour map the Z elevation will also be displayed. Warning: the Z value is a linear interpolated value based on the surrounding four grid values; as a result the value indicated at the mouse position does not always agree with the contoured value! If gradients are being shown in addition to contours, the mean gradient for the cell is displayed instead of the Z elevation value.

NOTE: When the mouse pointer is in the contour map region, the Z elevation will be displayed. When the mouse pointer is in the profile line region, the profile line value corresponding to the current X position will be displayed.

Zoom:

When a map is plotted on the screen, the extents of the X and Y axes can be changed in Border:Modify, or more simply, if less precisely, using the mouse. To zoom into an area on the map, 1) picture the rectangular region of interest, 2) move the mouse pointer to one corner, 3) press and hold down the right mouse button, 4) drag the mouse pointer to the opposite corner of interest (a rectangles will be as the mouse is moved), and 5) when the area of interest is enclosed in the temporary rectangle, release the mouse (you may have to nudge the mouse pointer slightly after releasing the mouse button). The new region will then be redrawn and scale to the screen (Figure 11.20). To zoom out, you can only return to the full map. To zoom out, press and release the right mouse bottom anywhere in the map window.

NOTE: This feature only works for the contour map. It is not possible to zoom into portions of the section profile.

[TOP]


Example of Using contour:

Using contour is quite straight forward. Once a file has been loaded a graph is generated; most of the program options control only the appearance of the graph.

There are three methods to load a file in contour. The first is to execute contour from the UNIX prompt and open the file from the menu, the second is to pass the file as a command line argument, and the third is to define the file name in the program preference file. To open a file from the main menu, execute contour from the UNIX prompt:

> contour

Once in the application, select the File:Open menu option. The pop-up dialog shown in Figure 5.2 will appear. Select the desired file. Once a file has been selected the contour map of the grid will be drawn. To open a file from the command line, enter at the UNIX prompt:

> contour [optional arguments] filename

For Example:

> contour mirror.srf

will open the contour map shown in Figure 11.9, and

> contour -pl 2 dig.grd

will open a grid file (dig.grdis an ASCII SURFER file format and this is determined within the program) and use the spectrum color palette. NOTE: in both Figures 11.3 and 11.9, other variables then those passed on the command line were defined. These variables could have been set using the menus, or using a preference file (Appendix C). Every time contour runs, it searches the current working directory for the file contour.prf. If it exists, contour reads the file and sets the variables as specified. This is the third way to open a file, because one of the arguments in the preference file is the name of the grid file. This could be done by typing the following (Figure 11.2):

> contour -prf conc3.prf conc3.srf

Note, this selects a non-default preference file (the default preference file is contour.prf). Once this file has been loaded, displaying a contour map, a gradient arrow vector map might be desired. To change the map type, select Gradient:Modify from the menu bar, press the Draw Gradient Vectors toggle and finally the dialogs Apply or Done button (Figure 10.10b). If instead of vector arrows, filled blocks are desired (Figure 10.10c), when in the Gradient:Modify dialog, also press the Block Fill menu option under Gradient Indicator Type. If at any time, just a regular contour map is desired (no gradient information), set the Draw Gradient Vector toggle back to false.

[TOP]


Running From the Command Line:

In many cases it is more convenient to run the application completely from the command line, or at least pass some parameter values in from the command line. The options listed below allow the user to accomplish almost anything that is possible from within the X-windows application from the command line (adding lines from different files is not currently supported). This feature can be useful when the user does not have a X-windows/Motif terminal available, or when many graphs need to be processed quickly, and the operation can be completed in batch mode without user interaction.

Syntax:

contour [-arrw #.#] [-bf #] [-bl #] [-blf " "] [-cb #] [-cfmt " "] [-cint #.#] [-cmax #.#] [-cmin #.#] [-colcut #] [-cplt #] [-csmax #.#] [-csmin #.#] [-csmo #.#] [-cspc #.#] [-ctyp #] [-esp #] [-fnt1 " "] [-fnt2 " "] [-fnt3 " "] [-fnt4 " "] [-fnt5 " "] [-fnt6 " "] [-fnt7 " "] [-fnt8 " "] [-fnts1 #.#] [-fnts2 #.#] [-fnts3 #.#] [-fnts4 #.#] [-fnts5 #.#] [-fnts6 #.#] [-fnts7 #.#] [-fnts8 #.#] [-gdmax #.#] [-gdmin #.#] [-gs #] [-gt #] [-gv #] [-help] [-lc #] [-lf #] [-lgf " "] [-lMd #] [-lmd #] [-lMt #.#] [-lmt #.#] [-lpbm #.#] [-lpc #] [-lpd #] [-lpf " "] [-lph #] [-lplm #.#] [-lpo #] [-lppsext " "] [-lpq " "] [-lpr] [-lprm #.#] [-lps #] [-lptm #.#] [-md #] [-mox #.#] [-moy #.#] [-ms #] [-mx #.#] [-my #.#] [-pA " "] [-pAA " "] [-pal " "] [-pbx #.#] [-pby #.#] [-pex #.#] [-pey #.#] [-pl #] [-prf " "] [-ptd #] [-ptf " "] [-ptl #] [-rfh #] [-scl #] [-sttl " "] [-ttl " "] [-units " "] [-vp #] [-vpc #] [-vpl #] [-vpr #] [-xc #] [-xfmt " "] [-xlabel " "] [-xmax #.#] [-xmin #.#] [-xMt #.#] [-xmt #] [-xsec #] [-xto #.#] [-xy #.#] [-yc #] [-yfmt " "] [-ylabel " "] [-ymax #.#] [-ymin #.#] [-yMt #.#] [-ymt #] [-ys #.#] [-yto #.#] [filename]

Meaning of flag symbols:

# = integer
#.# = float
" " = character string.
{} = variable is an array. Values must be seperated by a ',' and no spaces are allowed. Do not use the "{ }" symbols on the command line.

NOTES:

1). All parameters in [] brackets are optional.
2). Quotes must be used around character strings.
3). Filename, if given, must be listed last.
4). If no default is given, the feature is not currently supported on command line.

If no entry is required for flag, flag command executed.

Flag Definitions:

-arrw = gradient arrow tip length default = 6.0
-bf = fill interior of blanking lines default = 1
0
1
=
=
False
True
-bl = use blanking file default = 0
0
1
=
=
False
True
-blf = blanking file default = " "
-cb = color contour grid blocks default = 0
0
1
=
=
False
True
-cfm t = contour line label format default = "g"
-cint = contour interval default = dz / 10.0
-cmax = maximum contour interval default = z maximum
-cmin = minimum contour interval default = z minimum
-colcut = cutoff colors outside palette range default = 0
0
1
=
=
False
True
-cplt = plot main contour line labels default = 1
0
1
=
=
False
True
-cmax = maximum color palette value default = z maximum
-cmin = minimum color palette value default = z minimum
-csmo = contour line smoothness default =
-cspc = contour line label spacing default = 3
-ctyp = contour line type default = 2
0
1
2
=
=
=
linear
Akima spline
cubic spline
-esp = exageration scale priority default = 0
0
1
=
=
favor y-exageration scale (-ys)
favor x/y ratio
-fnt1 = main title font default = Helvetica-Bold
-fnt2 = secondary title font default = Helvetica-Bold
-fnt3 = axes label font default = Helvetica
-fnt4 = division font default = Helvetica
-fnt5 = contour label font default = Helvetica
-fnt6 = x-section/profile font default = Helvetica
-fnt7 = annotation font default = Helvetica
-fnt8 = mouse position font default = Helvetica
-fnts1 = main title font size default = 24.0
-fnts2 = secondary title font size default = 15.0
-fnts3 = axes font size default = 15.0
-fnts4 = division font size default = 12.0
-fnts5 = contour label font size default = 10.0
-fnts6 = x-section/profile font size default = 15.0
-fnts7 = annotation font size default = 10.0
-fnts8 = mouse position font size default = 12.0
-gdmax = maximum gradient default = steepest gradient
-gdmin = minimum gradient default = shallowest gradient
-gs = scale gradient arrows default = 0
0
1
=
=
False
True
-gt = scale indicator type default = 0
0
1
=
=
arrow
filled block
-gv = draw gradient arrows default = 1
0
1
=
=
False
True
-help = give this help menu
-lc = blanking and posting label column default = 4
-lgf = log file name defalut = "log.dat"
-lf = main contour line frequency default = 5
-lMd = main contour line frequency default = 0
0
1
=
=
False
True
-lmd = minor contour line dashed default = 0
0
1
=
=
False
True
-lMt = main contour line thickness default = 2.0
-lmt = minor contour line thickness default = 1.0
-lpbm = page bottom margin default = 1.5
-lpc = number of copies to print default = 1
-lpd = print destination default = 0
0
1
=
=
Printer
File
-lpf = print filename default = "junk.ps"
-lph = print header page default = 0
0
1
=
=
False
True
-lplm = page left margin default = 1.5
-lpo = print orientation default = 0
0
1
=
=
Portrait
Landscape
-lppsext = search extention for postscript files default = "*.ps"
-lpq = print queue default = "ps"
-lpr = print file at specified orientations
-lprm = page right margin default = 1.0
-lps = print output default = 0
0
1
=
=
Black & white
Color
-lptm = page top margin default = 1.5
-md = dash mesh default = 0
0
1
=
=
False
True
-mox = X mesh origin default = 0.0
-moy = Y mesh origin default = 0.0
-ms = use mesh default = 0
0
1
=
=
False
True
-mx = X mesh frequency default = 1/10 DX
-my = Y mesh frequency default = 1/10 DY
-pA = profile line starting label (A) default = "A"
-pAA = profile line starting label (A') default = "A'"
-pal = user specified color palette file default = " "
-pbx = profile line starting X (A) default = 0.0
-pby = profile line starting Y (A) default = 0.0
-pbx = profile line ending X (A') default = 0.0
-pby = profile line ending Y (A') default = 0.0
-pl = use mesh default = 0
1
2
3
4
5
6
7
=
=
=
=
=
=
=
gray
spectrum
spectrum (looped)
hue
hue (looped)
white
user defined
-prf = preference file name defalut = "contour.prf"
-ptd = post data locations defalut = 0
0
1
=
=
False
True
-ptf = post data file defalut = " "
-ptl = post data labels defalut = 0
0
1
=
=
False
True
-rfh = screen refresh default = 0
0
1
=
=
On exposure
On update
-scl = show map scale defalut = 1
0
1
=
=
False
True
-sttl = Secondary title default = " "
-ttl = Main title default = Filename
-units = map scale unit label default = "feet"
-vp = show map scale defalut = 0
0
1
2
=
=
=
X-Y
X-Z
Y-Z
-vpc = active column view plane defalut = 1
-vpl = active layer view plane defalut = 1
-vpr = active row view plane defalut = 1
-xc = posting file X column defalut = 1
-xfmt = Number of decimal places for X-axis default = ".2f"
-xlabel = X-axis label default = "X"
-xmax = Graph X-maximum default = Data Maximum
-xmin = Graph X-minimum default = Data Minimum
-xMt = X main tic frequency default = 1/10 DX
-xmt = Number of minor X tics default = 5
-xsec = cross-section/profile line drawing rule defalut = 0
0
1
2
=
=
=
random
fixed start point
user specified
-xto = X axis label origin default = 0.0
-xy = xy ratio default = 1.5
-yc = posting file Y column defalut = 2
-yfmt = Number of decimal places for X-axis default = ".2f"
-ylabel = X-axis label default = "Y"
-ymax = Graph Y-maximum default = Data Maximum
-ymin = Graph Y-minimum default = Data Minimum
-yMt = X main tic frequency default = 1/10 DY
-ymt = Number of minor Y tics default = 5
-ys = Y-axis exageration relative to X-axis default = Calculated
-yto = X axis label origin default = 0.0

An example command might be (typed on one line):

contour -bl 1 -blf "conc.blk" -ptd 1 -ptf "conc.lbl" -ptl 1 -xMt 50.0 -yMt 25.0 -ttl "Hazardous Waste Spill" -sttl "X-Z Cross-Section" -xlabel "Easting" -ylabel "Elevation" -xfmt ".0f" -yfmt ".1f" conc3.srf

This command produces the contour map in Figure 11.1 and 11.2.

[TOP]


Setting up Input Files:

Several data file formats are readable by contour. The application is able to distinguish them without any user input though.

The Standard UNCERT Grid Formats:

There are two UNCERT "standard" grid file formats: grid centered, and node centered. Both grid styles can be used for two-dimensional and three-dimensional grids. For the difference between the grids, refer to Figure 10.3 (Chapter 10, grid).

Grid Centered:

The grid centered UNCERT ormat specifies the number of rows (n) columns (m), and layers (o) in the grid, the X-Y-Z map origin, the width of the map in the X, Y, and Z directions, and a value for every grid location in the matrix (NO dummy or NOT KNOWN values are allowed). The format is as follows:

	GRID CENTERED GRID
	# col	# row	# lay	width (X)	width (Y)	height (Z)	X-origin 	Y-origin	Z-origin
	[int]	[int]	[int]	[real]	[real]	[real]	[real]	[real]	[real]
	row-1:col-1:lay-1	row-1:col-2:lay-1	...... 	row-1:col-n:lay-1	
	[real]		
	row-2:col-1:lay-1	row-2:col-2:lay-1	...... 	row-2:col-n:lay-1	
	[real]
 	  :
 	  :
	row-m:col-1:lay-1	rowm:col-2:lay-1	...... 	row-m:col-n:lay-1	
	[real]
	row-1:col-1:lay-2	row-1:col-2:lay-2	...... 	row-1:col-n:lay-2	
	[real]		
	row-2:col-1:lay-2	row-2:col-2:lay-2	...... 	row-2:col-n:lay-2	
	[real]
 	  :
 	  :
	row-m:col-1:lay-2	rowm:col-2:lay-2	...... 	row-m:col-n:lay-2	
	[real]
	  :
 	  :
	row-1:col-1:lay-o	row-1:col-2:lay-o	...... 	row-1:col-n:lay-o	
	[real]		
	row-2:col-1:lay-o	row-2:col-2:lay-o	...... 	row-2:col-n:lay-o	
	[real]
 	  :
 	  :
	row-m:col-1:lay-o	rowm:col-2:lay-o	...... 	row-m:col-n:lay-o	
	[real]

When defining the layers, start at the bottom layer (top of file) and work up to the top layer (bottom of file).

Node Centered:

The node centered format is identical to the GRID CENTERED GRID format except for the first header line. The first header line is:

NODE CENTERED GRID

Other Grid File Formats:

UNCERT also support two-dimensional SURFER grid formats, and two- and three-dimensional GSLIB formats.

SURFER:

SURFER Files must be created using the ASCII option under OUTPUT when gridding the file. Otherwise, a binary grid file is created and this program will not read it correctly.

GSLIB:

For GSLIB files there are two requirements. One, the grid value information must be in column one, and two, grid flie must have an associated parameter (*.par) file. This is where row, column, layer, and dimension data is read from. The filename of the parameter file must have the same prefix as the grid file, and it must have a *.par extentsion. A series number bewteen the prefix and extension can be given in the grid file name. Valid parameter filenames for the grid file water..12out would be:

water.12.par
water.par

If a correct parameter does not exist, the grid file is not loaded.

Setting up a Blanking File:

The blanking files are a series of lines or closed, non-intersecting, polygons where each line and polygon is made up of a series of X-Y map coordinate pairs and line or polygon ID. For purposes here, a polygon is any 2-dimensional area whose boundary is fully defined by 2D coordinate pairs. The file format is as follows:

X-coordinate Y-coordinate Line/Polygon-ID
X-coordinate Y-coordinate Line/Polygon-ID
X-coordinate Y-coordinate Line/Polygon-ID
X-coordinate Y-coordinate Line/Polygon-ID
X-coordinate Y-coordinate Line/Polygon-ID
etc.

To build the data file, the polygon ID's must start at "1" and be incremented positively. The X-Y data pairs must follow a border (clockwise or counter-clockwise) because the polygon border will be drawn between consecutive points. Note: the area interior to the polygon will be the area blanked out. This is also an unformatted file; all numbers must be separated by a space. As an example, the blanking file building.blk used in Figure 11.3 is shown below:

	0.40 	0.19 	1	START Polygon #1
	0.90 	0.69 	1
	1.40 	0.19 	1
	0.40 	0.19 	1	END polygon #1
	4.25 	3.25 	2	START polygon #2
	4.25 	3.45 	2
	4.00 	3.45 	2
	4.00 	3.65 	2
	4.25 	3.65 	2
	4.25 	3.90 	2
	5.00 	3.90 	2
	5.00 	3.25 	2
	4.25 	3.25 	2 	END polygon #2

NOTE: A polygon is distinguishable from a line, because the first and last points are the same, i.e. the polygon is "closed."

Setting up a Posting File:

Posting files are a series of X-Y coordinate pairs and a label (at least - there may be more columns, but the X data must be in column #1 and the Y data must be in column #2). The data file is unformatted, therefore at least one space must separate all numbers and labels. NOTE: Within a label there can be no spaces; a space indicates the end of the field. The general format is given below:
	X-coordinate    Y-coordinate    ...    Label   ...
	X-coordinate    Y-coordinate    ...    Label   ...
	X-coordinate    Y-coordinate    ...    Label   ...
	X-coordinate    Y-coordinate    ...    Label   ...
	X-coordinate    Y-coordinate    ...    Label   ...
	etc.

As an example, the posting file label.lbl used in Figure 11.3 is shown below:

	! This is a test label set for use with gridded data sets created
	!  from the file 'water.dat'
	!
	! X    Y     Z   Label
	!----------------------------------------------------------------
	2.93  2.38  0.0   1.0
	4.01  3.51  0.0   2.0
	4.15  3.73  0.0   3.0
	3.74  1.45  0.0   4.0
	1.29  4.05  0.0   5.0
	5.20  2.68  0.0   12345abcde
	4.60  3.77  0.0   B
	4.03  4.02  0.0   CC-456
	0.30  3.20  0.0   12.0

Setting up a Palette File:

Palette files are a series of 175 red, green, and, blue (RGB) intensity value sets in the file. For each RGB color, the minimum value is 0, and the maximum is 255. For example, the entries for the following colors would be:

	Blue:	  0   0 255
	Cyan:	  0 255 255
	Green:	  0 255   0
	Yellow:	255 255   0
	Red:	255   0   0
	Magenta:	255 255   0
	White:	255 255 255
	Black:	  0   0   0

The first entry in the data file will be assigned to the minimum color palette value (See Palette:Color Legend section above), and the 175th entry will be assigned to the maximum color palette value.

Contour Mathematics:

Slope Gradient Determination:

The calculation of the cell gradient is simple, but only an approximation. Because four points (one point at each corner) define a cell and only three points are needed to define a plane, the solution is over-defined, and there is no guaranty that these four points lie on the same plane. One alternative solution would be to divide each rectangular cell into two triangles and calculate the gradient for each. This, though mathematically correct was not done, because of the computational expense, appropriate means for deciding how to define the triangles, and questions about visualization of gradient arrows within a cell. Instead, all four point were used in a single calculation. Two vectors were calculate, one in the +X direction and one in the +Y direction; with two vectors, a plane can be defined. Given the cell grid values:

(11-a)

where pi represents an individual grid point. The X and Y vectors are calculated:

(11-1) (11-1)

(11-2) (11-2)

[TOP]


Bibliography (contour):

Wessel, P. and W.H.F. Smith, 1991, GMT-SYSTEM Software, The School of Ocean and Earth Science and Technology, University of Hawaii, and the Scripps Institution of Oceanography, University of California at San Diego.

Wingle, W.L., 1992, Examining Common Problems Associated with Various Contouring Methods, Particularly Inverse-Distance Methods, Using Shaded Relief Surfaces, Geotech '92 Conference Proceedings, 1992, Lakewood, Colorado, pp 362-376.

[TOP]


Table of Contents
Previous Chapter
Beginning of this Chapter
Next Chapter