quick-pp 0.2.60__tar.gz → 0.2.62__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.2.60 → quick_pp-0.2.62}/PKG-INFO +1 -1
- {quick_pp-0.2.60 → quick_pp-0.2.62}/pyproject.toml +1 -1
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/__init__.py +1 -1
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/core_calibration.py +52 -32
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/plotter/well_log.py +12 -9
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/rock_type.py +9 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/saturation.py +10 -1
- {quick_pp-0.2.60 → quick_pp-0.2.62}/.gitignore +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/LICENSE +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/README.md +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/__init__.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/exceptions.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/fastapi_mlflow/__init__.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/fastapi_mlflow/_mlflow_types.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/fastapi_mlflow/applications.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/fastapi_mlflow/exceptions.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/fastapi_mlflow/predictors.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/main.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/mlflow_model_deployment.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/router.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/schemas/lithology_hc_correction.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/schemas/lithology_ssc.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/schemas/lithology_vsh_gr.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/schemas/permeability_choo.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/schemas/permeability_others.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/schemas/porosity.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/schemas/ressum.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/schemas/saturation_archie.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/schemas/saturation_b.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/schemas/saturation_qv.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/schemas/saturation_rw.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/schemas/saturation_temp_grad.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/schemas/saturation_waxman_smits.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/services/chat.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/services/las_handler.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/services/lithology.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/services/permeability.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/services/porosity.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/services/reservoir_summary.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/services/saturation.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/static/favicon.ico +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/static/logo.png +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/template/chat.html +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/api/template/home.html +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/cli.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/config.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/fluid_type.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/las_handler.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/lithology/__init__.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/lithology/carbonate.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/lithology/multi_mineral.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/lithology/sand_shale.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/lithology/sand_silt_clay.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/lithology/thin_beds.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/machine_learning/__init__.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/machine_learning/config.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/machine_learning/feature_engineering.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/machine_learning/mock_data/mock_data.parquet +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/machine_learning/predict_pipeline.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/machine_learning/train_pipeline.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/machine_learning/utils.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/objects.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/permeability.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/plotter/__init__.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/plotter/plotter.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/plotter/well_log_config.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/porosity.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/qaqc.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/ressum.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/rock_physics/__init__.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/rock_physics/geomechanics.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/rock_physics/geophysics.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/rock_physics/rpm.py +0 -0
- {quick_pp-0.2.60 → quick_pp-0.2.62}/quick_pp/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: quick-pp
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.62
|
|
4
4
|
Summary: Python package to assist in providing quick-look/ preliminary petrophysical estimation.
|
|
5
5
|
Project-URL: Homepage, https://github.com/imranfadhil/quick_pp
|
|
6
6
|
Author-email: Imran Fadhil <imranfadhil@gmail.com>
|
|
@@ -20,4 +20,4 @@ logging.getLogger("mlflow").setLevel(logging.WARNING)
|
|
|
20
20
|
|
|
21
21
|
__author__ = """Imran Fadhil"""
|
|
22
22
|
__email__ = 'imranfadhil@gmail.com'
|
|
23
|
-
__version__ = '0.2.
|
|
23
|
+
__version__ = '0.2.62' # Need to be updated manually when releasing a new version/ change in pyproject.toml
|
|
@@ -3,7 +3,6 @@ import matplotlib.pyplot as plt
|
|
|
3
3
|
import numpy as np
|
|
4
4
|
import plotly.graph_objects as go
|
|
5
5
|
from tqdm import tqdm
|
|
6
|
-
from dtw import dtw
|
|
7
6
|
import pandas as pd
|
|
8
7
|
|
|
9
8
|
from quick_pp.utils import power_law_func, inv_power_law_func
|
|
@@ -202,6 +201,25 @@ def skelt_harrison_xplot(sw, pc, gw, ghc, a, b, c, d, core_group=None, label=Non
|
|
|
202
201
|
|
|
203
202
|
|
|
204
203
|
def skelt_harrison_func(h, a, b, c, d):
|
|
204
|
+
"""Calculate water saturation using the Skelt-Harrison model.
|
|
205
|
+
|
|
206
|
+
This function models the relationship between water saturation and the height
|
|
207
|
+
above the free water level using an exponential decay function.
|
|
208
|
+
|
|
209
|
+
Args:
|
|
210
|
+
h (float or np.array): Height above free water level (ft).
|
|
211
|
+
a (float): A constant related to irreducible water saturation (Swirr).
|
|
212
|
+
It influences the maximum water saturation.
|
|
213
|
+
b (float): A constant related to the height above free water level (HAFWL).
|
|
214
|
+
It controls the rate of saturation change with height.
|
|
215
|
+
c (float): A constant related to the pore throat size distribution (PTSD).
|
|
216
|
+
It affects the shape of the saturation curve.
|
|
217
|
+
d (float): A constant related to the entry pressure. It shifts the curve
|
|
218
|
+
along the height axis.
|
|
219
|
+
|
|
220
|
+
Returns:
|
|
221
|
+
float or np.array: The calculated water saturation (fraction).
|
|
222
|
+
"""
|
|
205
223
|
return 1 - a * np.exp(-(b / (h + d))**c)
|
|
206
224
|
|
|
207
225
|
|
|
@@ -277,21 +295,6 @@ def leverett_j(pc, ift, theta, perm, phit):
|
|
|
277
295
|
return 0.21665 * pc / (ift * abs(np.cos(np.radians(theta)))) * (perm / phit)**(0.5)
|
|
278
296
|
|
|
279
297
|
|
|
280
|
-
def pseudo_leverett_j():
|
|
281
|
-
"""TODO: Generate Pseudo-Leverett J based.
|
|
282
|
-
|
|
283
|
-
Args:
|
|
284
|
-
pc (float): Capillary pressure.
|
|
285
|
-
ift (float): Interfacial tension.
|
|
286
|
-
perm (float): Permeability.
|
|
287
|
-
phit (float): Total porosity.
|
|
288
|
-
|
|
289
|
-
Returns:
|
|
290
|
-
float: Pseudo-Leverett J function.
|
|
291
|
-
"""
|
|
292
|
-
pass
|
|
293
|
-
|
|
294
|
-
|
|
295
298
|
def sw_skelt_harrison(depth, fwl, a, b, c, d):
|
|
296
299
|
"""Estimate water saturation based on Skelt-Harrison.
|
|
297
300
|
|
|
@@ -306,10 +309,26 @@ def sw_skelt_harrison(depth, fwl, a, b, c, d):
|
|
|
306
309
|
Returns:
|
|
307
310
|
float: Water saturation.
|
|
308
311
|
"""
|
|
309
|
-
h = fwl - depth
|
|
312
|
+
h = (fwl - depth).clip(0)
|
|
310
313
|
return skelt_harrison_func(h, a, b, c, d)
|
|
311
314
|
|
|
312
315
|
|
|
316
|
+
def sw_lambda(phit, h, a, b, lamda):
|
|
317
|
+
"""Estimate water saturation based on Lambda model (Thomeer-type Hyperbolic).
|
|
318
|
+
|
|
319
|
+
Args:
|
|
320
|
+
phit (float): Total porosity in fraction.
|
|
321
|
+
h (float): Height above free water level.
|
|
322
|
+
a (float): A constant from the best-fit curve.
|
|
323
|
+
b (float): B constant from the best-fit curve.
|
|
324
|
+
lamda (float): Lambda constant from the best-fit curve, related to pore size distribution.
|
|
325
|
+
|
|
326
|
+
Returns:
|
|
327
|
+
float: Water saturation.
|
|
328
|
+
"""
|
|
329
|
+
return (a / (h * phit**b))**(1 / lamda)
|
|
330
|
+
|
|
331
|
+
|
|
313
332
|
def sw_cuddy(phit, h, a, b):
|
|
314
333
|
"""Estimate water saturation based on Cuddy's.
|
|
315
334
|
|
|
@@ -317,13 +336,13 @@ def sw_cuddy(phit, h, a, b):
|
|
|
317
336
|
sw (float): Water saturation (frac).
|
|
318
337
|
phit (float): Total porosity (frac).
|
|
319
338
|
h (float): True vertical depth.
|
|
320
|
-
a (float):
|
|
321
|
-
b (float):
|
|
339
|
+
a (float): Fitting parameter.
|
|
340
|
+
b (float): Fitting parameter (negative value).
|
|
322
341
|
|
|
323
342
|
Returns:
|
|
324
343
|
float: Water saturation.
|
|
325
344
|
"""
|
|
326
|
-
return a /
|
|
345
|
+
return a / (h**b * phit)
|
|
327
346
|
|
|
328
347
|
|
|
329
348
|
def sw_shf_leverett_j(perm, phit, depth, fwl, ift, theta, gw, ghc, a, b, phie=None):
|
|
@@ -336,8 +355,8 @@ def sw_shf_leverett_j(perm, phit, depth, fwl, ift, theta, gw, ghc, a, b, phie=No
|
|
|
336
355
|
fwl (float): Free water level in true vertical depth (ft).
|
|
337
356
|
ift (float): Interfacial tension (dynes/cm).
|
|
338
357
|
theta (float): Wetting angle (degree).
|
|
339
|
-
gw (float):
|
|
340
|
-
ghc (float):
|
|
358
|
+
gw (float): Water density (g/cc).
|
|
359
|
+
ghc (float): Hydrocarbon density (g/cc).
|
|
341
360
|
a (float): A constant from J function.
|
|
342
361
|
b (float): B constant from J function.
|
|
343
362
|
phie (float): Effective porosity (frac), required for clay bound water calculation. Defaults to None.
|
|
@@ -345,7 +364,7 @@ def sw_shf_leverett_j(perm, phit, depth, fwl, ift, theta, gw, ghc, a, b, phie=No
|
|
|
345
364
|
Returns:
|
|
346
365
|
float: Water saturation from saturation height function.
|
|
347
366
|
"""
|
|
348
|
-
h = fwl - depth
|
|
367
|
+
h = (fwl - depth).clip(0)
|
|
349
368
|
pc = h * (gw - ghc) * .433 # Convert g/cc to psi/ft
|
|
350
369
|
shf = (a / leverett_j(pc, ift, theta, perm, phit))**(1 / b)
|
|
351
370
|
return shf if not phie else shf * (1 - (phie / phit)) + (phie / phit)
|
|
@@ -358,16 +377,16 @@ def sw_shf_cuddy(phit, depth, fwl, gw, ghc, a, b):
|
|
|
358
377
|
phit (float): Porosity (frac).
|
|
359
378
|
depth (float): True vertical depth (ft).
|
|
360
379
|
fwl (float): Free water level in true vertical depth (ft).
|
|
361
|
-
gw (float):
|
|
362
|
-
ghc (float):
|
|
363
|
-
a (float):
|
|
364
|
-
b (float):
|
|
380
|
+
gw (float): Water density (g/cc).
|
|
381
|
+
ghc (float): Hydrocarbon density (g/cc).
|
|
382
|
+
a (float): Fitting parameter.
|
|
383
|
+
b (float): Fitting parameter (negative value).
|
|
365
384
|
|
|
366
385
|
Returns:
|
|
367
386
|
float: Water saturation from saturation height function.
|
|
368
387
|
"""
|
|
369
|
-
h = fwl - depth
|
|
370
|
-
shf = (h * (gw - ghc) * .433
|
|
388
|
+
h = (fwl - depth).clip(0)
|
|
389
|
+
shf = a / ((h * (gw - ghc) * .433)**b * phit)
|
|
371
390
|
return shf
|
|
372
391
|
|
|
373
392
|
|
|
@@ -382,15 +401,15 @@ def sw_shf_choo(perm, phit, phie, depth, fwl, ift, theta, gw, ghc, b0=0.4):
|
|
|
382
401
|
fwl (float): Free water level in true vertical depth (ft).
|
|
383
402
|
ift (float): Interfacial tension (dynes/cm).
|
|
384
403
|
theta (float): Wetting angle (degree).
|
|
385
|
-
gw (float):
|
|
386
|
-
ghc (float):
|
|
404
|
+
gw (float): Water density (g/cc).
|
|
405
|
+
ghc (float): Hydrocarbon density (g/cc).
|
|
387
406
|
b0 (float): _description_. Defaults to 0.4.
|
|
388
407
|
|
|
389
408
|
Returns:
|
|
390
409
|
float: Water saturation from saturation height function.
|
|
391
410
|
"""
|
|
392
411
|
swb = 1 - (phie / phit)
|
|
393
|
-
h = fwl - depth
|
|
412
|
+
h = (fwl - depth).clip(0)
|
|
394
413
|
pc = h * (gw - ghc) * .433
|
|
395
414
|
shf = 10**((2 * b0 - 1) * np.log10(1 + swb**-1) + np.log10(1 + swb)) / (
|
|
396
415
|
(0.2166 * (pc / (ift * abs(np.cos(np.radians(theta))))) * (
|
|
@@ -418,6 +437,7 @@ def autocorrelate_core_depth(df):
|
|
|
418
437
|
including 'WELL_NAME', 'CORE_ID', 'ORIGINAL_DEPTH', 'DEPTH_CORRECTED',
|
|
419
438
|
and 'DEPTH_SHIFT'.
|
|
420
439
|
"""
|
|
440
|
+
from dtw import dtw
|
|
421
441
|
required_cols = ['WELL_NAME', 'DEPTH', 'PHIT', 'CPORE', 'CPERM', 'CORE_ID']
|
|
422
442
|
for col in required_cols:
|
|
423
443
|
if col not in df.columns:
|
|
@@ -255,17 +255,15 @@ def plotly_log(well_data, well_name: str = '', depth_uom="", trace_defs: dict =
|
|
|
255
255
|
|
|
256
256
|
# --- COAL_FLAG traces (special style, always on tracks 4-8, secondary_y=True) ---
|
|
257
257
|
if 'COAL_FLAG' in df.columns and no_of_track >= 8 and default_flags:
|
|
258
|
+
COAL_FLAG_HOVER = np.where(df['COAL_FLAG'] == 1, 'COAL_FLAG<extra></extra>', '<extra></extra>')
|
|
258
259
|
df['COAL_FLAG'] = df['COAL_FLAG'].replace({0: 1e-3, 1: 1e9}) # Cater for plotting on log scale
|
|
259
|
-
name = 'COAL_FLAG'
|
|
260
260
|
for c in [4, 5, 6, 7, 8]:
|
|
261
261
|
fig.add_trace(
|
|
262
262
|
go.Scatter(
|
|
263
|
-
x=df['COAL_FLAG'],
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
hovertemplate=f'<b>{name}</b><extra></extra>'
|
|
268
|
-
), row=1, col=c, secondary_y=True)
|
|
263
|
+
x=df['COAL_FLAG'], y=index, text=COAL_FLAG_HOVER,
|
|
264
|
+
line_width=0, fill='tozerox', fillcolor='rgba(0,0,0,1)',
|
|
265
|
+
hovertemplate='%{text}'
|
|
266
|
+
), row=1, col=c, secondary_y=True)
|
|
269
267
|
|
|
270
268
|
# Add ZONES to hover box in each tracks if available
|
|
271
269
|
if 'ZONES' in df.columns:
|
|
@@ -342,8 +340,12 @@ def plotly_log(well_data, well_name: str = '', depth_uom="", trace_defs: dict =
|
|
|
342
340
|
), row=1, col=2)
|
|
343
341
|
add_zone_markers(fig, df)
|
|
344
342
|
|
|
343
|
+
# Rename y axis to display horizontal lines across
|
|
344
|
+
for i in range(0, len(fig.data)):
|
|
345
|
+
fig.data[i].yaxis = 'y'
|
|
346
|
+
|
|
345
347
|
fig.update_layout(
|
|
346
|
-
height=
|
|
348
|
+
height=900,
|
|
347
349
|
autosize=True,
|
|
348
350
|
showlegend=False,
|
|
349
351
|
title={
|
|
@@ -355,6 +357,8 @@ def plotly_log(well_data, well_name: str = '', depth_uom="", trace_defs: dict =
|
|
|
355
357
|
},
|
|
356
358
|
hovermode='y unified',
|
|
357
359
|
hoverdistance=1,
|
|
360
|
+
hoverlabel_font_size=10,
|
|
361
|
+
hoverlabel_bgcolor='#F3F3F3',
|
|
358
362
|
dragmode='pan',
|
|
359
363
|
modebar_remove=['lasso', 'select', 'autoscale'],
|
|
360
364
|
modebar_add=['drawline', 'drawcircle', 'drawrect', 'eraseshape'],
|
|
@@ -362,7 +366,6 @@ def plotly_log(well_data, well_name: str = '', depth_uom="", trace_defs: dict =
|
|
|
362
366
|
template='none',
|
|
363
367
|
margin=dict(l=70, r=0, t=20, b=10),
|
|
364
368
|
paper_bgcolor="#dadada",
|
|
365
|
-
hoverlabel_bgcolor='#F3F3F3'
|
|
366
369
|
)
|
|
367
370
|
|
|
368
371
|
return fig
|
|
@@ -352,6 +352,15 @@ def estimate_vsh_gr(gr, min_gr=None, max_gr=None, alpha=0.1):
|
|
|
352
352
|
from sklearn.preprocessing import robust_scale, minmax_scale
|
|
353
353
|
# Normalize gamma ray
|
|
354
354
|
if not max_gr or (not min_gr and min_gr != 0):
|
|
355
|
+
# Remove high outliers and forward fill missing values
|
|
356
|
+
# Use IQR for robust outlier detection
|
|
357
|
+
q1, q3 = np.nanquantile(gr, [0.25, 0.75])
|
|
358
|
+
iqr = q3 - q1
|
|
359
|
+
upper_bound = q3 + 1.5 * iqr
|
|
360
|
+
lower_bound = (q1 - 1.5 * iqr).clip(0)
|
|
361
|
+
# Replace outliers with NaN and then forward fill
|
|
362
|
+
gr_series = pd.Series(gr)
|
|
363
|
+
gr = gr_series.where((gr_series >= lower_bound) & (gr_series <= upper_bound)).ffill().to_numpy()
|
|
355
364
|
gri = minmax_scale(robust_scale(gr))
|
|
356
365
|
else:
|
|
357
366
|
gri = (gr - min_gr) / (max_gr - min_gr)
|
|
@@ -79,6 +79,9 @@ def waxman_smits_saturation(rt, rw, phit, Qv=None, B=None, m=2, n=2):
|
|
|
79
79
|
swt = np.where(fx < 0, swt + delta_sat, swt - delta_sat)
|
|
80
80
|
|
|
81
81
|
logger.debug(f"Waxman-Smits saturation range: {min(swt)} - {max(swt)}")
|
|
82
|
+
# Post process only valid data
|
|
83
|
+
invalid_mask = ~((rt > 0) & np.isfinite(rt))
|
|
84
|
+
swt[invalid_mask] = 1.0
|
|
82
85
|
return swt
|
|
83
86
|
|
|
84
87
|
|
|
@@ -116,6 +119,9 @@ def normalized_waxman_smits_saturation(rt, rw, phit, vshale, phit_shale, rt_shal
|
|
|
116
119
|
swt = np.where(fx < 0, swt + delta_sat, swt - delta_sat)
|
|
117
120
|
|
|
118
121
|
logger.debug(f"Normalized Waxman-Smits saturation range: {min(swt)} - {max(swt)}")
|
|
122
|
+
# Post process only valid data
|
|
123
|
+
invalid_mask = ~((rt > 0) & np.isfinite(rt))
|
|
124
|
+
swt[invalid_mask] = 1.0
|
|
119
125
|
return swt
|
|
120
126
|
|
|
121
127
|
|
|
@@ -151,6 +157,9 @@ def dual_water_saturation(rt, rw, phit, a, m, n, swb, rwb):
|
|
|
151
157
|
swt = np.where(fx < 0, swt + delta_sat, swt - delta_sat)
|
|
152
158
|
|
|
153
159
|
logger.debug(f"Dual water saturation range: {swt.min():.3f} - {swt.max():.3f}")
|
|
160
|
+
# Post process only valid data
|
|
161
|
+
invalid_mask = ~((rt > 0) & np.isfinite(rt))
|
|
162
|
+
swt[invalid_mask] = 1.0
|
|
154
163
|
return swt
|
|
155
164
|
|
|
156
165
|
|
|
@@ -298,7 +307,7 @@ def estimate_rw_temperature_salinity(temperature_gradient, water_salinity):
|
|
|
298
307
|
float: Formation water resistivity.
|
|
299
308
|
"""
|
|
300
309
|
logger.debug("Estimating Rw from temperature and salinity")
|
|
301
|
-
rw = (400000 /
|
|
310
|
+
rw = (400000 / water_salinity)**.88 / temperature_gradient
|
|
302
311
|
logger.debug(f"Formation water resistivity range: {rw.min():.3f} - {rw.max():.3f} ohm.m")
|
|
303
312
|
return rw
|
|
304
313
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|