It is common in the Oil & Gas industry to store data in Excel spreadsheets. The way the data is stored in these spreadsheets varies between sites: multiple attributes can be stored in a single spreadsheet, in multiple sheets in the same file or across multiple files.
Introduced in Petrosys PRO 2017.1 to help users save time and streamline their workflows, tasks in Surface Modeling containing Excel spreadsheets can now be scripted and looped. This considerably reduces the length of workflows, as it can replace many steps.
To have a better understanding how this works, let’s look at 2 examples where scripting and looping might be useful. In one, we have a single excel file with many formation tops in 5 worksheets, see Graphic 1.
Graphic 1. Spreadsheet file containing multiple formation tops across several sheets.
Previously, if we wanted to grid the tops of each formation in Surface Modeling, we had to create individual gridding tasks, all of them using the same input file but pointing to a different sheet.
Now, with the new scripting and looping enhancement introduced in Petrosys PRO 2017.1, you have the benefit of having to create a gridding task only once and then script and loop the relevant input/output parameters as you would normally do it.
The added benefit of this enhancement is the ability to script the parameter of the sheet name, in our example below (Graph 2) the parameter is named, GDS_POINTDATA.TableSheet.
Graphic 2. Task Scripting Parameters panel. The scripted sheet parameter is highlighted.
Note: Set the Loop input type to ‘Strings’ in the accompanying looping task (Graphic 3). The Input strings to entered are taken from the names of the sheets, as seen in Graphic 1. Once the task is run, it will loop over the different sheets and will grid the data accordingly for each formation top.
Graphic 3. Input strings should match the sheet names.
Another case where scripting and looping can lead to the streamline of workflows is where multiple attributes are stored in different columns in a single spreadsheet and you want to grid each of these attributes (Graphic 4).
Graphic 4. Spreadsheet with multiple attributes to be gridded.
Once again in previous versions you had to set individual tasks to grid each of these columns. Now you can set a similar task as the one described above. In this example, instead of scripting the sheet name, the relevant parameter to edit will be the input column (Graphic 5).
Graphic 5. Task Scripting Parameters panel. The scripted column parameter is highlighted.
When you have finished with the script editing, you can save this task in a task file. Now whenever the input data stored in the excel spreadsheet is updated, all you need to do to cascade these updates into your grid is to run the looping tasks (Graphic 6).
Graphic 6. Task list. Save it to run the task again whenever the input data gets updated.
If you want to find out more about workflow scripting and looping workflows, there are several “How to” presentations and short videos under the Learn section in our Client Portal. These resources are available to all users at currently maintained sites. If you have not previously logged into the portal, enter your email address and click where it says ‘I have forgotten or I don’t know my password’. A temporary one will be sent to you.
If you would like to learn more advanced techniques in scripting, we recommend our ‘Workflow Automation and Analysis’ course. This advanced training is a ½ day course which will help to give you a better understanding about scripting and looping in Petrosys!
Alternatively for additional assistance, you can always reach us at email@example.com.