grail.engines.sgr Module

Version: 16.2

Table of Contents

Description

A standard interface to the SGR (Surface Gridding) standalone engine executable.

Standard Definitions

point_list:
A list of points, defined as: [[x0, y0, z0], ..., [xN, yN, zN]].
coded_point_list:
A tuple containing two items: the first item is a code (string), the second is the corresponding point_list. This data type is intended to mimic the srv file format. The code should match with an accompanying parameter file (survey code file). For example, ['BENCH', [[x0, y0, z0], ..., [xN, yN, zN]]]
face_list:

All face lists are described such that the first index indicates how many faces are in the face. For example,

[3, 1, 2, 3, 3, 4, 5, 6]

States that there are 3 vertexes in the first face, and those vertexes are 1, 2, 3. Then the next face contains 3 vertexes, which are 4, 5, 6. This may seem a bit confusing, but using this structure buys us some definite efficiencies. Note that all faces in MineSight® products have 3 vertexes.

Functions

Note

Be careful with the filepath strings used in these functions. Since the backslash character is used in Python as an escape character, it is best to use forward slashes (or two backslashes) in the filepaths.

Most arguments in these functions correspond to an option in the Standalone engine. All arguments in these functions have a default value of 'None', which makes the arguments optional. If left unspecified, the option will not be included in the call to the engine executable. Calls to these functions must use `keyword arguments` (keywords are the formal parameter names). See the examples below for more details.

sgr(topPointList, topFaceList, botPointList, botFaceList, limitPointList, limitFaceList, bench, prt, grid, vol, xmin, ymin, nx, ny, dx, dy, sbx, sby, hx, hy, dip, azim, mem, cover, extend, feet, real, dat, tmp, e, debug)

Surface Gridding and Volume Calculation Utility. The function creates one of three possible output files (see: prt, grid, and vol)

Arguments:
topPointList : point_list (see Standard Definitions).
Points for upper surface or a single surface to grid.
topFaceList : face_list (see Standard Definitions).
Faces for upper surface or a single surface to grid.
botPointList : point_list (see Standard Definitions).-
Points for lower surface (for volume and partials calculations between the upper and lower surfaces).
botFaceList : face_list (see Standard Definitions).
Faces for lower surface (for volume and partials calculations between the upper and lower surfaces).
limitPointList : point_list (see Standard Definitions).
Points for limiting surface.
limitFaceList : face_list (see Standard Definitions).
Faces for limiting surface.
bench : string
Input file containing a list of benches for partials calculations. Contains bench toe elevations arranged in descending order one entry per line.
prt : string
Output cutting and filling partials. Program will create two files (file.cut and file.fil) coded in m659v1 program format and a file.vol with volumes per bench.
grid : string
Output file with a grid coded in m610v1 program format.
vol : string
Output file with cut and fill volumes between upper and lower surfaces.
xmin/ymin : integer
X/Y coordinates of the origin of the grid.
nx/ny : integer
Number of columns/rows in a grid.
dx/dy : integer
Width/height of a cell.
sbx/sby : integer
Number of sub-columns/sub-rows in a cell.
hx/hy : integer
X/Y coordinates of hinge point.
dip : integer
Dip of bench inclination (degrees).
azimuth : integer
Azimuth of bench (degrees).
mem : integer
Maximal allowed size of allocated memory in Megabytes. Default size is 10.
cover : integer
Program defines -xmin,-ymin, -nx and -ny parameters to cover all surface(s) with the grid. Set value to 1 to turn on this option.
extend : integer
Program defines -nx and -ny parameters to cover surface(s), starting from the user specified origin. Set value to 1 to turn on this option.
feet : integer
Report imperial measurements. Set value to 1 to turn on this option.
real : integer
Output real co-ordinates rather then indices in files produced with grid and prt arguments. Set value to 1 to turn on this option.
dat : string
Define a directory for input and output files.
tmp : string
Define a directory for intermediate files.
e : integer
Economy mode - Program dumps out results to the disk as soon as possible to save memory. Set value to 1 to turn on this option.
debug : integer
Debug option will output the command string used to call the engine executable and will relay any output messages from the engine. Set value to 1 to turn on this option.
Example:
from grail.engines import sgr

#use keyword arguments in function call
sgr.sgr(topPointList=upper_pts,
            
topFaceList=upper_faces,
            
botPointList=lower_pts,
            
botFaceList=lower_faces,
            
vol="C:/out.prt",
            
xmin=0, ymin=0, nx=20, ny=20, dx=10, dy=10, sbx=10, sby=10)