Cegal Prizm Python Tool Pro - Sequence identifier#
Identify fining up, coarsening up or blocky sequences within reservoir sands#
The purpose of this tutorial is to show how simple it is to pick up data from a Petrel project, define a simple logic or algorithm based workflow of your own design that is unavailable in Petrel and write the output back to your project.
Import modules#
[ ]:
from cegalprizm.pythontool import PetrelConnection
from cegalprizm.pythontool.welllog import WellLog, DiscreteWellLog
from cegal.welltools.plotting import CegalWellPlotter as cwp
import pandas as pd
import numpy as np
from scipy.stats import linregress
import plotly.express as px
Connect to Petrel project#
[7]:
petrel = PetrelConnection()
print('Connected to {}'.format(petrel.get_current_project_name()))
Connected to Gullfaks_dataset2.pet
Access well data#
we can use the petrel connection “Petrel” python object and the wells method to find which wells are available in the project and turn this to a python list
then we can access the 3rd well in this list using list indexing [2]
finally we can do some list comprehension to find the gamma ray log
[8]:
list_of_well_paths = list(petrel.wells.keys())
print(list_of_well_paths)
['Input/Wells/Injectors/C3', 'Input/Wells/Injectors/C2', 'Input/Wells/Producers/B8', 'Input/Wells/Producers/A10', 'Input/Wells/Producers/A15', 'Input/Wells/Injectors/C6', 'Input/Wells/Injectors/C4', 'Input/Wells/Producers/A16', 'Input/Wells/Injectors/C5', 'Input/Wells/Producers/B9']
[10]:
well = petrel.wells[list_of_well_paths[5]]
print(well)
Well(petrel_name="C6")
[11]:
gamma = [log for log in well.logs if type(log) is WellLog and 'Gamma' in str(log)][0]
gamma
[11]:
WellLog(petrel_name="Gamma")
Creating a dataframe of our well log#
this is simple and uses the logs_dataframe method on our well objectusing the welllog object called gamma
the dataframe includes the log (in this case GR), MD, TWT and TVD as columns
[12]:
logs_df = well.logs_dataframe(gamma)
logs_df
[12]:
Gamma | MD | TWT | TVD | |
---|---|---|---|---|
0 | 81.027946 | 1877.2223 | 1779.021825 | 1876.858053 |
1 | 85.427429 | 1877.7223 | 1779.495470 | 1877.357739 |
2 | 88.121590 | 1878.2223 | 1779.969411 | 1877.857736 |
3 | 88.684662 | 1878.7223 | 1780.443351 | 1878.357733 |
4 | 88.200562 | 1879.2223 | 1780.917291 | 1878.857729 |
... | ... | ... | ... | ... |
1185 | 85.349678 | 2469.7223 | 2161.390165 | 2422.068200 |
1186 | 85.691147 | 2470.2223 | 2161.670309 | 2422.485010 |
1187 | 84.015839 | 2470.7223 | 2161.950453 | 2422.901820 |
1188 | 80.894783 | 2471.2223 | 2162.230598 | 2423.318630 |
1189 | 75.967026 | 2471.7223 | 2162.510742 | 2423.735440 |
1190 rows × 4 columns
Quick visualization#
we can quickly visualise the data using plotly and a histogram (note you can zoom in and navigate around the plot interactively)
[13]:
fig = px.histogram(logs_df, x=gamma.petrel_name)
fig.show()