quick-pp 0.1.3__tar.gz → 0.1.4__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.
Files changed (48) hide show
  1. quick_pp-0.1.4/HISTORY.rst +19 -0
  2. {quick_pp-0.1.3 → quick_pp-0.1.4}/PKG-INFO +13 -2
  3. quick_pp-0.1.4/docs/static/quick_pp_demo.gif +0 -0
  4. {quick_pp-0.1.3 → quick_pp-0.1.4}/quick_pp/__init__.py +1 -1
  5. {quick_pp-0.1.3 → quick_pp-0.1.4}/quick_pp/las_handler.py +8 -9
  6. {quick_pp-0.1.3 → quick_pp-0.1.4}/quick_pp/lithology.py +88 -79
  7. quick_pp-0.1.4/quick_pp/permeability.py +84 -0
  8. {quick_pp-0.1.3 → quick_pp-0.1.4}/quick_pp/plotter.py +29 -23
  9. {quick_pp-0.1.3 → quick_pp-0.1.4}/quick_pp/porosity.py +62 -26
  10. {quick_pp-0.1.3 → quick_pp-0.1.4}/quick_pp/qaqc.py +28 -19
  11. {quick_pp-0.1.3 → quick_pp-0.1.4}/quick_pp/ressum.py +13 -13
  12. {quick_pp-0.1.3 → quick_pp-0.1.4}/quick_pp/saturation.py +60 -80
  13. {quick_pp-0.1.3 → quick_pp-0.1.4}/quick_pp/utils.py +8 -8
  14. {quick_pp-0.1.3 → quick_pp-0.1.4}/quick_pp.egg-info/PKG-INFO +13 -2
  15. {quick_pp-0.1.3 → quick_pp-0.1.4}/quick_pp.egg-info/SOURCES.txt +1 -0
  16. quick_pp-0.1.3/HISTORY.rst +0 -8
  17. quick_pp-0.1.3/quick_pp/permeability.py +0 -101
  18. {quick_pp-0.1.3 → quick_pp-0.1.4}/AUTHORS.rst +0 -0
  19. {quick_pp-0.1.3 → quick_pp-0.1.4}/CONTRIBUTING.rst +0 -0
  20. {quick_pp-0.1.3 → quick_pp-0.1.4}/LICENSE +0 -0
  21. {quick_pp-0.1.3 → quick_pp-0.1.4}/MANIFEST.in +0 -0
  22. {quick_pp-0.1.3 → quick_pp-0.1.4}/README.rst +0 -0
  23. {quick_pp-0.1.3 → quick_pp-0.1.4}/docs/Makefile +0 -0
  24. {quick_pp-0.1.3 → quick_pp-0.1.4}/docs/_build/html/_static/file.png +0 -0
  25. {quick_pp-0.1.3 → quick_pp-0.1.4}/docs/_build/html/_static/minus.png +0 -0
  26. {quick_pp-0.1.3 → quick_pp-0.1.4}/docs/_build/html/_static/plus.png +0 -0
  27. {quick_pp-0.1.3 → quick_pp-0.1.4}/docs/make.bat +0 -0
  28. {quick_pp-0.1.3 → quick_pp-0.1.4}/docs/source/authors.rst +0 -0
  29. {quick_pp-0.1.3 → quick_pp-0.1.4}/docs/source/conf.py +0 -0
  30. {quick_pp-0.1.3 → quick_pp-0.1.4}/docs/source/contributing.rst +0 -0
  31. {quick_pp-0.1.3 → quick_pp-0.1.4}/docs/source/history.rst +0 -0
  32. {quick_pp-0.1.3 → quick_pp-0.1.4}/docs/source/index.rst +0 -0
  33. {quick_pp-0.1.3 → quick_pp-0.1.4}/docs/source/installation.rst +0 -0
  34. {quick_pp-0.1.3 → quick_pp-0.1.4}/docs/source/modules.rst +0 -0
  35. {quick_pp-0.1.3 → quick_pp-0.1.4}/docs/source/quick_pp.rst +0 -0
  36. {quick_pp-0.1.3 → quick_pp-0.1.4}/docs/source/readme.rst +0 -0
  37. {quick_pp-0.1.3 → quick_pp-0.1.4}/docs/source/usage.rst +0 -0
  38. {quick_pp-0.1.3 → quick_pp-0.1.4}/quick_pp/config.py +0 -0
  39. {quick_pp-0.1.3 → quick_pp-0.1.4}/quick_pp/rock_type.py +0 -0
  40. {quick_pp-0.1.3 → quick_pp-0.1.4}/quick_pp.egg-info/dependency_links.txt +0 -0
  41. {quick_pp-0.1.3 → quick_pp-0.1.4}/quick_pp.egg-info/entry_points.txt +0 -0
  42. {quick_pp-0.1.3 → quick_pp-0.1.4}/quick_pp.egg-info/not-zip-safe +0 -0
  43. {quick_pp-0.1.3 → quick_pp-0.1.4}/quick_pp.egg-info/requires.txt +0 -0
  44. {quick_pp-0.1.3 → quick_pp-0.1.4}/quick_pp.egg-info/top_level.txt +0 -0
  45. {quick_pp-0.1.3 → quick_pp-0.1.4}/setup.cfg +0 -0
  46. {quick_pp-0.1.3 → quick_pp-0.1.4}/setup.py +0 -0
  47. {quick_pp-0.1.3 → quick_pp-0.1.4}/tests/__init__.py +0 -0
  48. {quick_pp-0.1.3 → quick_pp-0.1.4}/tests/test_quick_pp.py +0 -0
@@ -0,0 +1,19 @@
1
+ =======
2
+ History
3
+ =======
4
+
5
+ 0.1.0 (2023-10-08)
6
+ ------------------
7
+ * First release on PyPI.
8
+
9
+ 0.1.2 (2024-01-19)
10
+ ------------------
11
+ * Refactor config.
12
+
13
+ 0.1.3 (2024-01-20)
14
+ ------------------
15
+ * Update requirements.
16
+
17
+ 0.1.4 (2024-02-04)
18
+ ------------------
19
+ * Update docstrings.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: quick_pp
3
- Version: 0.1.3
3
+ Version: 0.1.4
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
@@ -51,5 +51,16 @@ History
51
51
 
52
52
  0.1.0 (2023-10-08)
53
53
  ------------------
54
-
55
54
  * First release on PyPI.
55
+
56
+ 0.1.2 (2024-01-19)
57
+ ------------------
58
+ * Refactor config.
59
+
60
+ 0.1.3 (2024-01-20)
61
+ ------------------
62
+ * Update requirements.
63
+
64
+ 0.1.4 (2024-02-04)
65
+ ------------------
66
+ * Update docstrings.
@@ -1,3 +1,3 @@
1
1
  __author__ = """Imran Fadhil"""
2
2
  __email__ = 'imranfadhil@gmail.com'
3
- __version__ = '0.1.3'
3
+ __version__ = '0.1.4'
@@ -8,16 +8,16 @@ import welly
8
8
 
9
9
  def read_las_files(las_files):
10
10
  """
11
- 1. Return df and well_header as dfs from .las files
12
- 2. For every las files, curves_df, header_df, welly_object are returned through function "check_las_file"
11
+ 1. Return df and well_header as df from .las files
12
+ 2. For every las files, curves_df, header_df, welly_object are returned through function "read_las_file"
13
13
  3. curves_df from all files are appended into merged_data
14
14
  4. header_df from all files are appended into header_data
15
15
 
16
16
  Args:
17
- las_file (list): list of las files opened as binary
17
+ las_files (list): list of las files opened as binary.
18
18
 
19
19
  Returns:
20
- pd.DataFrame: Two dataframes consist of appended curves data and header data from all las files.
20
+ pd.DataFrame: Merged data, header data.
21
21
  """
22
22
  merged_data = pd.DataFrame()
23
23
  header_data = pd.DataFrame()
@@ -59,10 +59,10 @@ def read_las_file(file_object, required_sets=['PEP']): # noqa
59
59
 
60
60
  Args:
61
61
  file_object (str): las file object.
62
- required_sets (list, optional): Required param set to be extracted.Defaults to ['PEP'].
62
+ required_sets (list, optional): Required param set to be extracted. Defaults to ['PEP'].
63
63
 
64
64
  Returns:
