grail.data.modelgenerator Module

Version: 16.2

Table of Contents

Overview

This module provides the ability to create and initialize a new model file (file 13 or file 15).

Examples

The following snippet illustrates how to create a 3-D Block Model. In this example, the model file created would be named "test15.dat".

pcfpath = "C:/test10.dat"
items=[]
items.append(("TOPO", 1, 100, .1))  #name, min, max, precision
items.append(("GRADE", 0, 1, .001))
items.append(("CU", 0, 1, .001))
modelfile = modelgenerator.createModel(pcfpath, items, 15, "dat")

Functions

createModel(pcfPath, itemInfo, fileType, extension)

Creates a new model file given the PCF, a list of item information, the file type, and the file extension. Returns the filename of the newly created model (uses the prefix of the pcfPath).

Arguments:
pcfPath : string
The path to the PCF file which the block model will be associated with.
itemInfo : list
A list of tuples representing the custom items to be added to the model: (name, min, max, precision)
fileType : integer
Must be either 15 (for a 3-D Block Model) or 13 (for a 2-D Surface file)
extension : string
A three-character string which will become the file extension of the new model file (i.e. "dat")