Carlson 30th Anniversary User Conference April 7 – 10, 2013 IMPROVE YOUR SKILLS ● LOOK TO THE FUTURE ● CELEBRATE THE PAST Carlson Mining – Grid File Utilities April 8, 2013 – Session 2 Presented By: Brian Hamm BHamm@CarlsonSW.com This class covers different applications for Grid File Utilities as pertaining to grids for mining. It starts with basics such as simple math applied to a grid file and progresses to high-end IF statements to control mining thickness with dilution and loss. Grid File Utilities Grid File Utilities with Values The top left 10 buttons shown here in red are utilities that are Grid to Value operations. The steps to use these buttons are as follows. First, “Select Grid”, then load the file. Second, choose a utility, such as “Subtract Value”. If Use Inclusion/Exclusion Areas is turned on, then select the areas for each. In this example, fifty feet will be subtracted from the Elevation.GRD to show the result in 3D. Enter 50, and then choose Save As to save the grid out as a new name. Grid File Utilities, Grid to Value options. Now to view this new grid in the Surface 3D Viewer gives this result to see the grid elevations dropped down 50’ inside the inclusion perimeter. 3D View of the 50’ shift in the grid Grid File Utilities with Grid to Grid Math The top 9 buttons on the right column are where the grid to grid utilities are found. The process is to select grid A, choose the utility button, then select grid B, then save as a new file. Grid to Grid math functions The next example covers a grid to grid utility where two different thickness grids are combined to make a composite thickness grid. Here are the steps. 1. Select the first thickness grid, Thickness.GRD 2. Choose the button “Add Grid” 3. Select the second thickness grid, Thickness2.GRD 4. Choose the Save As button, and give the file a new name such as Thickness Composite.GRD The Grid Inspector is another way to confirm the grid math was executed correctly. In the location shown here, 6.139 + 21.447 = 27.586 exactly. This confirms the grid addition was done correctly. Grid Inspector of the thicknesses Grid File Utilities – Modifying or viewing a Grid File. The lower 13 buttons on the dialog are for individual modifications of the grid cells or position, and for viewing the grid different ways. This example will convert a grid from 50x50 cell size to 25x25 cell size, yet keeping the same position of the grid corners. 1. Step one is to Select Grid, and choose the grid to modify. This will choose the Thickness grid. 2. Then choose the Change Resolution button, and set it to Dimensions of a Cell, and use 25 for X and 25 for Y. 3. Then select the Save As button and give it a new name, such as Thickness 25x25. 4. View the grid in the Grid Info button to see the result of the modification. GFU Macro Editor There are many reasons to create a saved GFU macro file. Since it is a macro, it can easily be repeatable by other users, and is documented for any discrepancies. Parameters can be changed quickly for what-if scenarios. Math and logic are applied to both values and grids in the same line. Even though this is called Grid File Utilities, the equations in the macro editor can be applied to grids and TINs both. The buttons used when not in a macro are just used in grids. The GFU macro can be created with the built-in macro editor, which also runs them, or in any external text editor. The right side of the window is the macro recorder where the files can be created and executed. Here is the Surface Macro Launcher with the same logic to create a composite thickness grid. Add Comments for Reference and Future Users When building the macro, comments and explanations are vey important to document what everything is. As shown in the macro here, everything after the “;” is ignored. The first line states “;This macro creates….” ;=========================== There are also comments after the Load Grid lines to define what is occurring in each step. “;Load the first thickness grid” Variables The variables used in the equations can be very descriptive of the equations. Examples of variables are: A= THK = Thickness1 = BTU = MinMinableThk=1.0 Use a combination of both upper and lower case letters to aid in the description. Do not use spaces. Variables will stay defined and in memory for later use until the RELEASE function is used. An example of that is: RELEASE(Variable) Releases memory used by a surface and undefines it for further use. When using a combination of grids and TINs, it is important to consider what the output will be. It is based on what is used and defined first in the equation. Here is an example of the different possibilities: ; =============Define the variables first============== ; Value=100; is a value GRID=LoadFrom(C:\CarlsonProjects\TEST.grd); Load the test grid TIN=LoadFrom(C:\CarlsonProjects\TEST.tin); Load the test tin ; ;This is solving for the new variable RESULT: ; RESULT1 = TIN - GRID; will be a TIN RESULT2 = GRID - TIN; will be a GRID RESULT3 = Value - GRID -TIN; will be a GRID RESULT4 = Value - TIN – GRID; will be a TIN ;============================================== IF Statements The IF statements are very similar to what you use in Excel. Here are some simple variables to show the concept. X = IF ((A>B | C<D),Y,Z) If A> B OR C<D, then X=Y, otherwise X=Z The “|” is the OR function. X = IF ((A>B & C<D),Y,Z) If A> B AND C<D, then X=Y, otherwise X=Z The “&” is the AND function. Here is an example with more descriptive variables substituted in. BedThickness = IF ( BTU < BTUCutOff, 0.0, BedThickness ) Or, in other words, the new bed thickness is defined by: IF the BTU is less than the BTUCutOff, then set it to zero, otherwise leave it as the bed thickness that was previously defined. Coal Loss and Dilution, and Weight Averaged Quality Attributes ; ;============= THIS MACRO CALCULATES THE MINING LOSS AND DILUTION, THEN THE AS-MINED ASH VALUES ======= ; ;First, the Variables are set. LossFromTop=0.5; thickness of coal lost from the top of coal DilutionThk=0.25; Thickness of floor dilution added to bottom of coal BTMELV=LoadFrom(C:\Carlson Projects\2010 User Conference\Grid File Utilities\Bottom Elevation.grd); Load the Bottom of coal elevation surface THICK=LoadFrom(C:\Carlson Projects\2010 User Conference\Grid File Utilities\Thickness.grd); Load the Thickness of coal TOPELV=LoadFrom(C:\Carlson Projects\2010 User Conference\Grid File Utilities\Top Elevation.grd); Load the Top of coal elevation surface ;======================================================================== ; The Variables are now set ; TopMining=TOPELV-LossFromTop; the lost coal will become overburden BtmMining=BTMELV-DilutionThk ; new bottom of minable bed ThkMining=TopMining-BtmMining ; new minable thickness SaveAs(TopMining,C:\Carlson Projects\2010 User Conference\Grid File Utilities\TopMiningElv.grd); SaveAs(BtmMining,C:\Carlson Projects\2010 User Conference\Grid File Utilities\BtmMiningElv.grd); SaveAs(ThkMining,C:\Carlson Projects\2010 User Conference\Grid File Utilities\ThkMining.grd); ;========================================================================= ; ;Now to set the variables for the As-Mined Ash Values CoalSG=1.28 CoalDensity=80; This is in pounds/cubic foot, the Density = SG x 62.4 DilutionSG=2.5; DilutionDensity=156; DilutionAsh=80; This is in percent. CoalAsh=LoadFrom(C:\Carlson Projects\2010 User Conference\Grid File Utilities\ASH.grd) ;======================================================================== WeightCoal=(THICK-LossFromTop)*CoalSG; WeightDilution=DilutionThk*DilutionSG WeightTotal=WeightCoal+WeightDilution CoalAshUnits=WeightCoal*CoalAsh DilutionAshUnits=WeightDilution*DilutionAsh AshUnitsTotal=CoalAshUnits+DilutionAshUnits AshMining=AshUnitsTotal/WeightTotal; This is the Weighted Percent Ash SaveAs(ASHMining,C:\Carlson Projects\2010 User Conference\Grid File Utilities\ASH_Mining.grd);