Grid File Utilities
Function
This command has many functions to modify grid files. The
modifications can be done
manually and in a batch mode using the grid macros. To modify manually,
start by picking the Select
Grid(s) button. There is another option to use inclusion
and exclusion polylines. With
this option active, the program will prompt for inclusion and exclusion
polylines when a grid action
is started. Only grid cells inside the inclusion polylines will be
modified. Grid cells inside the
exclusion polylines will not be modified. If no inclusion and exclusion
polylines are selected, then the
entire grid will be modified. Each function is described below.
- Max Value: Compares a grid and a value and takes the
Maximum value of either. This is a way to stop a grid from going
negative, below zero.
- Max Grids Compares a grid with another grid and
takes the Maximum (higher) value of either.
- Min Value: Compares a grid and a value and takes the
Minimum value of either. This is a good way to cap a grid off at a
certain value so it never goes higher than the specified value.
- Min Grids: Compares a grid with another grid and
takes the Minimum (lessor) value of either.
- Less Value: Asks for a value to compare and a value
to assign
and uses the following logic:
If GridA < compare_value then
GridA =assign_value, otherwise no
change
- Less Grids: Asks for a grid to compare and a grid to
assign
and uses the following logic:
If GridA < compare_GridB then
GridA = GridC, otherwise no
change
- Greater Value: Asks for a value to compare and a value
to assign
and uses the following logic:
If GridA > compare_value then
GridA =assign_value, otherwise no
change
- Greater Grids: Asks for a grid to compare and a grid to
assign
and uses the following logic:
If GridA > compare_GridB then
GridA = GridC, otherwise no
change
- Add Value: Adds an entered value to the grid values.
(GridA + X)
- Add Grid: Adds one grid to another grid. (GridA +
GridB)
- Subtract Value: Subtracts an entered value from the grid
values. (GridA - X)
- Subtract Grid: Subtracts one grid from another grid. (GridA - GridB)
- Multiply Value: Multiplies the grid values by an entered value. (GridA * X)
- Multiply Grid: Multiplies the grid values by another grid. (GridA * GridB)
- Divide Value: Divides the grid values by an entered value. (GridA / X)
- Divide Grid: Divides the grid values by another grid. (GridA / GridB)
- Power Value: Raises the grid values to the specified power. (GridA squared, or Grid A to the 1.8
power)
- Power Grid: Raises the grid values to another grid for the "power". (GridA raised to GridB)
- Set Value: assigns the grid elevations to the
user-specified
value. For example by using Set
Value with the inclusion perimeter option, you could set the grid
values to 0.0 within the inclusion
polyline for a strata thickness grid. The four options are Value to
Value which will set all values to one value, Null to Value, which will
set all Nulls to one value, Null to Grid, which will set all Nulls to
another specified grid and Value to Null, which will set all values to
Null. Using inclusion and exclusion perimeters are usually required for
this command.
- Extrapolate: can be used to assign elevations to all
grid
corners by any of four methods. Global
Trend finds the average slope and slope direction from the existing
grid elevations and applies this
slope to calculating the missing elevations. Average method calculates
a grid elevation as the
average of its nearest neighbors. Projected method extends the trend at
the edge. Combined method
uses both Average and Projected.
- Change Position: This lets you change the lower left and upper
right corners of the grid file. For
example, you can use this routine to localize a grid file if you have a
large grid for the entire site but are
currently working on a smaller area. If the new position covers area
outside the original position, any
grid cells in this area will be assigned a null value. Otherwise the
program uses the original grid
values for the new grid position.
- Change Resolution: This changes the grid resolution (number
or dimensions of
grid cells). The program uses
the original grid values for calculating the grid values at the new
resolution. Enter a new value for X and Y number of cells or dimensions
of cells.
- Match Dimensions: Sets the grid position and resolution to
match
another grid file. The
program will prompt for a grid file to get the position from. Certain
commands require grids match position and resolution. Running this
command will set that.
- Smooth Grid: Smoothing applies a quadratic smoothing
algorithm to the
grid by using neighboring nodes
to adjust each grid node. This routine can be used to refine a grid so
that the contours from the Contour
from Grid routine appear
smoother. Typically this
adjustment is relatively small. To get
more smoothing, run the routine more times.
- Plot Grid: This runs the Draw 3D Grid command. It is
documented elsewhere in the manual.
- Export Grid: There are four choices for export
options: Carlson CRD file, ASCII text as XYZ, ASII text as YXZ, and as
a DTM format. There are two options for the ASCII delimiter, either a
comma or a space. There is an option to skip a number of rows and
columns between the exported points. When exporting as the Carlson CRD
file, the description for the points is set below.
Export to DTM writes the current
grid file to a
DTM format text file. The format of this file is
the following:
DTM 1.0
Header Line
test.dtm
Name of file
51
Number of
cells in X
direction
51
Number of
cells in Y
direction
79442.4697 Lower left
grid
corner Y coordinate
14899.0326 Lower left
grid
corner X coordinate
0.0
Lower left grid
corner Z
coordinate
11.5618
Dimension of cell in
X direction
7.0639
Dimension of cell in Y
direction
1581.2612
Grid cell values
starting from lower left, moving from
left to right
1580.8879
1580.3257
etc...
- Merge Grids: creates a grid file by merging together
two
existing grid files, grid1 and grid2.
The current grid is grid1 and the program will prompt for a second
grid. These two grids must
overlap with the same location and resolution. The inclusion and
exclusion perimeters apply to grid2
such that the merged grid will consist of grid2 cells within the
inclusion perimeters and outside
the exclusion perimeters and grid1 cells everywhere else. The result is
stored in the current grid.
- Import Grid: There are 3 main formats that may be
imported. They are from an ASCII file, from the program Surfer (both
ASCII and Binary), and from a DEM (digital elevation model) such as
from the USGS (US Geological Survey). The ASCII file can match various
formats.
Import from ASCII File creates a grid file from X Y Z data in any
text file. There does not need to be a
current grid file loaded since this routine will create a grid file.
The text file should consist of one X Y
Z coordinate per row with the first coordinate being the lower left
grid corner and the last
coordinate as the upper right grid corner. There are options for space
or comma separated coordinates
and for the order of the coordinates as either row (left to right) or
column (bottom to top). The prompting will be as follows:
Separation type
[<Space>/Comma/FixedWidth]?
Column number for X coordinate <1>:
Column number for Y coordinate <2>:
Column number for Z value <3>:
- List Grid: displays a list of the northing, eastings
and
elevation of each grid corner. A grid
corner will have no elevation, or Null value, listed as None, if the
grid corner was
outside the limits of the data
during Make 3D Grid File.
- Spreadsheet: displays the grid elevations in a row and
column
spreadsheet that is in the same
layout as the grid file. Grid elevations can be edited in this
spreadsheet and saved upon exiting the spreadsheet.
- Select Grid(s): This is the first step to load a grid.
Usually a grid needs to be loaded before running a function. If Batch
Process Grids is turned on, then multiple grids may be selected while
holding down the Shift or CTRL buttons.
- Grid Info: This function displays information about
the grid file. It is a form of Grid Statistics. The items it displays
are shown in the report below:
- Macro Command Recorder: If there is a GFU that is done over and
over again, or for many different grids, then this Macro Recorder is an
efficient way to perform Grid File Utilities on many files, for many
functions.
The
Macro Command Recorder allows you to store the grid manipulation
steps to a (.GFU) file.
The macro can be recalled with the LOAD button to re-run the steps. The
Record button will prompt for a macro file name to
create. Then start choosing grid action buttons and
each grid file function will be stored to this file. Each
grid file in the script is represented as a variable
name such as A or B or COALTHK. The current grid file that is
being modified is specified in the Current Variable edit
box.
When recording a step that
involves another
grid file, there are three options for storing this grid
into the script. Use Grid Variable will use the grid
assigned to the Grid Variable Name. Prompt for
Grid File Name will bring up a grid file selection
dialog each time the macro is run. Store the Grid File
Name will save the specific grid file name into the macro.
To start the recording process, choose Record. Then go through the
functions. Each will appear in the macro window. When done recording,
choose Stop. The Append will add on to the end of an existing GFU file.
Load will recall a save GFU file. Run will execute the Macro, and Edit
will bring the text editor up for editing the GFU file. If Copy, Paste,
Search and Replace are useful tools here. Sometimes it helps to record
a function once, then copy and paste it many times while using the
Search and Replace function to change grid file names etc.
- AutoExtrapolate On Load: This will
extrapolate values for any null or empty values in the
grid as the grid is loaded.
- Use Inclusion/Exclusion Areas: If this is turned on, then the GFU
function will only be applied within the selected inclusion polyline
and outside the selected exclusion polyline.
- Batch Process Grids: When
this option is turned on, GFU functions can be executed on many grids
at once. It is recommended to move the grids to a backup directory, or
create a copy of them, as the grids are over-written with the same
name. The functions that cannot be batched are: Plot Grid, Merge Grid,
List Grid, Export Grid, Import Grid and Spreadsheet.
Pulldown Menu Location: Surface
Keyboard Command: GFU
Prerequisite: Make a grid (.GRD) file with
the Make 3D Grid File command.
File Name: \lsp\makegrid.arx