65
- pd.Dataframe: 3 dfs including well_df, header_df and welly_object
65
+ pd.Dataframe: well_df, header_df and welly_object
66
66
  """
67
67
  fileno = file_object.fileno() # identifier for files
68
68
  parameter_line_numbers = []
@@ -194,8 +194,7 @@ def extract_dataset(section_dict):
194
194
  section_dict (dict): Dictionary containing the LAS file section values.
195
195
 
196
196
  Returns:
197
- well_df, header_df, welly_object (pd.DataFrame, pd.DataFrame, welly_object): 3 dfs including well_df,
198
- header_df and welly_object
197
+ pd.DataFrame, pd.DataFrame, welly_object: well_df, header_df and welly_object
199
198
  """
200
199
  header_bytes = section_dict['WELL']
201
200
  data_bytes = b''
@@ -232,7 +231,7 @@ def concat_datasets(file_object, header_line_numbers, parameter_line_numbers, re
232
231
  required_sets (list): Required sets to be concatenated.
233
232
 
234
233
  Returns:
235
- pd.Dataframe: 3 dfs including well_df, header_df and welly_object
234
+ pd.Dataframe, pd.Dataframe, welly_object: well_df, header_df and welly_object
236
235
  """
237
236
  well_df = pd.DataFrame()
238
237
  header_df = pd.DataFrame()
@@ -12,7 +12,14 @@ from .config import Config
12
12
 
13
13
 
14
14
  class SandSiltClay:
15
- """Sand-silt-clay model based on Kuttan's litho-porosity model"""
15
+ """Sand-silt-clay model based on Kuttan's litho-porosity model.
16
+
17
+ The original is a binary model where reservoir sections (left to the silt line) consist of combination of
18
+ sand-silt while non-reservoir sections (right to the silt line) consist of silt-clay combination.
19
+
20
+ PCSB proposed a model based on Kuttan, where the reservoir sections consist of combination of sand-silt-clay
21
+ while non-reservoir sections remain a combination of silt-clay only. This module is a simplified version of the
22
+ original PCSB model."""
16
23
 
17
24
  def __init__(self, dry_sand_point: tuple = None, dry_silt_point: tuple = None, dry_clay_point: tuple = None,
18
25
  fluid_point: tuple = None, wet_clay_point: tuple = None, silt_line_angle: float = None):
@@ -28,14 +35,14 @@ class SandSiltClay:
28
35
  """Estimate sand silt clay lithology volumetrics.
29
36
 
30
37
  Args:
31
- nphi (array): Neutron Porosity log in v/v
32
- rhob (array): Bulk Density log in g/cc
38
+ nphi (float): Neutron Porosity log in v/v
39
+ rhob (float): Bulk Density log in g/cc
33
40
  model (str, optional): Model to choose from 'kuttan' or 'kuttan_modified'. Defaults to 'kuttan'.
34
41
  xplot (bool, optional): To plot Neutron Density cross plot. Defaults to False.
35
42
  normalize (bool, optional): To normalize with porosity. Defaults to True.
36
43
 
37
44
  Returns:
38
- (array, array, array, boolean): vsand, vsilt, vcld, vclb, cross-plot if xplot True else None
45
+ (float, float, float, boolean): vsand, vsilt, vcld, vclb, cross-plot if xplot True else None
39
46
  """
40
47
  assert model in ['kuttan', 'kuttan_modified'], f"'{model}' model is not available."
41
48
  # Initialize the endpoints
@@ -85,12 +92,12 @@ class SandSiltClay:
85
92
  """Estimate lithology volumetrics based on Kuttan's litho-porosity model.
86
93
 
87
94
  Args:
88
- nphi (array): Neutron Porosity log in v/v.
89
- rhob (array): Bulk Density log in g/cc.
95
+ nphi (float): Neutron Porosity log in v/v.
96
+ rhob (float): Bulk Density log in g/cc.
90
97
  normalize (bool, optional): To normalize with porosity. Defaults to True.
91
98
 
92
99
  Returns:
93
- (array, array, array): vsand, vsilt, vcld
100
+ (float, float, float): vsand, vsilt, vcld
94
101
  """
95
102
  A = self.dry_sand_point
96
103
  B = self.dry_silt_point
@@ -128,12 +135,12 @@ class SandSiltClay:
128
135
  (simplification of PCSB's litho-porosity model).
129
136
 
130
137
  Args:
131
- nphi (array): Neutron Porosity log in v/v.
132
- rhob (array): Bulk Density log in g/cc.
138
+ nphi (float): Neutron Porosity log in v/v.
139
+ rhob (float): Bulk Density log in g/cc.
133
140
  normalize (bool, optional): To normalize with porosity. Defaults to True.
134
141
 
135
142
  Returns:
136
- (array, array, array): vsand, vsilt, vcld
143
+ (float, float, float): vsand, vsilt, vcld
137
144
  """
138
145
  A = self.dry_sand_point
139
146
  B = self.dry_silt_point
@@ -173,7 +180,7 @@ class SandSiltClay:
173
180
 
174
181
 
175
182
  class SandShale:
176
- """Sand-shale model"""
183
+ """This binary model only consider a combination of sand-shale components. """
177
184
 
178
185
  def __init__(self, dry_sand_point: tuple = None, dry_clay_point: tuple = None,
179
186
  fluid_point: tuple = None, wet_clay_point: tuple = None, silt_line_angle: float = None):
@@ -188,12 +195,12 @@ class SandShale:
188
195
  """Estimate lithology volumetrics based on neutron density cross plot.
189
196
 
190
197
  Args:
191
- nphi (array): Neutron Porosity log in v/v
192
- rhob (array): Bulk Density log in g/cc
198
+ nphi (float): Neutron Porosity log in v/v
199
+ rhob (float): Bulk Density log in g/cc
193
200
  xplot (bool, optional): To plot Neutron Density cross plot. Defaults to False.
194
201
 
195
202
  Returns:
196
- (array, array): vsand, vcld, cross-plot if xplot True else None
203
+ (float, float): vsand, vcld, cross-plot if xplot True else None
197
204
  """
198
205
  # Initialize the endpoints
199
206
  A = self.dry_sand_point
@@ -228,11 +235,11 @@ class SandShale:
228
235
  """Estimate sand and shale based on neutron density cross plot.
229
236
 
230
237
  Args:
231
- nphi (array): Neutron Porosity log in v/v
232
- rhob (array): Bulk Density log in g/cc
238
+ nphi (float): Neutron Porosity log in v/v
239
+ rhob (float): Bulk Density log in g/cc
233
240
 
234
241
  Returns:
235
- (array, array): vsand, vcld
242
+ (float, float): vsand, vcld
236
243
  """
237
244
  A = self.dry_sand_point
238
245
  C = self.dry_clay_point
@@ -256,18 +263,19 @@ class SandShale:
256
263
 
257
264
 
258
265
  class MultiMineral():
259
- """Multi-mineral model"""
266
+ """This multi-mineral model utilizes optimization method to determine each mineral components."""
260
267
 
261
268
  def estimate_lithology(self, gr, nphi, rhob):
262
269
  """Modified from https://github.com/ruben-charles/petrophysical_evaluation_optimization_methods.git
270
+ This module only takes in gr, nphi and rhob to estimate the volumetric of quartz, calcite, dolomite and shale.
263
271
 
264
272
  Args:
265
- gr (array): Gamma Ray log in GAPI.
266
- nphi (array): Neutron Porosity log in v/v.
267
- rhob (array): Bulk Density log in g/cc.
273
+ gr (float): Gamma Ray log in GAPI.
274
+ nphi (float): Neutron Porosity log in v/v.
275
+ rhob (float): Bulk Density log in g/cc.
268
276
 
269
277
  Returns:
270
- (array, array, array, array, array): vol_quartz, vol_calcite, vol_dolomite, vol_shale, vol_mud
278
+ (float, float, float, float, float): vol_quartz, vol_calcite, vol_dolomite, vol_shale, vol_mud
271
279
  """
272
280
  # Getting default values from Config which may need to be changed based on the dataset
273
281
  responses = Config.MINERALS_LOG_VALUE
@@ -310,76 +318,77 @@ class MultiMineral():
310
318
  return vol_quartz, vol_calcite, vol_dolomite, vol_shale, vol_mud
311
319
 
312
320
 
313
- class Shale:
321
+ def shale_volume_larinov_tertiary(igr):
322
+ """
323
+ Computes shale volume from gamma ray using Larinov's method for tertiary rocks.
314
324
 
315
- def shale_volume_larinov_tertiary(igr):
316
- """
317
- Computes shale volume from gamma ray using Larinov's method for tertiary rocks.
325
+ Parameters
326
+ ----------
327
+ igr : float
328
+ Interval gamma ray [API].
318
329
 
319
- Parameters
320
- ----------
321
- igr : float
322
- Interval gamma ray [API].
330
+ Returns
331
+ -------
332
+ vshale : float
333
+ Shale volume [fraction].
323
334
 
324
- Returns
325
- -------
326
- vshale : float
327
- Shale volume [fraction].
335
+ """
336
+ return 0.083 * (2**(3.7 * igr) - 1)
328
337
 
329
- """
330
- return 0.083 * (2**(3.7 * igr) - 1)
331
338
 
332
- def shale_volume_larinov_older(igr):
333
- """
334
- Computes shale volume from gamma ray using Larinov's method for older rocks.
339
+ def shale_volume_larinov_older(igr):
340
+ """
341
+ Computes shale volume from gamma ray using Larinov's method for older rocks.
335
342
 
336
- Parameters
337
- ----------
338
- igr : float
339
- Interval gamma ray [API].
343
+ Parameters
344
+ ----------
345
+ igr : float
346
+ Interval gamma ray [API].
340
347
 
341
- Returns
342
- -------
343
- vshale : float
344
- Shale volume [fraction].
348
+ Returns
349
+ -------
350
+ vshale : float
351
+ Shale volume [fraction].
345
352
 
346
- """
347
- return 0.33 * (2**(2 * igr) - 1)
353
+ """
354
+ return 0.33 * (2**(2 * igr) - 1)
348
355
 
349
- def shale_volume_steiber(igr):
350
- """
351
- Computes shale volume from gamma ray using Steiber's method.
352
356
 
353
- Parameters
354
- ----------
355
- igr : float
356
- Interval gamma ray [API].
357
+ def shale_volume_steiber(igr):
358
+ """
359
+ Computes shale volume from gamma ray using Steiber's method.
357
360
 
358
- Returns
359
- -------
360
- vshale : float
361
- Shale volume [fraction].
361
+ Parameters
362
+ ----------
363
+ igr : float
364
+ Interval gamma ray [API].
362
365
 
363
- """
364
- return igr / (3 - 2 * igr)
366
+ Returns
367
+ -------
368
+ vshale : float
369
+ Shale volume [fraction].
365
370
 
366
- def gr_index(gr):
367
- """
368
- Computes gamma ray index from gamma ray.
371
+ """
372
+ return igr / (3 - 2 * igr)
369
373
 
370
- Parameters
371
- ----------
372
- gr : float
373
- Gamma ray [API].
374
374
 
375
- Returns
376
- -------
377
- gr_index : float
378
- Gamma ray index [API].
375
+ def gr_index(gr):
376
+ """
377
+ Computes gamma ray index from gamma ray.
379
378
 
380
- """
381
- gr = np.where(np.isnan(gr), np.min(gr), gr)
382
- dtr_gr = detrend(gr, axis=0) + statistics.mean(gr)
383
- scaler = MinMaxScaler()
384
- igr = scaler.fit_transform(dtr_gr.reshape(-1, 1))
385
- return igr
379
+ Parameters
380
+ ----------
381
+ gr : float
382
+ Gamma ray [API].
383
+
384
+ Returns
385
+ -------
386
+ gr_index : float
387
+ Gamma ray index [API].
388
+
389
+ """
390
+ gr = np.where(np.isnan(gr), np.min(gr), gr)
391
+ dtr_gr = detrend(gr, axis=0) + statistics.mean(gr)
392
+ scaler = MinMaxScaler()
393
+ igr = scaler.fit_transform(dtr_gr.reshape(-1, 1))
394
+ return igr
@@ -0,0 +1,84 @@
1
+ def choo_permeability(vclw, vsilt, phit, m=2, B=None, A=20e7, C=2):
2
+ """Estimate permeability using Choo's equation.
3
+
4
+ Args:
5
+ vclw (float): Volume of clay in fraction.
6
+ vsilt (float): Volume of silt in fraction.
7
+ phit (float): Total porosity in fraction.
8
+ A (float): Constant based on 0.125 * rg**2 / 10. Defaults to 20e7.
9
+ B (float): Constant, defaults m * ((2 / C) + 1) + 2.
10
+ C (float): Constant, defaults to 2.
11
+
12
+ Returns:
13
+ float: Choo's permeability in mD.
14
+ """
15
+ B = B or m * ((2 / C) + 1) + 2
16
+ return A * phit**B / 10**(6 * vclw + 3 * vsilt)
17
+
18
+
19
+ def kozeny_carman_permeability(phit, S=0.01):
20
+ """Estimate permeability using Kozeny-Carman's equation.
21
+
22
+ Args:
23
+ phit (float): Total porosity in fraction.
24
+ S (float): Specific surface area of the grains
25
+
26
+ Returns:
27
+ float: Permeability in mD.
28
+ """
29
+ return phit**3 / (5 * S**2 * (1 - phit**2))
30
+
31
+
32
+ def timur_permeability(phit, Swirr):
33
+ """Based on Timur (1968) emperical equation established on 155 sandstone samples from 3 different
34
+ oil fields in North America.
35
+
36
+ Args:
37
+ phit (float): Porosity in fraction.
38
+ Swirr (float): Irreduceable water saturation in fraction.
39
+
40
+ Returns:
41
+ float: Permeability in mD.
42
+ """
43
+ return 8.58 * phit**4.4 / Swirr**2
44
+
45
+
46
+ def coates_permeability(phie, Swirr, a=1):
47
+ """Based on Coates (1974)
48
+
49
+ Args:
50
+ phie (float): Effective porosity in fraction.
51
+ Swirr (float): Irreduceable water saturation in fraction.
52
+ a (float): Constant. Defaults to 1.
53
+
54
+ Returns:
55
+ float: Coates permeability in mD.
56
+ """
57
+ return (phie**2 / a * (1 - Swirr) / Swirr)**2
58
+
59
+
60
+ def tixier_permeability(phit, Swirr):
61
+ """Based on Tixier (1949)
62
+
63
+ Args:
64
+ phit (float): Porosity in fraction.
65
+ Swirr (float): Irreduceable water saturation in fraction.
66
+
67
+ Returns:
68
+ float: Permeability in mD
69
+ """
70
+ return 62.5 * phit**6 / Swirr**2
71
+
72
+
73
+ def morris_biggs_permeability(phit, phie, Vbwi):
74
+ """Based on Morris and Biggs (1967)
75
+
76
+ Args:
77
+ phit (float): Total porosity in fraction.
78
+ phie (float): Effective porosity in fraction.
79
+ Vbwi (float): Volume of bound water in fraction.
80
+
81
+ Returns:
82
+ float: Permeability in mD.
83
+ """
84
+ return (1e2 * phie**2 * (phit - Vbwi) / Vbwi)**2
@@ -44,7 +44,20 @@ def neutron_density_xplot(nphi, rhob,
44
44
  dry_clay_point: tuple,
45
45
  fluid_point: tuple,
46
46
  wet_clay_point: tuple):
47
+ """Neutron-Density crossplot with lithology lines based on specified end points.
47
48
 
49
+ Args:
50
+ nphi (float): Neutron porosity log.
51
+ rhob (float): Bulk density log.
52
+ dry_sand_point (tuple): Neutron porosity and bulk density of dry sand point.
53
+ dry_silt_point (tuple): Neutron porosity and bulk density of dry silt point.
54
+ dry_clay_point (tuple): Neutron porosity and bulk density of dry clay point.
55
+ fluid_point (tuple): Neutron porosity and bulk density of fluid point.
56
+ wet_clay_point (tuple): Neutron porosity and bulk density of wet clay point.
57
+
58
+ Returns:
59
+ matplotlib.pyplot.Figure: Neutron porosity and bulk density cross plot.
60
+ """
48
61
  A = dry_sand_point
49
62
  B = dry_silt_point
50
63
  C = dry_clay_point
@@ -85,14 +98,16 @@ def neutron_density_xplot(nphi, rhob,
85
98
 
86
99
 
87
100
  def picket_plot(rt, phit):
88
- """_summary_
101
+ """Generate Pickett plot which is used to plot phit and rt at water bearing interval to determine;
102
+ m = The slope of best-fit line crossing the cleanest sand.
103
+ rw = Formation water resistivity. The intercept of the best-fit line at rt when phit = 100%.
89
104
 
90
105
  Args:
91
- rt (_type_): _description_
92
- phit (_type_): _description_
106
+ rt (float): True resistivity or deep resistivity log.
107
+ phit (float): Total porosity.
93
108
 
94
109
  Returns:
95
- _type_: _description_
110
+ matplotlib.pyplot.Figure: Picket plot.
96
111
  """
97
112
  fig = plt.Figure(figsize=(5, 5))
98
113
  ax = fig.add_subplot(111)
@@ -119,6 +134,14 @@ def sonic_neutron_xplot():
119
134
 
120
135
 
121
136
  def plotly_log(df): # noqa
137
+ """Plot well logs using Plotly.
138
+
139
+ Args:
140
+ df (pandas.Datafraem): Pandas dataframe containing well log data.
141
+
142
+ Returns:
143
+ plotly.graph_objects.Figure: Return well plot.
144
+ """
122
145
  track = 7
123
146
  index = df.DEPTH
124
147
 
@@ -247,18 +270,6 @@ def plotly_log(df): # noqa
247
270
  fig.data[i].update(xaxis=f'x{i + 1}')
248
271
  i += 1
249
272
 
250
- if 'RHO_CLW' in df.columns and 'NPHI_CLW' in df.columns:
251
- # Add NPHI_CLW trace #23
252
- fig.add_trace(go.Scatter(x=df['NPHI_CLW'], y=index, name='NPHI_CLW', line_color='magenta'),
253
- row=1, col=3, secondary_y=True)
254
- fig.data[i].update(xaxis=f'x{i + 1}')
255
- i += 1
256
- # Add RHO_CLW trace #24
257
- fig.add_trace(go.Scatter(x=df['RHO_CLW'], y=index, name='RHO_CLW', line_color='purple'),
258
- row=1, col=3, secondary_y=False)
259
- fig.data[i].update(xaxis=f'x{i + 1}')
260
- i += 1
261
-
262
273
  font_size = 9
263
274
  fig.update_layout(
264
275
  xaxis1=dict(title='GR', titlefont=dict(color=COLOR_DICT['GR'], size=font_size),
@@ -288,8 +299,7 @@ def plotly_log(df): # noqa
288
299
  side='top', anchor='free', position=.9, title_standoff=.1,
289
300
  range=[0, 1], type='linear'),
290
301
  xaxis8=dict(title='NPHI', titlefont=dict(color=COLOR_DICT['NPHI'], size=font_size),
291
- tickfont=dict(color=COLOR_DICT['NPHI'], size=font_size),
292
- zeroline=False,
302
+ tickfont=dict(color=COLOR_DICT['NPHI'], size=font_size), zeroline=False,
293
303
  side='top', anchor='free', position=.94, title_standoff=.1, overlaying='x3',
294
304
  tickformat=".2f", tick0=-.15, dtick=0.12, range=[.45, -.15], type='linear'),
295
305
  xaxis9=dict(title='PHIE', titlefont=dict(color=COLOR_DICT['PHIE'], size=font_size),
@@ -314,7 +324,7 @@ def plotly_log(df): # noqa
314
324
  range=[0, 5], type='linear', showgrid=False, zeroline=False,),
315
325
 
316
326
  # make room to display double x-axes
317
- yaxis=dict(domain=[0, .9], title='DEPTH (FT MD)', showgrid=False),
327
+ yaxis=dict(domain=[0, .9], title='DEPTH', showgrid=False),
318
328
  yaxis2=dict(domain=[0, .9], visible=False, showgrid=False),
319
329
  yaxis3=dict(domain=[0, .9], visible=False, showgrid=False),
320
330
  yaxis4=dict(domain=[0, .9], visible=False, showgrid=False),
@@ -345,10 +355,6 @@ def plotly_log(df): # noqa
345
355
  side='top', anchor='free', position=.97, title_standoff=.1, overlaying='x7',
346
356
  tick0=0, dtick=1, range=[0, 1], type='linear', tickfont=dict(size=1)),
347
357
  yaxis22=dict(domain=[0, .9], visible=False, showgrid=False),
348
- xaxis23=dict(title='', range=[0.45, -0.15], type='linear', overlaying='x3', zeroline=False, showgrid=False),
349
- yaxis23=dict(domain=[0, .9], visible=False, showgrid=False),
350
- xaxis24=dict(title='', range=[1.85, 2.85], type='linear', overlaying='x3', zeroline=False, showgrid=False),
351
- yaxis24=dict(domain=[0, .9], visible=False, showgrid=False),
352
358
 
353
359
  height=750,
354
360
  width=900,