Python Tool Pro - Plotting surface data#

Connect to Python Tool Pro

from cegalprizm.pythontool import PetrelConnection
ptp = PetrelConnection(allow_experimental=True)

Select the surface by name

name = 'Input/Gullfaks Input/Surfaces/T_Etive'
surface = ptp.surfaces[name]
surface_attributes_list = list(surface.surface_attributes)

Find the porosity attribute for the surface

surface_attribute=next(attribute for attribute in surface_attributes_list if attribute.petrel_name=="Porosity")

Create a dataframe from the surface attribute


df = surface_attribute.all().as_dataframe()

Set the dataframe name attribute and print the head of the dataframe.

The dataframe contains only I, J, K and Value columns.

I J K Value
0 0 0 None NaN
1 0 1 None NaN
2 0 2 None NaN
3 0 3 None NaN
4 0 4 None NaN

Import CegalPrizm Investigator and connect to Investigator

import cegalprizm.investigator as investigator
from cegalprizm.investigator import InvestigatorConnection
from cegalprizm.investigator.views import *

invconnection = InvestigatorConnection(use_licensed_features=True)

Create a continuous value object describing the surface attribute data

This is used by Investigator to identify the values as seismic data and the min/max values to be used when plotting

from cegalprizm.investigator import get_continuous_value_info

continuous_names = ['Value']
continuous_info = { 'Value': get_continuous_value_info(surface_attribute) }

Create a new investigation from the dataframe containing the surface attribute data

inv = invconnection.investigation_from_dataframe(df, continuous_column_names=continuous_names, continuous_column_info=continuous_info,  sample_index_column_names=["I", "J"])

Create a seismic line view from the investigation and plot it

view = MapView(inv)
[ ]: