quick-pp 0.1.18__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {quick_pp-0.1.18 → quick_pp-0.2.1}/HISTORY.rst +7 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/PKG-INFO +30 -3
- {quick_pp-0.1.18 → quick_pp-0.2.1}/quick_pp/__init__.py +1 -1
- {quick_pp-0.1.18 → quick_pp-0.2.1}/quick_pp/core_calibration.py +54 -19
- {quick_pp-0.1.18 → quick_pp-0.2.1}/quick_pp/las_handler.py +18 -58
- {quick_pp-0.1.18 → quick_pp-0.2.1}/quick_pp/lithology/carbonate.py +12 -29
- {quick_pp-0.1.18 → quick_pp-0.2.1}/quick_pp/lithology/sand_shale.py +5 -9
- {quick_pp-0.1.18 → quick_pp-0.2.1}/quick_pp/lithology/sand_silt_clay.py +3 -2
- {quick_pp-0.1.18 → quick_pp-0.2.1}/quick_pp/porosity.py +22 -26
- {quick_pp-0.1.18 → quick_pp-0.2.1}/quick_pp/qaqc.py +44 -67
- {quick_pp-0.1.18 → quick_pp-0.2.1}/quick_pp/ressum.py +88 -63
- {quick_pp-0.1.18 → quick_pp-0.2.1}/quick_pp/rock_type.py +114 -25
- {quick_pp-0.1.18 → quick_pp-0.2.1}/quick_pp/saturation.py +22 -21
- {quick_pp-0.1.18 → quick_pp-0.2.1}/quick_pp.egg-info/PKG-INFO +30 -3
- {quick_pp-0.1.18 → quick_pp-0.2.1}/quick_pp.egg-info/SOURCES.txt +1 -1
- quick_pp-0.2.1/quick_pp.egg-info/entry_points.txt +2 -0
- quick_pp-0.2.1/quick_pp.egg-info/requires.txt +15 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/setup.py +15 -12
- quick_pp-0.1.18/quick_pp/plotter.py +0 -747
- quick_pp-0.1.18/quick_pp.egg-info/requires.txt +0 -6
- {quick_pp-0.1.18 → quick_pp-0.2.1}/AUTHORS.rst +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/CONTRIBUTING.rst +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/LICENSE +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/MANIFEST.in +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/README.rst +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/docs/Makefile +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/docs/make.bat +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/docs/source/authors.rst +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/docs/source/conf.py +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/docs/source/contributing.rst +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/docs/source/history.rst +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/docs/source/index.rst +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/docs/source/installation.rst +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/docs/source/quick_pp.lithology.rst +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/docs/source/quick_pp.rst +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/docs/source/usage.rst +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/docs/static/quick_pp_demo.gif +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/quick_pp/config.py +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/quick_pp/fluid_type.py +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/quick_pp/geomechanics.py +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/quick_pp/lithology/__init__.py +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/quick_pp/lithology/multi_mineral.py +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/quick_pp/objects.py +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/quick_pp/permeability.py +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/quick_pp/utils.py +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/quick_pp.egg-info/dependency_links.txt +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/quick_pp.egg-info/not-zip-safe +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/quick_pp.egg-info/top_level.txt +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/setup.cfg +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/tests/__init__.py +0 -0
- {quick_pp-0.1.18 → quick_pp-0.2.1}/tests/test_quick_pp.py +0 -0
|
@@ -56,3 +56,10 @@ History
|
|
|
56
56
|
* Update rock typing module.
|
|
57
57
|
* Add skelt harrison saturation function.
|
|
58
58
|
* Add sensitivity analysis in ressum module.
|
|
59
|
+
|
|
60
|
+
0.2.1 (2025-05-20)
|
|
61
|
+
-------------------
|
|
62
|
+
* Refactor the API module.
|
|
63
|
+
* Add ML modelling module.
|
|
64
|
+
* Add cli using click.
|
|
65
|
+
* Refactor the well log plotter module.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: quick_pp
|
|
3
|
-
Version: 0.1
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Python package to assist in providing quick-look/ preliminary petrophysical estimation.
|
|
5
5
|
Home-page: https://github.com/imranfadhil/quick_pp
|
|
6
6
|
Author: Imran Fadhil
|
|
@@ -12,7 +12,7 @@ Classifier: Intended Audience :: Developers
|
|
|
12
12
|
Classifier: License :: OSI Approved :: MIT License
|
|
13
13
|
Classifier: Natural Language :: English
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
-
Requires-Python: >=3.
|
|
15
|
+
Requires-Python: >=3.10
|
|
16
16
|
License-File: LICENSE
|
|
17
17
|
License-File: AUTHORS.rst
|
|
18
18
|
Requires-Dist: Click>=7.0
|
|
@@ -21,6 +21,26 @@ Requires-Dist: welly
|
|
|
21
21
|
Requires-Dist: pandas
|
|
22
22
|
Requires-Dist: numpy
|
|
23
23
|
Requires-Dist: statsmodels
|
|
24
|
+
Requires-Dist: scikit-learn==1.6.1
|
|
25
|
+
Requires-Dist: mlflow
|
|
26
|
+
Requires-Dist: fastapi
|
|
27
|
+
Requires-Dist: fastapi_mcp
|
|
28
|
+
Requires-Dist: psycopg2-binary
|
|
29
|
+
Requires-Dist: ptitprince
|
|
30
|
+
Requires-Dist: matplotlib==3.8.0
|
|
31
|
+
Requires-Dist: SALib==1.5.1
|
|
32
|
+
Requires-Dist: orjson
|
|
33
|
+
Dynamic: author
|
|
34
|
+
Dynamic: author-email
|
|
35
|
+
Dynamic: classifier
|
|
36
|
+
Dynamic: description
|
|
37
|
+
Dynamic: home-page
|
|
38
|
+
Dynamic: keywords
|
|
39
|
+
Dynamic: license
|
|
40
|
+
Dynamic: license-file
|
|
41
|
+
Dynamic: requires-dist
|
|
42
|
+
Dynamic: requires-python
|
|
43
|
+
Dynamic: summary
|
|
24
44
|
|
|
25
45
|
========
|
|
26
46
|
quick_pp
|
|
@@ -108,3 +128,10 @@ History
|
|
|
108
128
|
* Update rock typing module.
|
|
109
129
|
* Add skelt harrison saturation function.
|
|
110
130
|
* Add sensitivity analysis in ressum module.
|
|
131
|
+
|
|
132
|
+
0.2.1 (2025-05-20)
|
|
133
|
+
-------------------
|
|
134
|
+
* Refactor the API module.
|
|
135
|
+
* Add ML modelling module.
|
|
136
|
+
* Add cli using click.
|
|
137
|
+
* Refactor the well log plotter module.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from scipy.optimize import curve_fit
|
|
2
2
|
import matplotlib.pyplot as plt
|
|
3
3
|
import numpy as np
|
|
4
|
+
import plotly.graph_objects as go
|
|
4
5
|
|
|
5
6
|
from quick_pp.utils import power_law_func, inv_power_law_func
|
|
6
7
|
|
|
@@ -28,6 +29,9 @@ def poroperm_xplot(poro, perm, a=None, b=None, core_group=None, label='', log_lo
|
|
|
28
29
|
log_log (bool, optional): Whether to plot log-log or not. Defaults to False.
|
|
29
30
|
"""
|
|
30
31
|
sc = plt.scatter(poro, perm, marker='.', c=core_group, cmap='Set1')
|
|
32
|
+
if core_group is not None:
|
|
33
|
+
for i, row in enumerate(zip(poro, perm, core_group)):
|
|
34
|
+
plt.annotate(row[2], (row[0], row[1]), fontsize=8, alpha=0.7)
|
|
31
35
|
if a and b:
|
|
32
36
|
line_color = sc.get_facecolors()[0]
|
|
33
37
|
line_color[-1] = 0.5
|
|
@@ -91,7 +95,29 @@ def pc_xplot(sw, pc, label=None, ylim=None):
|
|
|
91
95
|
plt.legend(bbox_to_anchor=(1.04, 1), loc="upper left")
|
|
92
96
|
|
|
93
97
|
|
|
94
|
-
def
|
|
98
|
+
def pc_xplot_plotly(sw, pc, label=None, ylim=None, fig=go.Figure()):
|
|
99
|
+
"""Generate J-Sw cross plot using Plotly.
|
|
100
|
+
|
|
101
|
+
Args:
|
|
102
|
+
sw (float): Core water saturation (frac).
|
|
103
|
+
pc (float): Capillary pressure (psi).
|
|
104
|
+
label (str, optional): Label for the data group. Defaults to ''.
|
|
105
|
+
ylim (tuple, optional): Range for the y axis in (min, max) format. Defaults to None.
|
|
106
|
+
"""
|
|
107
|
+
fig.add_trace(go.Scatter(x=sw, y=pc, name=label))
|
|
108
|
+
fig.update_layout(
|
|
109
|
+
xaxis_title='Sw (frac)',
|
|
110
|
+
yaxis_title='Pc (psi)',
|
|
111
|
+
xaxis_range=[0, 1],
|
|
112
|
+
yaxis_range=[0, 50] if ylim is None else [ylim[0], ylim[1]],
|
|
113
|
+
legend=dict(x=1.04, y=1, traceorder='normal'),
|
|
114
|
+
height=500,
|
|
115
|
+
width=800
|
|
116
|
+
)
|
|
117
|
+
return fig
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
def j_xplot(sw, j, a=None, b=None, core_group=None, label=None, log_log=False, ax=None, ylim=None):
|
|
95
121
|
"""Generate J-Sw cross plot.
|
|
96
122
|
|
|
97
123
|
Args:
|
|
@@ -103,18 +129,25 @@ def j_xplot(sw, j, a=None, b=None, core_group=None, label=None, log_log=False):
|
|
|
103
129
|
ylim (tuple, optional): Range for the y axis in (min, max) format. Defaults to None.
|
|
104
130
|
log_log (bool, optional): Whether to plot log-log or not. Defaults to False.
|
|
105
131
|
"""
|
|
106
|
-
|
|
132
|
+
ax = ax or plt.gca()
|
|
133
|
+
scatter = ax.scatter(sw, j, marker='.', c=core_group, cmap='Set1')
|
|
134
|
+
if core_group is not None:
|
|
135
|
+
legend1 = ax.legend(*scatter.legend_elements(), title="Core Sample")
|
|
136
|
+
ax.add_artist(legend1)
|
|
107
137
|
if a is not None and b is not None:
|
|
108
138
|
csw = np.geomspace(0.01, 1.0, 20)
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
139
|
+
ax.plot(csw, inv_power_law_func(csw, a, b), label=label, linestyle='dashed')
|
|
140
|
+
ax.set_xlabel('Sw (frac)')
|
|
141
|
+
ax.set_xlim(0.01, 1)
|
|
142
|
+
ax.set_ylabel('J')
|
|
143
|
+
ax.set_ylim(ylim) if ylim else ax.set_ylim(0.01, ax.get_lines()[-1].get_ydata().max())
|
|
114
144
|
if log_log:
|
|
115
|
-
|
|
145
|
+
ax.set_yscale('log')
|
|
146
|
+
ax.set_ylim(0.01, 100)
|
|
147
|
+
ax.set_xscale('log')
|
|
116
148
|
if label:
|
|
117
|
-
|
|
149
|
+
ax.legend(bbox_to_anchor=(1.04, 1), loc="upper left")
|
|
150
|
+
return ax
|
|
118
151
|
|
|
119
152
|
|
|
120
153
|
# Best-fit functions
|
|
@@ -138,7 +171,7 @@ def fit_j_curve(sw, j):
|
|
|
138
171
|
return 1, 1
|
|
139
172
|
|
|
140
173
|
|
|
141
|
-
def skelt_harrison_xplot(sw, pc, gw, ghc, a, b, c, d, core_group=None, label=None, ylim=None):
|
|
174
|
+
def skelt_harrison_xplot(sw, pc, gw, ghc, a, b, c, d, core_group=None, label=None, ylim=None, ax=None):
|
|
142
175
|
"""Generate Skelt-Harrison curve.
|
|
143
176
|
|
|
144
177
|
Args:
|
|
@@ -150,15 +183,17 @@ def skelt_harrison_xplot(sw, pc, gw, ghc, a, b, c, d, core_group=None, label=Non
|
|
|
150
183
|
c (float): c constant from the best-fit curve. Related to PTSD.
|
|
151
184
|
d (float): d constant from the best-fit curve. Related to entry pressure.
|
|
152
185
|
"""
|
|
153
|
-
|
|
186
|
+
ax = ax or plt.gca()
|
|
187
|
+
ax.scatter(sw, pc, marker='.', c=core_group, cmap='Set1')
|
|
154
188
|
h = np.geomspace(.01, 10000, 100)
|
|
155
189
|
pci = h * (gw - ghc) * .433 # Convert g/cc to psi/ft
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
190
|
+
ax.plot(skelt_harrison_func(h, a, b, c, d), pci, label=label)
|
|
191
|
+
ax.set_ylabel('Pc (psi)')
|
|
192
|
+
ax.set_ylim(ylim) if ylim else ax.set_ylim(0.01, ax.get_lines()[-1].get_ydata().max())
|
|
193
|
+
ax.set_xlabel('Sw (frac)')
|
|
194
|
+
ax.set_xlim(0, 1)
|
|
195
|
+
ax.legend(bbox_to_anchor=(1.04, 1), loc="upper left")
|
|
196
|
+
return ax
|
|
162
197
|
|
|
163
198
|
|
|
164
199
|
def skelt_harrison_func(h, a, b, c, d):
|
|
@@ -212,7 +247,7 @@ def fit_poroperm_curve(poro, perm):
|
|
|
212
247
|
tuple: a and b constants from the best-fit curve.
|
|
213
248
|
"""
|
|
214
249
|
try:
|
|
215
|
-
popt, _ = curve_fit(power_law_func, poro, perm)
|
|
250
|
+
popt, _ = curve_fit(power_law_func, poro, perm, nan_policy='omit')
|
|
216
251
|
a = [round(c) for c in popt][0]
|
|
217
252
|
b = [round(c, 3) for c in popt][1]
|
|
218
253
|
return a, b
|
|
@@ -234,7 +269,7 @@ def leverett_j(pc, ift, theta, perm, phit):
|
|
|
234
269
|
Returns:
|
|
235
270
|
float: Leverett J value.
|
|
236
271
|
"""
|
|
237
|
-
return 0.
|
|
272
|
+
return 0.21665 * pc / (ift * abs(np.cos(np.radians(theta)))) * (perm / phit)**(0.5)
|
|
238
273
|
|
|
239
274
|
|
|
240
275
|
def pseudo_leverett_j():
|
|
@@ -141,11 +141,11 @@ def read_las_file_mmap(file_object, required_sets=['PEP']): # noqa
|
|
|
141
141
|
return curves_df, header_df, welly_object
|
|
142
142
|
|
|
143
143
|
|
|
144
|
-
def read_las_file_welly(file_object):
|
|
145
|
-
|
|
144
|
+
def read_las_file_welly(file_object):
|
|
145
|
+
welly_dataset = welly.las.from_las(file_object.name)
|
|
146
|
+
well_header = welly_dataset['Header']
|
|
147
|
+
welly_object = welly.well.Well.from_datasets(welly_dataset)
|
|
146
148
|
df = pre_process(welly_object)
|
|
147
|
-
well_header = welly.las.from_las(file_object.name)['Header']
|
|
148
|
-
|
|
149
149
|
return df, well_header
|
|
150
150
|
|
|
151
151
|
|
|
@@ -163,17 +163,27 @@ def pre_process(welly_object):
|
|
|
163
163
|
Returns:
|
|
164
164
|
pd.Dataframe: Processed data.
|
|
165
165
|
"""
|
|
166
|
-
|
|
166
|
+
# Convert index 'DEPTH' as column
|
|
167
|
+
data_df = welly_object.las[0]
|
|
168
|
+
data_df.index.rename('DEPTH', inplace=True)
|
|
169
|
+
data_df = data_df.reset_index(drop=False)
|
|
167
170
|
|
|
168
171
|
header_df = welly_object.header
|
|
169
172
|
nullValue = header_df[header_df['mnemonic'] == 'NULL']['value'].values[0] if \
|
|
170
173
|
header_df[header_df['mnemonic'] == 'NULL']['value'].values else -999.25
|
|
171
174
|
data_df = data_df.where(data_df >= nullValue, np.nan)
|
|
172
|
-
|
|
175
|
+
# Insert well name
|
|
173
176
|
well_name = header_df[
|
|
174
|
-
(header_df['mnemonic'] == 'WELL') | (header_df['descr'].str.upper() == 'WELL')
|
|
177
|
+
(header_df['mnemonic'] == 'WELL') | (header_df['descr'].str.upper() == 'WELL')
|
|
178
|
+
]['value'].values[0]
|
|
175
179
|
if 'WELL_NAME' not in data_df.columns:
|
|
176
180
|
data_df.insert(0, 'WELL_NAME', well_name)
|
|
181
|
+
# Insert UWI if available
|
|
182
|
+
if 'UWI' in header_df['mnemonic'].values:
|
|
183
|
+
uwi = header_df[
|
|
184
|
+
(header_df['mnemonic'] == 'UWI') | (header_df['descr'].str.upper() == 'UNIQUE WELL ID')
|
|
185
|
+
]['value'].values[0]
|
|
186
|
+
data_df.insert(0, 'UWI', uwi)
|
|
177
187
|
|
|
178
188
|
return data_df
|
|
179
189
|
|
|
@@ -278,55 +288,6 @@ def check_index_consistent(welly_object):
|
|
|
278
288
|
return False
|
|
279
289
|
|
|
280
290
|
|
|
281
|
-
def resample_depth(welly_object, step_depth=0.5):
|
|
282
|
-
"""Convert m to ft and resample DEPTH to feet with 0.5 step
|
|
283
|
-
|
|
284
|
-
Args:
|
|
285
|
-
welly_object (object): Welly object
|
|
286
|
-
step_depth (float, optional): Defaults to 0.5
|
|
287
|
-
|
|
288
|
-
Returns:
|
|
289
|
-
pd.DataFrame: Resampled dataframe
|
|
290
|
-
"""
|
|
291
|
-
if check_index_consistent(welly_object):
|
|
292
|
-
for i, curve_name in enumerate(list(welly_object.data.keys())):
|
|
293
|
-
pre_curve = welly_object.data[curve_name]
|
|
294
|
-
if pre_curve.index_units and pre_curve.index_units.lower() in ['metres', 'm']:
|
|
295
|
-
pre_curve.df.index = welly.well._convert_depth_index_units(
|
|
296
|
-
pre_curve.index, unit_from='m', unit_to='ft')
|
|
297
|
-
pre_curve.index_units = 'ft'
|
|
298
|
-
|
|
299
|
-
# Set new start if not 0.5
|
|
300
|
-
new_start = pre_curve.start
|
|
301
|
-
if np.mod(new_start, 0.5) != 0:
|
|
302
|
-
new_start = np.round((new_start * 2)) / 2
|
|
303
|
-
|
|
304
|
-
# Set the new stop of depth.
|
|
305
|
-
new_stop = pre_curve.start + (
|
|
306
|
-
step_depth * np.ceil((pre_curve.stop - pre_curve.start) / step_depth)
|
|
307
|
-
)
|
|
308
|
-
new_curve = pre_curve.to_basis(start=new_start, stop=new_stop, step=step_depth)
|
|
309
|
-
new_curve = pd.DataFrame(new_curve.values, index=new_curve.index.values, columns=[curve_name])
|
|
310
|
-
# Create new dataframe when first loop.
|
|
311
|
-
if i == 0:
|
|
312
|
-
new_clips_df = pd.DataFrame(new_curve.values, index=new_curve.index.values, columns=[curve_name])
|
|
313
|
-
# Merge new dataframe with the previous loop.
|
|
314
|
-
else:
|
|
315
|
-
new_curve_df = pd.DataFrame(new_curve.values, index=new_curve.index.values, columns=[curve_name])
|
|
316
|
-
new_clips_df = pd.merge(new_clips_df, new_curve_df, left_index=True, right_index=True)
|
|
317
|
-
|
|
318
|
-
return_df = new_clips_df.copy()
|
|
319
|
-
|
|
320
|
-
else:
|
|
321
|
-
return_df = welly_object.las[0]
|
|
322
|
-
|
|
323
|
-
# Convert index 'DEPTH' as column
|
|
324
|
-
if "DEPTH" in return_df.columns:
|
|
325
|
-
return_df.set_index('DEPTH', inplace=True)
|
|
326
|
-
return_df.index.rename('DEPTH', inplace=True)
|
|
327
|
-
return return_df.reset_index(drop=False)
|
|
328
|
-
|
|
329
|
-
|
|
330
291
|
def export_to_las(well_data, well_name, folder=''):
|
|
331
292
|
"""Export dataframe to las file. Expecting a DEPTH column in meters unit.
|
|
332
293
|
|
|
@@ -353,8 +314,7 @@ if __name__ == '__main__':
|
|
|
353
314
|
|
|
354
315
|
root = Tk()
|
|
355
316
|
file_objects = filedialog.askopenfiles(title='Choose well Log ASCII Standard (LAS) files to be combined',
|
|
356
|
-
|
|
357
|
-
multiple=True,
|
|
317
|
+
filetypes=(('LAS Files', '*.LAS *.las'), ('All Files', '*.*')),
|
|
358
318
|
mode='rb')
|
|
359
319
|
root.destroy()
|
|
360
320
|
if file_objects:
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import numpy as np
|
|
2
2
|
|
|
3
3
|
from quick_pp.utils import length_a_b, line_intersection
|
|
4
|
-
from quick_pp.porosity import neu_den_xplot_poro_pt, rho_matrix, density_porosity
|
|
5
|
-
from quick_pp.rock_type import estimate_vsh_gr
|
|
6
4
|
from quick_pp.config import Config
|
|
7
5
|
|
|
8
6
|
|
|
@@ -17,22 +15,20 @@ class Carbonate:
|
|
|
17
15
|
self.dry_clay_point = dry_clay_point or Config.CARB_NEU_DEN_ENDPOINTS["DRY_CLAY_POINT"]
|
|
18
16
|
self.fluid_point = fluid_point or Config.CARB_NEU_DEN_ENDPOINTS["FLUID_POINT"]
|
|
19
17
|
|
|
20
|
-
def estimate_lithology(self, nphi, rhob,
|
|
21
|
-
|
|
18
|
+
def estimate_lithology(self, nphi, rhob, pef=None, vsh_gr=None, model: str = 'single',
|
|
19
|
+
method: str = 'neu_den', carbonate_type: str = 'limestone'):
|
|
22
20
|
"""Estimate sand silt clay lithology volumetrics.
|
|
23
21
|
|
|
24
22
|
Args:
|
|
25
|
-
gr (float): Gamma Ray log in API
|
|
26
23
|
nphi (float): Neutron Porosity log in v/v
|
|
27
24
|
rhob (float): Bulk Density log in g/cc
|
|
28
25
|
pef (float, optional): Photoelectric Factor log in barns/electron. Defaults to [0].
|
|
26
|
+
vsh_gr (float, optional): Volume of shale from gamma ray log in v/v. Defaults to None.
|
|
29
27
|
model (str, optional): Model to choose from 'single' or 'double'. Defaults to 'single'.
|
|
30
28
|
method (str, optional): Method for 2 minerals model, to choose from 'neu_den' or 'den_pef'.
|
|
31
29
|
Defaults to 'neu_den'.
|
|
32
30
|
carbonate_type (str, optional): Carbonate type to choose from 'limestone' or 'dolostone'.
|
|
33
31
|
Defaults to 'limestone'.
|
|
34
|
-
xplot (bool, optional): To plot Neutron Density cross plot. Defaults to False.
|
|
35
|
-
normalize (bool, optional): To normalize with porosity. Defaults to True.
|
|
36
32
|
|
|
37
33
|
Returns:
|
|
38
34
|
(float, float, float): vcld, vcalc, vdolo
|
|
@@ -40,34 +36,25 @@ class Carbonate:
|
|
|
40
36
|
assert model in ['single', 'double'], f"'{model}' model is not available."
|
|
41
37
|
assert method in ['neu_den', 'den_pef'], f"'{method}' method is not available."
|
|
42
38
|
|
|
43
|
-
vcld = vsh_gr if vsh_gr is not None else
|
|
39
|
+
vcld = vsh_gr if vsh_gr is not None else np.zeros(len(nphi))
|
|
44
40
|
if model == 'single':
|
|
45
41
|
# Estimate vshale
|
|
46
42
|
vcarb = 1 - vcld
|
|
47
43
|
vdolo = vcarb if carbonate_type == 'dolostone' else 0
|
|
48
44
|
vcalc = vcarb if carbonate_type == 'limestone' else 0
|
|
49
|
-
if normalize:
|
|
50
|
-
# Estimate total porosity
|
|
51
|
-
rho_ma = rho_matrix(vcalc=vcalc, vdolo=vdolo, vclay=vcld)
|
|
52
|
-
phit = density_porosity(rhob, rho_ma)
|
|
53
|
-
vmatrix = (1 - phit)
|
|
54
|
-
vcalc = vcalc * vmatrix
|
|
55
|
-
vdolo = vdolo * vmatrix
|
|
56
|
-
vcld = vcld * vmatrix
|
|
57
45
|
return vcld, vcalc, vdolo
|
|
58
46
|
elif model == 'double':
|
|
59
47
|
# Estimate vshale
|
|
60
48
|
if method == 'neu_den':
|
|
61
|
-
vcalc, vdolo = self.lithology_fraction_neu_den(nphi, rhob, model='double'
|
|
49
|
+
vcalc, vdolo = self.lithology_fraction_neu_den(nphi, rhob, model='double')
|
|
62
50
|
else:
|
|
63
51
|
assert pef is not None, "PEF log is required for 'den_pef' method."
|
|
64
|
-
vcalc, vdolo = self.lithology_fraction_pef(pef, rhob
|
|
52
|
+
vcalc, vdolo = self.lithology_fraction_pef(pef, rhob)
|
|
65
53
|
vcalc = vcalc * (1 - vcld)
|
|
66
54
|
vdolo = vdolo * (1 - vcld)
|
|
67
55
|
return vcld, vcalc, vdolo
|
|
68
56
|
|
|
69
|
-
def lithology_fraction_neu_den(self, nphi, rhob, model: str = 'single', carbonate_type: str = 'limestone'
|
|
70
|
-
normalize: bool = True):
|
|
57
|
+
def lithology_fraction_neu_den(self, nphi, rhob, model: str = 'single', carbonate_type: str = 'limestone'):
|
|
71
58
|
"""Estimate clay and carbonate (either limestone or dolostone) based on neutron density cross plot.
|
|
72
59
|
|
|
73
60
|
Args:
|
|
@@ -96,14 +83,12 @@ class Carbonate:
|
|
|
96
83
|
projlithofrac = length_a_b(var_pt, A)
|
|
97
84
|
vfrac = projlithofrac / rocklithofrac
|
|
98
85
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
vlitho1 = np.append(vlitho1, (1 - vfrac) * vmatrix)
|
|
102
|
-
vlitho2 = np.append(vlitho2, vfrac * vmatrix)
|
|
86
|
+
vlitho1 = np.append(vlitho1, (1 - vfrac))
|
|
87
|
+
vlitho2 = np.append(vlitho2, vfrac)
|
|
103
88
|
|
|
104
89
|
return vlitho1, vlitho2
|
|
105
90
|
|
|
106
|
-
def lithology_fraction_pef(self, pef, rhob
|
|
91
|
+
def lithology_fraction_pef(self, pef, rhob):
|
|
107
92
|
"""Estimate limestone and dolostone based on pef density cross plot. Expecting the inputs are clay corrected.
|
|
108
93
|
|
|
109
94
|
Args:
|
|
@@ -126,10 +111,8 @@ class Carbonate:
|
|
|
126
111
|
projlithofrac = length_a_b(var_pt, A)
|
|
127
112
|
dolo_frac = projlithofrac / rocklithofrac
|
|
128
113
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
vcalc = np.append(vcalc, (1 - dolo_frac) * vmatrix)
|
|
132
|
-
vdolo = np.append(vdolo, dolo_frac * vmatrix)
|
|
114
|
+
vcalc = np.append(vcalc, (1 - dolo_frac))
|
|
115
|
+
vdolo = np.append(vdolo, dolo_frac)
|
|
133
116
|
|
|
134
117
|
return vcalc, vdolo
|
|
135
118
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import numpy as np
|
|
2
2
|
|
|
3
3
|
from quick_pp.utils import min_max_line, length_a_b, line_intersection
|
|
4
|
-
from quick_pp.porosity import neu_den_xplot_poro_pt
|
|
5
4
|
from quick_pp.config import Config
|
|
6
5
|
|
|
7
6
|
|
|
@@ -9,7 +8,7 @@ class SandShale:
|
|
|
9
8
|
"""This binary model only consider a combination of sand-shale components. """
|
|
10
9
|
|
|
11
10
|
def __init__(self, dry_sand_point: tuple = None, dry_clay_point: tuple = None,
|
|
12
|
-
fluid_point: tuple = None, wet_clay_point: tuple = None, silt_line_angle: float = None):
|
|
11
|
+
fluid_point: tuple = None, wet_clay_point: tuple = None, silt_line_angle: float = None, **kwargs):
|
|
13
12
|
# Initialize the endpoints
|
|
14
13
|
self.dry_sand_point = dry_sand_point or Config.SSC_ENDPOINTS["DRY_SAND_POINT"]
|
|
15
14
|
self.dry_clay_point = dry_clay_point or Config.SSC_ENDPOINTS["DRY_CLAY_POINT"]
|
|
@@ -68,16 +67,13 @@ class SandShale:
|
|
|
68
67
|
E = list(zip(nphi, rhob))
|
|
69
68
|
rocklithofrac = length_a_b(A, C)
|
|
70
69
|
|
|
71
|
-
vsand =
|
|
72
|
-
vcld =
|
|
70
|
+
vsand = np.empty(0)
|
|
71
|
+
vcld = np.empty(0)
|
|
73
72
|
for i, point in enumerate(E):
|
|
74
73
|
var_pt = line_intersection((A, C), (D, point))
|
|
75
74
|
projlithofrac = length_a_b(var_pt, A)
|
|
76
75
|
vshale = projlithofrac / rocklithofrac
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
vmatrix = 1 - phit
|
|
80
|
-
vsand.append((1 - vshale) * vmatrix)
|
|
81
|
-
vcld.append(vshale * vmatrix)
|
|
76
|
+
vsand = np.append(vsand, (1 - vshale))
|
|
77
|
+
vcld = np.append(vcld, vshale)
|
|
82
78
|
|
|
83
79
|
return vsand, vcld
|
|
@@ -14,8 +14,9 @@ class SandSiltClay:
|
|
|
14
14
|
This module is modified based on Kuttan, where the reservoir sections consist of combination of sand-silt-clay
|
|
15
15
|
while non-reservoir sections remain a combination of silt-clay only."""
|
|
16
16
|
|
|
17
|
-
def __init__(self, dry_sand_point: tuple =
|
|
18
|
-
|
|
17
|
+
def __init__(self, dry_sand_point: tuple = (float, float), dry_silt_point: tuple = (float, float),
|
|
18
|
+
dry_clay_point: tuple = (float, float), fluid_point: tuple = (float, float),
|
|
19
|
+
wet_clay_point: tuple = (float, float), silt_line_angle: float = 0, **kwargs):
|
|
19
20
|
# Initialize the endpoints
|
|
20
21
|
self.dry_sand_point = dry_sand_point or Config.SSC_ENDPOINTS["DRY_SAND_POINT"]
|
|
21
22
|
self.dry_silt_point = dry_silt_point or Config.SSC_ENDPOINTS["DRY_SILT_POINT"]
|
|
@@ -4,25 +4,21 @@ from quick_pp.config import Config
|
|
|
4
4
|
from quick_pp.utils import length_a_b, line_intersection
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
def normalize_volumetric(
|
|
8
|
-
"""Normalize lithology
|
|
7
|
+
def normalize_volumetric(phit, **volumetrics):
|
|
8
|
+
"""Normalize lithology given total porosity.
|
|
9
9
|
|
|
10
10
|
Args:
|
|
11
|
-
vsand (float): Volume of sand in fraction (v/v).
|
|
12
|
-
vsilt (float): Volume of silt in fraction (v/v).
|
|
13
|
-
vclay (float): Volume of clay in fraction (v/v).
|
|
14
11
|
phit (float): Total porosity in fraction (v/v).
|
|
12
|
+
**volumetrics: Keyword arguments representing volumetric fractions (v/v).
|
|
15
13
|
|
|
16
14
|
Returns:
|
|
17
|
-
|
|
15
|
+
dict: Normalized volumetric fractions.
|
|
18
16
|
"""
|
|
19
17
|
# Normalize the volumetrics
|
|
20
18
|
vmatrix = 1 - phit
|
|
21
|
-
|
|
22
|
-
vsilt = vsilt * vmatrix
|
|
23
|
-
vclay = vclay * vmatrix
|
|
19
|
+
normalized_volumetrics = {key: value * vmatrix for key, value in volumetrics.items()}
|
|
24
20
|
|
|
25
|
-
return
|
|
21
|
+
return normalized_volumetrics
|
|
26
22
|
|
|
27
23
|
|
|
28
24
|
def effective_porosity(phit, phi_shale, vshale):
|
|
@@ -47,7 +43,7 @@ def effective_porosity(phit, phi_shale, vshale):
|
|
|
47
43
|
return phit - (vshale * phi_shale)
|
|
48
44
|
|
|
49
45
|
|
|
50
|
-
def clay_porosity(rho_clw: np.
|
|
46
|
+
def clay_porosity(rho_clw: np.ndarray, rho_dry_clay: float = 2.72, rho_fluid: float = 1.0):
|
|
51
47
|
"""Calculate clay porosity given bulk density of wet clay line.
|
|
52
48
|
|
|
53
49
|
Args:
|
|
@@ -58,7 +54,6 @@ def clay_porosity(rho_clw: np.array, rho_dry_clay: float = 2.72, rho_fluid: floa
|
|
|
58
54
|
Returns:
|
|
59
55
|
float: Clay porosity.
|
|
60
56
|
"""
|
|
61
|
-
rho_dry_clay = rho_dry_clay or Config.SSC_ENDPOINTS["DRY_CLAY_POINT"][1]
|
|
62
57
|
return (rho_dry_clay - rho_clw) / (rho_dry_clay - rho_fluid)
|
|
63
58
|
|
|
64
59
|
|
|
@@ -83,8 +78,8 @@ def shale_porosity(vshale, phi_shale):
|
|
|
83
78
|
|
|
84
79
|
|
|
85
80
|
def rho_matrix(vsand=0, vsilt=0, vclay=0, vcalc=0, vdolo=0, vheavy=0,
|
|
86
|
-
rho_sand: float =
|
|
87
|
-
rho_calc: float =
|
|
81
|
+
rho_sand: float = 0, rho_silt: float = 0, rho_clay: float = 0,
|
|
82
|
+
rho_calc: float = 0, rho_dolo: float = 0, rho_heavy: float = 0):
|
|
88
83
|
"""Estimate average matrix density based on dry sand, dry silt, dry clay, dry calcite and
|
|
89
84
|
dry dolomite volume and density of each.
|
|
90
85
|
|
|
@@ -130,8 +125,8 @@ def density_porosity(rhob, rho_matrix, rho_fluid: float = 1.0):
|
|
|
130
125
|
|
|
131
126
|
|
|
132
127
|
def dt_matrix(vsand=0, vsilt=0, vclay=0, vcalc=0, vdolo=0, vheavy=0,
|
|
133
|
-
dt_sand: float =
|
|
134
|
-
dt_calc: float =
|
|
128
|
+
dt_sand: float = 0, dt_silt: float = 0, dt_clay: float = 0,
|
|
129
|
+
dt_calc: float = 0, dt_dolo: float = 0, dt_heavy: float = 0):
|
|
135
130
|
"""Estimate average matrix sonic transit time based on dry sand, dry silt dry calcite and
|
|
136
131
|
dry dolomite volume and transit time of each.
|
|
137
132
|
|
|
@@ -183,7 +178,7 @@ def sonic_porosity_wyllie(dt, dt_matrix, dt_fluid):
|
|
|
183
178
|
return (dt - dt_matrix) / (dt_fluid - dt_matrix)
|
|
184
179
|
|
|
185
180
|
|
|
186
|
-
def sonic_porosity_hunt_raymer(dt, dt_matrix,
|
|
181
|
+
def sonic_porosity_hunt_raymer(dt, dt_matrix, dt_fluid):
|
|
187
182
|
"""
|
|
188
183
|
Computes sonic porosity based on Hunt-Raymer's equation from interval, matrix and transit time.
|
|
189
184
|
|
|
@@ -193,8 +188,8 @@ def sonic_porosity_hunt_raymer(dt, dt_matrix, c):
|
|
|
193
188
|
Interval transit time [us/ft].
|
|
194
189
|
dt_matrix : float
|
|
195
190
|
Matrix transit time [us/ft]. Sandstone: 51-55, Limestone: 43-48, Dolomite: 43-39, Shale: 60-170.
|
|
196
|
-
|
|
197
|
-
|
|
191
|
+
dt_fluid : float
|
|
192
|
+
Fluid transit time [us/ft]. Water: 190, Oil: 240, Gas: 630.
|
|
198
193
|
|
|
199
194
|
Returns
|
|
200
195
|
-------
|
|
@@ -202,14 +197,15 @@ def sonic_porosity_hunt_raymer(dt, dt_matrix, c):
|
|
|
202
197
|
Sonic porosity [fraction].
|
|
203
198
|
|
|
204
199
|
"""
|
|
205
|
-
|
|
200
|
+
c = (dt_matrix / (2 * dt_fluid)) - 1
|
|
201
|
+
return - c - (c**2 + (dt_matrix / dt) - 1)**0.5
|
|
206
202
|
|
|
207
203
|
|
|
208
204
|
def neu_den_xplot_poro_pt(
|
|
209
205
|
nphi: float, rhob: float, model: str = 'ssc',
|
|
210
|
-
dry_min1_point: tuple =
|
|
211
|
-
dry_silt_point: tuple =
|
|
212
|
-
dry_clay_point: tuple =
|
|
206
|
+
dry_min1_point: tuple = (),
|
|
207
|
+
dry_silt_point: tuple = (),
|
|
208
|
+
dry_clay_point: tuple = (),
|
|
213
209
|
fluid_point: tuple = (1.0, 1.0)):
|
|
214
210
|
"""Calculate porosity given a pair of neutron porosity and bulk density data point.
|
|
215
211
|
|
|
@@ -262,9 +258,9 @@ def neu_den_xplot_poro_pt(
|
|
|
262
258
|
|
|
263
259
|
|
|
264
260
|
def neu_den_xplot_poro(nphi, rhob, model: str = 'ssc',
|
|
265
|
-
dry_min1_point: tuple =
|
|
266
|
-
dry_silt_point: tuple =
|
|
267
|
-
dry_clay_point: tuple =
|
|
261
|
+
dry_min1_point: tuple = (),
|
|
262
|
+
dry_silt_point: tuple = (),
|
|
263
|
+
dry_clay_point: tuple = (),
|
|
268
264
|
fluid_point: tuple = (1.0, 1.0)):
|
|
269
265
|
"""Calculate porosity given neutron porosity and bulk density logs.
|
|
270
266
|
|