PRO TIP Grid Arithmetic

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.

Figure 1. Isopach and structural grid

The steps are as follows:

  1. Go to Surface Modelling > Grid > Processes > Arithmetic.
  2. In the Arithmetic tool, click Clear to remove any pre-existing formulae.
  3. Then select Insert, change the Template group to Conditional tests and select the template called If…else. Click OK.
  4. 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().
  5. 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.
  6. Set the Output Geometry and (if needed) add any Faults you want to use to constrain the output structural grid.
  7. Run the task and display the output in Mapping (Figure 3).

Grid arithmetic tool

output structural grid


Get in touch

If you would like to know more about Petrosys PRO contact our team of mapping gurus.