How to create conditional grids using the if…else template
Occasionally, we receive an email in the Support Inbox that reminds me how easy it is to resolve complex mapping challenges in Petrosys PRO – when you know where the tools are! One such email we received recently was to with a specific template in our Grid Arithmetic tool. The if…else template.
Those of you familiar with Python and other coding languages will know that if…else can be used to implement a specific statement, depending on whether the written expression is true or false. Within Petrosys PRO, this can be used to create conditional grids.
The simplest example of a conditional grid is one where you want to convert structural or attribute grid values into binary format.
However, the example we are looking at here in more detail focuses on how we can create a conditional structural grid that is only present if the sediment thickness is above a certain threshold.
As input, you will need an isopach grid and a structural grid (Figure 1). The format of the if…else statement is similar to the example above, but the else path uses the function missing ( ) to remove data from the structural grid where the thickness threshold is not met.
The steps are as follows:
- Go to Surface Modelling > Grid > Processes > Arithmetic.
- In the Arithmetic tool, click Clear to remove any pre-existing formulae.
- Then select Insert, change the Template group to Conditional tests and select the template called If…else. Click OK.
- You can use this template for the basis of your task. In the below screenshot (Figure 2) I have made some edits in order to use the condition missing().
- Once you are happy with the formula, press the blue arrow and populate the variables i.e. link the variables to the input grids and assign and output grid name.
- Set the Output Geometry and (if needed) add any Faults you want to use to constrain the output structural grid.
- Run the task and display the output in Mapping (Figure 3).