Python Tool Pro - Plotting surface data#

Connect to Python Tool Pro

[2]:
from cegalprizm.pythontool import PetrelConnection
ptp = PetrelConnection(allow_experimental=True)

Select the surface by name

[3]:
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

[4]:
surface_attribute=next(attribute for attribute in surface_attributes_list if attribute.petrel_name=="Porosity")

Create a dataframe from the surface attribute

[6]:

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.

[8]:
df.name=name
df.head()
[8]:
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

[10]:
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

[12]:
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

[15]:
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

[16]:
view = MapView(inv)
investigator.plot(view)
[16]:
../../../../../_images/products_Investigator_Workbooks_Tutorials_PTP_Surfaces_18_0.png
[ ]: