The batching and looping of tasks within a Petrosys workflow allows geoscientists to maximise the use of their time and efforts in the search for oil and gas, by building a task-based workflow that can be looped over time, after time, and that can then be saved and added to at a later time as new details come to hand. To put it into context let’s take a look at the following example.
Let’s assume a user has a huge number of grids in XYZ ASCII format that they want to import into Petrosys grid files.
First, open Surface Modeling, and set the task up as you would normally do for one of the files you want to import.
- Go to File > Import > XYZ ASCII to Grid File (Scan)…
- Point to one of the files and click Scan in the bottom left of the dialog.
- Once you have made sure all the parameters look right, click OK.
The task will run as soon as you click OK if you have the “recalculation” mode set to automatic. If not, run it and make sure the import is successful for this file.
Now you need to set the looping task to import all the files automatically.
- Select your task and go to Workflow > Loop Over Highlighted Tasks… (alternatively, you can select this option by selecting the task and clicking the right mouse button).
- In Loop Paramater and Values, set the Loop Input Type to Files (notice the other input options for looping) and add the files you want to import. Tip: you can add files manually, or add them by using wildcards.
- Define a name for the User defined loop parameter – this parameter will be used in the following step.
Finally, you need to identify and script the relevant parameters in the Import XYZ task. These parameters are InputXYZFile and GridFileName.
- RMB in the Import XYZ task and select Task Parameters…
- RMB in InputXYZFile and select Edit.
- Click on the “+” button.
- Select the looping task from the list and choose the loop parameter defined in the previous step – ie. in this case it is called ‘Zmap_To_Import’. Click OK twice.
- Repeat the procedure for GridFileName, but this time first add a function that will replace the suffix from .asc to .gri in the output – it should look like the example below. Click OK twice.
In Task Scripting Parameters, notice the status for the parameters you scripted. Click OK after checking that all is correct.
Now you are ready to import all the files by running the looping task. Once you run it, it will import each file included in the list into a Petrosys grid.
Remember to save the task for a future occasion!
More info regarding scripting parameters can be found in the Petrosys Online Help. We also have a detailed webinar on our YouTube channel called Workflows and Looping in Petrosys.
Final tip: if you open the Import XYZ task, you’ll notice some parameters are highlighted with a blue margin. This is a quick way to tell which of the parameters have been scripted.