rock-physics-open 0.0__py3-none-any.whl

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.

Potentially problematic release.


This version of rock-physics-open might be problematic. Click here for more details.

Files changed (142) hide show
  1. rock_physics_open/__init__.py +0 -0
  2. rock_physics_open/equinor_utilities/__init__.py +0 -0
  3. rock_physics_open/equinor_utilities/anisotropy.py +162 -0
  4. rock_physics_open/equinor_utilities/classification_functions/__init__.py +17 -0
  5. rock_physics_open/equinor_utilities/classification_functions/class_stats.py +58 -0
  6. rock_physics_open/equinor_utilities/classification_functions/lin_class.py +47 -0
  7. rock_physics_open/equinor_utilities/classification_functions/mahal_class.py +56 -0
  8. rock_physics_open/equinor_utilities/classification_functions/norm_class.py +65 -0
  9. rock_physics_open/equinor_utilities/classification_functions/poly_class.py +40 -0
  10. rock_physics_open/equinor_utilities/classification_functions/post_prob.py +26 -0
  11. rock_physics_open/equinor_utilities/classification_functions/two_step_classification.py +46 -0
  12. rock_physics_open/equinor_utilities/conversions.py +10 -0
  13. rock_physics_open/equinor_utilities/gen_utilities/__init__.py +11 -0
  14. rock_physics_open/equinor_utilities/gen_utilities/dict_to_float.py +33 -0
  15. rock_physics_open/equinor_utilities/gen_utilities/dim_check_vector.py +83 -0
  16. rock_physics_open/equinor_utilities/gen_utilities/filter_input.py +126 -0
  17. rock_physics_open/equinor_utilities/gen_utilities/filter_output.py +78 -0
  18. rock_physics_open/equinor_utilities/machine_learning_utilities/__init__.py +14 -0
  19. rock_physics_open/equinor_utilities/machine_learning_utilities/dummy_vars.py +42 -0
  20. rock_physics_open/equinor_utilities/machine_learning_utilities/exponential_model.py +119 -0
  21. rock_physics_open/equinor_utilities/machine_learning_utilities/import_ml_models.py +61 -0
  22. rock_physics_open/equinor_utilities/machine_learning_utilities/run_regression.py +151 -0
  23. rock_physics_open/equinor_utilities/machine_learning_utilities/sigmoidal_model.py +188 -0
  24. rock_physics_open/equinor_utilities/snapshot_test_utilities/__init__.py +10 -0
  25. rock_physics_open/equinor_utilities/snapshot_test_utilities/compare_snapshots.py +145 -0
  26. rock_physics_open/equinor_utilities/snapshot_test_utilities/snapshots.py +54 -0
  27. rock_physics_open/equinor_utilities/std_functions/__init__.py +43 -0
  28. rock_physics_open/equinor_utilities/std_functions/backus_ave.py +53 -0
  29. rock_physics_open/equinor_utilities/std_functions/dvorkin_nur.py +69 -0
  30. rock_physics_open/equinor_utilities/std_functions/gassmann.py +140 -0
  31. rock_physics_open/equinor_utilities/std_functions/hashin_shtrikman.py +195 -0
  32. rock_physics_open/equinor_utilities/std_functions/hertz_mindlin.py +43 -0
  33. rock_physics_open/equinor_utilities/std_functions/moduli_velocity.py +51 -0
  34. rock_physics_open/equinor_utilities/std_functions/reflection_eq.py +98 -0
  35. rock_physics_open/equinor_utilities/std_functions/rho.py +59 -0
  36. rock_physics_open/equinor_utilities/std_functions/voigt_reuss_hill.py +128 -0
  37. rock_physics_open/equinor_utilities/std_functions/walton.py +38 -0
  38. rock_physics_open/equinor_utilities/std_functions/wood_brie.py +77 -0
  39. rock_physics_open/equinor_utilities/various_utilities/Equinor_logo.gif +0 -0
  40. rock_physics_open/equinor_utilities/various_utilities/Equinor_logo.ico +0 -0
  41. rock_physics_open/equinor_utilities/various_utilities/__init__.py +24 -0
  42. rock_physics_open/equinor_utilities/various_utilities/display_result_statistics.py +83 -0
  43. rock_physics_open/equinor_utilities/various_utilities/gassmann_dry_mod.py +37 -0
  44. rock_physics_open/equinor_utilities/various_utilities/gassmann_mod.py +37 -0
  45. rock_physics_open/equinor_utilities/various_utilities/gassmann_sub_mod.py +53 -0
  46. rock_physics_open/equinor_utilities/various_utilities/hs_average.py +40 -0
  47. rock_physics_open/equinor_utilities/various_utilities/pressure.py +88 -0
  48. rock_physics_open/equinor_utilities/various_utilities/reflectivity.py +85 -0
  49. rock_physics_open/equinor_utilities/various_utilities/timeshift.py +91 -0
  50. rock_physics_open/equinor_utilities/various_utilities/vp_vs_rho_set_statistics.py +154 -0
  51. rock_physics_open/equinor_utilities/various_utilities/vrh_3_min.py +61 -0
  52. rock_physics_open/fluid_models/__init__.py +9 -0
  53. rock_physics_open/fluid_models/brine_model/__init__.py +5 -0
  54. rock_physics_open/fluid_models/brine_model/brine_properties.py +143 -0
  55. rock_physics_open/fluid_models/gas_model/__init__.py +5 -0
  56. rock_physics_open/fluid_models/gas_model/gas_properties.py +277 -0
  57. rock_physics_open/fluid_models/oil_model/__init__.py +5 -0
  58. rock_physics_open/fluid_models/oil_model/dead_oil_density.py +60 -0
  59. rock_physics_open/fluid_models/oil_model/dead_oil_velocity.py +28 -0
  60. rock_physics_open/fluid_models/oil_model/live_oil_density.py +79 -0
  61. rock_physics_open/fluid_models/oil_model/live_oil_velocity.py +24 -0
  62. rock_physics_open/fluid_models/oil_model/oil_bubble_point.py +69 -0
  63. rock_physics_open/fluid_models/oil_model/oil_properties.py +114 -0
  64. rock_physics_open/sandstone_models/__init__.py +57 -0
  65. rock_physics_open/sandstone_models/cemented_shalysand_sandyshale_models.py +304 -0
  66. rock_physics_open/sandstone_models/constant_cement_models.py +204 -0
  67. rock_physics_open/sandstone_models/constant_cement_optimisation.py +122 -0
  68. rock_physics_open/sandstone_models/contact_cement_model.py +138 -0
  69. rock_physics_open/sandstone_models/curvefit_sandstone_models.py +143 -0
  70. rock_physics_open/sandstone_models/friable_models.py +178 -0
  71. rock_physics_open/sandstone_models/friable_optimisation.py +112 -0
  72. rock_physics_open/sandstone_models/friable_shalysand_sandyshale_models.py +235 -0
  73. rock_physics_open/sandstone_models/patchy_cement_fluid_substitution_model.py +477 -0
  74. rock_physics_open/sandstone_models/patchy_cement_model.py +286 -0
  75. rock_physics_open/sandstone_models/patchy_cement_optimisation.py +251 -0
  76. rock_physics_open/sandstone_models/unresolved_cemented_sandshale_models.py +134 -0
  77. rock_physics_open/sandstone_models/unresolved_friable_sandshale_models.py +126 -0
  78. rock_physics_open/shale_models/__init__.py +19 -0
  79. rock_physics_open/shale_models/dem.py +174 -0
  80. rock_physics_open/shale_models/dem_dual_por.py +61 -0
  81. rock_physics_open/shale_models/kus_tok.py +59 -0
  82. rock_physics_open/shale_models/multi_sca.py +133 -0
  83. rock_physics_open/shale_models/pq.py +102 -0
  84. rock_physics_open/shale_models/sca.py +90 -0
  85. rock_physics_open/shale_models/shale4_mineral.py +147 -0
  86. rock_physics_open/shale_models/shale4_mineral_dem_overlay.py +92 -0
  87. rock_physics_open/span_wagner/__init__.py +5 -0
  88. rock_physics_open/span_wagner/co2_properties.py +438 -0
  89. rock_physics_open/span_wagner/coefficients.py +165 -0
  90. rock_physics_open/span_wagner/equations.py +104 -0
  91. rock_physics_open/span_wagner/tables/__init__.py +0 -0
  92. rock_physics_open/span_wagner/tables/carbon_dioxide_density.npz +0 -0
  93. rock_physics_open/span_wagner/tables/lookup_table.py +33 -0
  94. rock_physics_open/t_matrix_models/Equinor_logo.ico +0 -0
  95. rock_physics_open/t_matrix_models/__init__.py +45 -0
  96. rock_physics_open/t_matrix_models/carbonate_pressure_substitution.py +124 -0
  97. rock_physics_open/t_matrix_models/curvefit_t_matrix_exp.py +124 -0
  98. rock_physics_open/t_matrix_models/curvefit_t_matrix_min.py +86 -0
  99. rock_physics_open/t_matrix_models/opt_subst_utilities.py +415 -0
  100. rock_physics_open/t_matrix_models/parse_t_matrix_inputs.py +297 -0
  101. rock_physics_open/t_matrix_models/run_t_matrix.py +243 -0
  102. rock_physics_open/t_matrix_models/t_matrix_C.py +210 -0
  103. rock_physics_open/t_matrix_models/t_matrix_opt_fluid_sub_exp.py +137 -0
  104. rock_physics_open/t_matrix_models/t_matrix_opt_fluid_sub_petec.py +163 -0
  105. rock_physics_open/t_matrix_models/t_matrix_opt_forward_model_exp.py +72 -0
  106. rock_physics_open/t_matrix_models/t_matrix_opt_forward_model_min.py +86 -0
  107. rock_physics_open/t_matrix_models/t_matrix_parameter_optimisation_exp.py +172 -0
  108. rock_physics_open/t_matrix_models/t_matrix_parameter_optimisation_min.py +159 -0
  109. rock_physics_open/t_matrix_models/t_matrix_vector/__init__.py +12 -0
  110. rock_physics_open/t_matrix_models/t_matrix_vector/array_functions.py +75 -0
  111. rock_physics_open/t_matrix_models/t_matrix_vector/calc_c_eff.py +163 -0
  112. rock_physics_open/t_matrix_models/t_matrix_vector/calc_isolated.py +95 -0
  113. rock_physics_open/t_matrix_models/t_matrix_vector/calc_kd.py +40 -0
  114. rock_physics_open/t_matrix_models/t_matrix_vector/calc_kd_eff.py +116 -0
  115. rock_physics_open/t_matrix_models/t_matrix_vector/calc_kd_uuv.py +18 -0
  116. rock_physics_open/t_matrix_models/t_matrix_vector/calc_pressure.py +140 -0
  117. rock_physics_open/t_matrix_models/t_matrix_vector/calc_t.py +71 -0
  118. rock_physics_open/t_matrix_models/t_matrix_vector/calc_td.py +42 -0
  119. rock_physics_open/t_matrix_models/t_matrix_vector/calc_theta.py +43 -0
  120. rock_physics_open/t_matrix_models/t_matrix_vector/calc_x.py +33 -0
  121. rock_physics_open/t_matrix_models/t_matrix_vector/calc_z.py +50 -0
  122. rock_physics_open/t_matrix_models/t_matrix_vector/check_and_tile.py +43 -0
  123. rock_physics_open/t_matrix_models/t_matrix_vector/g_tensor.py +140 -0
  124. rock_physics_open/t_matrix_models/t_matrix_vector/iso_av.py +60 -0
  125. rock_physics_open/t_matrix_models/t_matrix_vector/iso_ave_all.py +55 -0
  126. rock_physics_open/t_matrix_models/t_matrix_vector/pressure_input.py +44 -0
  127. rock_physics_open/t_matrix_models/t_matrix_vector/t_matrix_vec.py +278 -0
  128. rock_physics_open/t_matrix_models/t_matrix_vector/velocity_vti_angles.py +81 -0
  129. rock_physics_open/t_matrix_models/tmatrix_python.dll +0 -0
  130. rock_physics_open/t_matrix_models/tmatrix_python.so +0 -0
  131. rock_physics_open/ternary_plots/__init__.py +3 -0
  132. rock_physics_open/ternary_plots/gen_ternary_plot.py +73 -0
  133. rock_physics_open/ternary_plots/shale_prop_ternary.py +337 -0
  134. rock_physics_open/ternary_plots/ternary_patches.py +277 -0
  135. rock_physics_open/ternary_plots/ternary_plot_utilities.py +197 -0
  136. rock_physics_open/ternary_plots/unconventionals_ternary.py +75 -0
  137. rock_physics_open/version.py +21 -0
  138. rock_physics_open-0.0.dist-info/METADATA +92 -0
  139. rock_physics_open-0.0.dist-info/RECORD +142 -0
  140. rock_physics_open-0.0.dist-info/WHEEL +5 -0
  141. rock_physics_open-0.0.dist-info/licenses/LICENSE +165 -0
  142. rock_physics_open-0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,24 @@
1
+ from .display_result_statistics import disp_result_stats
2
+ from .gassmann_dry_mod import gassmann_dry_model
3
+ from .gassmann_mod import gassmann_model
4
+ from .gassmann_sub_mod import gassmann_sub_model
5
+ from .hs_average import hs_average
6
+ from .pressure import pressure
7
+ from .reflectivity import reflectivity
8
+ from .timeshift import time_shift_pp, time_shift_ps
9
+ from .vp_vs_rho_set_statistics import vp_vs_rho_stats
10
+ from .vrh_3_min import min_3_voigt_reuss_hill
11
+
12
+ __all__ = [
13
+ "disp_result_stats",
14
+ "gassmann_dry_model",
15
+ "gassmann_model",
16
+ "gassmann_sub_model",
17
+ "hs_average",
18
+ "pressure",
19
+ "reflectivity",
20
+ "time_shift_pp",
21
+ "time_shift_ps",
22
+ "vp_vs_rho_stats",
23
+ "min_3_voigt_reuss_hill",
24
+ ]
@@ -0,0 +1,83 @@
1
+ import os
2
+ import sys
3
+
4
+ import numpy as np
5
+
6
+
7
+ def disp_result_stats(title: str, arr: list | tuple, names_arr: list, **kwargs):
8
+ """
9
+ Display results utilizing tkinter.
10
+
11
+ Parameters
12
+ ----------
13
+ title : Title.
14
+ arr : items to display
15
+ names_arr : array of names.
16
+ """
17
+ from tkinter import END, Entry, PhotoImage, Tk
18
+
19
+ class Table:
20
+ def __init__(self, tk_root, no_rows, no_cols, info):
21
+ # code for creating table
22
+ str_len = np.vectorize(len)
23
+ text_justify = ["center", "left"]
24
+ text_weight = ["bold", "normal"]
25
+ for i in range(no_rows):
26
+ weigh = text_weight[np.sign(i)]
27
+ for j in range(no_cols):
28
+ just = text_justify[np.sign(i)]
29
+ max_len = np.max(str_len(info[:, j]))
30
+ self.e = Entry(
31
+ tk_root,
32
+ width=max_len + 2,
33
+ fg="black",
34
+ font=("Consolas", 12, weigh),
35
+ justify=just,
36
+ )
37
+ self.e.grid(row=i, column=j)
38
+ self.e.insert(END, info[i][j])
39
+
40
+ values_only = kwargs.pop("values_only", False)
41
+ root = Tk(**kwargs)
42
+ root.title(title)
43
+ if values_only:
44
+ info_array = np.zeros((len(arr) + 1, 2)).astype(str)
45
+ info_array[0, :] = ["Property", "Value"]
46
+ for k in range(len(arr)):
47
+ info_array[k + 1, 0] = f"{names_arr[k]}"
48
+ info_array[k + 1, 1] = f"{arr[k]:.3g}"
49
+ else:
50
+ info_array = np.zeros((len(arr) + 1, 6)).astype(str)
51
+ info_array[0, :] = ["Var", "Min", "Mean", "Max", "No. NaN", "No. of Inf"]
52
+ for k in range(len(arr)):
53
+ info_array[k + 1, 0] = f"{names_arr[k]}"
54
+ info_array[k + 1, 1] = f"{np.nanmin(np.asarray(arr[k])):.3g}"
55
+ info_array[k + 1, 2] = f"{np.nanmean(np.asarray(arr[k])):.3g}"
56
+ info_array[k + 1, 3] = f"{np.nanmax(np.asarray(arr[k])):.3g}"
57
+ info_array[k + 1, 4] = f"{np.sum(np.isnan(np.asarray(arr[k])))}"
58
+ info_array[k + 1, 5] = f"{np.sum(np.isinf(np.asarray(arr[k])))}"
59
+
60
+ Table(root, info_array.shape[0], info_array.shape[1], info_array)
61
+
62
+ root.update_idletasks()
63
+ window_height = root.winfo_height()
64
+ window_width = root.winfo_width()
65
+ screen_width = root.winfo_screenwidth()
66
+ screen_height = root.winfo_screenheight()
67
+
68
+ x_coordinate = int((screen_width / 2) - (window_width / 2))
69
+ y_coordinate = int((screen_height / 2) - (window_height / 2))
70
+
71
+ root.geometry(
72
+ "{}x{}+{}+{}".format(window_width, window_height, x_coordinate, y_coordinate)
73
+ )
74
+
75
+ if sys.platform.startswith("win"):
76
+ root.iconbitmap(os.path.join(os.path.dirname(__file__), "Equinor_logo.ico"))
77
+ else:
78
+ logo = PhotoImage(
79
+ file=os.path.join(os.path.dirname(__file__), "Equinor_logo.gif")
80
+ )
81
+ root.call("wm", "iconphoto", root._w, logo)
82
+
83
+ root.mainloop()
@@ -0,0 +1,37 @@
1
+ from rock_physics_open.equinor_utilities import std_functions
2
+
3
+
4
+ def gassmann_dry_model(k_min, k_fl, rho_fl, k_sat, mu, rho_sat, por):
5
+ """
6
+ Gassmann model to go from saturated rock to dry state.
7
+
8
+ Parameters
9
+ ----------
10
+ k_min : np.ndarray
11
+ Mineral bulk modulus [Pa].
12
+ k_fl : np.ndarray
13
+ Fluid bulk modulus [Pa].
14
+ rho_fl : np.ndarray
15
+ Fluid density [lg/m^3].
16
+ k_sat : np.ndarray
17
+ Saturated rock bulk modulus [Pa].
18
+ mu : np.ndarray
19
+ Saturated rock shear modulus [Pa].
20
+ rho_sat : np.ndarray
21
+ Saturated rock density [kg/m^3].
22
+ por : np.ndarray
23
+ Porosity [fraction].
24
+
25
+ Returns
26
+ -------
27
+ tuple
28
+ vp_dry, vs_dry, rho_dry, ai_dry, vpvs_dry, k_dry, mu : (np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray).
29
+ vp_dry, vs_dry: dry velocities [m/s], rho_dry: dry density [kg/m^3], ai_dry: dry acoustic impedance
30
+ [kg/m^3 x m/s], vpvs_dry: dry velocity ratio [unitless], k_dry, mu: dry bulk modulus and shear modulus (the
31
+ latter unchanged from saturated state) [Pa].
32
+ """
33
+ rho_dry = rho_sat - por * rho_fl
34
+ k_dry = std_functions.gassmann_dry(k_sat, por, k_fl, k_min)
35
+ vp_dry, vs_dry, ai_dry, vpvs_dry = std_functions.velocity(k_dry, mu, rho_dry)
36
+
37
+ return vp_dry, vs_dry, rho_dry, ai_dry, vpvs_dry, k_dry, mu
@@ -0,0 +1,37 @@
1
+ from rock_physics_open.equinor_utilities import std_functions
2
+
3
+
4
+ def gassmann_model(k_min, k_fl, rho_fl, k_dry, mu, rho_dry, por):
5
+ """
6
+ Gassmann model to go from dry rock to saturated state.
7
+
8
+ Parameters
9
+ ----------
10
+ k_min : np.ndarray
11
+ Mineral bulk modulus [Pa].
12
+ k_fl : np.ndarray
13
+ Fluid bulk modulus [Pa].
14
+ rho_fl : np.ndarray
15
+ Fluid density [lg/m^3].
16
+ k_dry : np.ndarray
17
+ Dry rock bulk modulus [Pa].
18
+ mu : np.ndarray
19
+ Dry rock shear modulus [Pa].
20
+ rho_dry : np.ndarray
21
+ Dry rock density [kg/m^3].
22
+ por : np.ndarray
23
+ Porosity [fraction].
24
+
25
+ Returns
26
+ -------
27
+ tuple
28
+ vp_sat, vs_sat, rho_sat, ai_sat, vpvs_sat, k_sat, mu : (np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray).
29
+ vp_sat, vs_sat: saturated velocities [m/s], rho_sat: saturated density [kg/m^3], ai_sat: saturated acoustic
30
+ impedance [kg/m^3 x m/s], vpvs_sat: saturated velocity ratio [unitless], k_sat, mu: saturated bulk modulus and
31
+ shear modulus (the latter unchanged from dry state) [Pa].
32
+ """
33
+ rho_sat = rho_dry + por * rho_fl
34
+ k_sat = std_functions.gassmann(k_dry, por, k_fl, k_min)
35
+ vp_sat, vs_sat, ai_sat, vpvs_sat = std_functions.velocity(k_sat, mu, rho_sat)
36
+
37
+ return vp_sat, vs_sat, rho_sat, ai_sat, vpvs_sat, k_sat, mu
@@ -0,0 +1,53 @@
1
+ from rock_physics_open.equinor_utilities import std_functions
2
+
3
+
4
+ def gassmann_sub_model(
5
+ k_min,
6
+ k_fl_orig,
7
+ rho_fl_orig,
8
+ k_fl_sub,
9
+ rho_fl_sub,
10
+ k_sat_orig,
11
+ mu,
12
+ rho_sat_orig,
13
+ por,
14
+ ):
15
+ """
16
+ Gassmann model to go from one saturated state to another.
17
+
18
+ Parameters
19
+ ----------
20
+ k_min : np.ndarray
21
+ Mineral bulk modulus [Pa].
22
+ k_fl_orig : np.ndarray
23
+ Original fluid bulk modulus [Pa].
24
+ rho_fl_orig : np.ndarray
25
+ Original fluid density [lg/m^3].
26
+ k_fl_sub : np.ndarray
27
+ Sunstituted fluid bulk modulus [Pa].
28
+ rho_fl_sub : np.ndarray
29
+ Substituted fluid density [lg/m^3].
30
+ k_sat_orig : np.ndarray
31
+ Saturated rock bulk modulus with original fluid [Pa].
32
+ mu : np.ndarray
33
+ Rock shear modulus [Pa].
34
+ rho_sat_orig : np.ndarray
35
+ Saturated rock density with original fluid [kg/m^3].
36
+ por : np.ndarray
37
+ Porosity [fraction].
38
+
39
+ Returns
40
+ -------
41
+ tuple
42
+ vp_sat, vs_sat, rho_sat, ai_sat, vpvs_sat, k_sat, mu : (np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray).
43
+ vp_sat, vs_sat: saturated velocities [m/s], rho_sat: saturated density [kg/m^3], ai_sat: saturated acoustic
44
+ impedance [kg/m^3 x m/s], vpvs_sat: saturated velocity ratio [unitless], k_sat, mu: saturated bulk modulus and
45
+ shear modulus (the latter unchanged from dry state) [Pa].
46
+ """
47
+ rho_sat_sub = rho_sat_orig + por * (rho_fl_sub - rho_fl_orig)
48
+ k_sat_sub = std_functions.gassmann2(k_sat_orig, k_fl_orig, k_fl_sub, por, k_min)
49
+ vp_sat_sub, vs_sat_sub, ai_sat_sub, vpvs_sat_sub = std_functions.velocity(
50
+ k_sat_sub, mu, rho_sat_sub
51
+ )
52
+
53
+ return vp_sat_sub, vs_sat_sub, rho_sat_sub, ai_sat_sub, vpvs_sat_sub, k_sat_sub, mu
@@ -0,0 +1,40 @@
1
+ from rock_physics_open.equinor_utilities import std_functions
2
+
3
+
4
+ def hs_average(k1, mu1, rhob1, k2, mu2, rhob2, f):
5
+ """
6
+ BMix of two phases by Hashin-Shtrikman model. Derived properties are also returned.
7
+
8
+ Parameters
9
+ ----------
10
+ k1 : np.ndarray
11
+ k1 array.
12
+ mu1 : np.ndarray
13
+ mu1 array.
14
+ rhob1 : np.ndarray
15
+ rhob1 array.
16
+ k2 : np.ndarray
17
+ k2 array.
18
+ mu2 : np.ndarray
19
+ mu2 array.
20
+ rhob2 : np.ndarray
21
+ rhob2 array.
22
+ f : float or np.ndarray
23
+ f value or array.
24
+
25
+ Returns
26
+ -------
27
+ tuple
28
+ vp, vs, rhob, ai, vp_vs, k, mu : np.ndarray
29
+ vp: compressional wave velocity [m/s], vs: shear wave velocity [m/s], ai: acoustic impedance [m/s x kg/m^3],
30
+ vp_vs: velocity ratio [ratio], k: bulk modulus [Pa], mu: shear modulus [Pa]
31
+
32
+ """
33
+
34
+ k, mu = std_functions.hashin_shtrikman_average(k1, mu1, k2, mu2, f)
35
+
36
+ rhob = rhob1 * f + rhob2 * (1 - f)
37
+
38
+ vp, vs, ai, vp_vs = std_functions.velocity(k, mu, rhob)
39
+
40
+ return vp, vs, rhob, ai, vp_vs, k, mu
@@ -0,0 +1,88 @@
1
+ import numpy as np
2
+
3
+
4
+ def pressure(rho, tvd_msl, water_depth, p_form, tvd_p_form, n):
5
+ """
6
+ Function to estimate overburden pressure and vertical effective stress (lithostatic pressure)
7
+ based on density.
8
+
9
+ Parameters
10
+ ----------
11
+ rho : np.ndarray
12
+ Density log [kg/m3].
13
+ tvd_msl : np.ndarray
14
+ Vertical depth log [m].
15
+ water_depth : float
16
+ Down to this point the difference between formation pressure and overburden pressure shall be zero [m].
17
+ p_form : float
18
+ Formation pressure [Pa].
19
+ tvd_p_form : float
20
+ Depth of formation pressure point [m].
21
+ n: float
22
+ Biot coefficient [unitless].
23
+
24
+ Returns
25
+ -------
26
+ tuple
27
+ p_eff, p_lith : np.ndarray.
28
+ p_eff [Pa] - effective pressure,
29
+ p_lith [Pa] - overburden pressure.
30
+ """
31
+
32
+ # Standard brine density with salinity 40000 ppm, 2 MPa and 4 deg. C
33
+ rho_brine = 1.03e3
34
+ # Gravity constant
35
+ g = 9.80665
36
+ # Input log length
37
+ log_length = len(rho)
38
+
39
+ # Allocate output logs
40
+ p_eff = np.ones(log_length) * np.nan
41
+ p_lith = np.ones(log_length) * np.nan
42
+
43
+ # Does the depth log start at, above or below the sea bottom? We want it to
44
+ # start at sea bottom, so we get rid of values above this point.
45
+ # Also, as the tvd log normally is calculated by calling application, there can be
46
+ # undefined values, flagged as negative or NaN
47
+ idx = np.ones_like(rho, dtype=bool)
48
+ idx_inf_nan = np.any(
49
+ [np.isnan(rho), np.isinf(rho), np.isnan(tvd_msl), np.isinf(tvd_msl)], axis=0
50
+ )
51
+ idx[idx_inf_nan] = False
52
+ idx[~idx_inf_nan] = np.logical_and(
53
+ tvd_msl[~idx_inf_nan] >= water_depth, rho[~idx_inf_nan] > 0
54
+ )
55
+
56
+ # We need a starting point for pressure at water bottom - use a standard
57
+ # density value
58
+ p_wb = g * rho_brine * water_depth
59
+
60
+ # p_form is a single value. No functionality is added at present to handle p_form in log version
61
+ # Find which depth in the log that matches the calibration point best
62
+ calib_point = np.argmin(abs(tvd_msl[idx] - tvd_p_form))
63
+
64
+ # Overburden pressure
65
+ dz = np.diff(tvd_msl[idx])
66
+ # Append one sample to match the density log length
67
+ dz = np.append(dz, dz[-1])
68
+
69
+ # Find a starting point for the litho pressure at the start of the depth log
70
+ # Density at water bottom is assumed to be for a sand with 40% porosity. Take the average
71
+ # of this and the first observation of density log
72
+ ave_dens = 0.5 * ((2650 * 0.6 + rho_brine * 0.4) + rho[0])
73
+ p_lith_start = ave_dens * g * (tvd_msl[0] - water_depth)
74
+
75
+ # Estimate the overburden pressure as the gravity of the cumulative bulk
76
+ # density plus the calculated starting point and the fluid pressure at sea bottom
77
+ p_lith[idx] = np.cumsum(g * dz * rho[idx]) + p_lith_start + p_wb
78
+
79
+ # Find the effective/differential pressure at the calibration point
80
+ p_eff_calib = p_lith[idx][calib_point] - n * p_form
81
+ # In the absence of any better alternative - make a linear interpolation
82
+ # from zero at water bottom to the calculated effective pressure at the
83
+ # calibration point
84
+ p_eff[idx] = np.interp(tvd_msl[idx], [water_depth, tvd_p_form], [0, p_eff_calib])
85
+
86
+ p_lith[idx] = np.interp(tvd_msl[idx], tvd_msl[idx], p_lith[idx])
87
+
88
+ return p_eff, p_lith
@@ -0,0 +1,85 @@
1
+ import numpy as np
2
+
3
+ from rock_physics_open.equinor_utilities import gen_utilities, std_functions
4
+
5
+
6
+ def reflectivity(vp_inp, vs_inp, rho_inp, theta=0.0, k=2.0, model="AkiRichards"):
7
+ """
8
+ Reflectivity model according to Aki and Richards or Smith and Gidlow for weak contrasts
9
+ and angles less than critical angle.
10
+
11
+ In this function it is not allowed to have any missing values in the input logs.
12
+ Instead of interpolating here without the user knowing, raise an input value
13
+ exception and leave it to the user to provide complete logs.
14
+
15
+ Parameters
16
+ ----------
17
+ vp_inp : np.ndarray
18
+ Compressional wave velocity [m/s].
19
+ vs_inp : np.ndarray
20
+ Shear wave velocity [m/s].
21
+ rho_inp : np.ndarray
22
+ Bulk density [kg/m^3].
23
+ theta : float
24
+ Incidence angle [radians] (default value 0).
25
+ k : float
26
+ Background Vp/Vs ratio [ratio] (default value 2.0).
27
+ model : str
28
+ One of 'AkiRichards' (default) or 'SmithGidlow'.
29
+
30
+ Returns
31
+ -------
32
+ tuple
33
+ refl_coef, idx_inp : np.ndarray.
34
+ refl_coef: reflection coefficient [ratio],
35
+ idx_inp: index to accepted part of the input arrays [bool].
36
+ """
37
+
38
+ vp, vs, rho, theta, k = gen_utilities.dim_check_vector(
39
+ (vp_inp, vs_inp, rho_inp, theta, k)
40
+ )
41
+
42
+ idx_inp, (vp, vs, rho, theta, k) = gen_utilities.filter_input_log(
43
+ [vp, vs, rho, theta, k], positive=True
44
+ )
45
+
46
+ if np.any(~idx_inp):
47
+ # Only NaNs at the start or end? Find the first and last valid sample and check
48
+ # if there are any invalid samples in between
49
+ first_samp = np.where(idx_inp)[0][0]
50
+ last_samp = np.where(idx_inp)[0][-1]
51
+ if np.any(~idx_inp[first_samp : last_samp + 1]):
52
+ # Find the culprit(s)
53
+ idx_vp = gen_utilities.filter_input_log(
54
+ [vp_inp[first_samp : last_samp + 1]], positive=True
55
+ )[0]
56
+ idx_vs = gen_utilities.filter_input_log(
57
+ [vs_inp[first_samp : last_samp + 1]], positive=True
58
+ )[0]
59
+ idx_rho = gen_utilities.filter_input_log(
60
+ [rho_inp[first_samp : last_samp + 1]], positive=True
61
+ )[0]
62
+ log_str = (
63
+ int(np.any(~idx_vp)) * "Vp, "
64
+ + int(np.any(~idx_vs)) * "Vs, "
65
+ + int(np.any(~idx_rho)) * "Rho, "
66
+ )
67
+ pl_str = (
68
+ (int(np.any(~idx_vp)) + int(np.any(~idx_vs)) + int(np.any(~idx_rho)))
69
+ > 1
70
+ ) * "s"
71
+ raise ValueError(
72
+ "{0:} reflectivity: Missing or illegal values in input log{1:}: {2:}interpolation of input log{1:} "
73
+ "is needed\n".format(model, log_str, pl_str)
74
+ )
75
+
76
+ if model == "AkiRichards":
77
+ refl_coef = std_functions.aki_richards(vp, vs, rho, theta, k)
78
+ elif model == "SmithGidlow":
79
+ refl_coef = std_functions.smith_gidlow(vp, vs, rho, theta, k)
80
+ else:
81
+ raise ValueError(
82
+ f'{__file__}: unknown model: {model}, should be one of "AkiRichards", "SmithGidlow"'
83
+ )
84
+
85
+ return refl_coef, idx_inp
@@ -0,0 +1,91 @@
1
+ import numpy as np
2
+
3
+
4
+ def time_shift_pp(tvd, vp_base, vp_mon, multiplier):
5
+ """
6
+ Cumulative time shift calculation for 4D case. According to Equinor standard
7
+ the time shift is negative for an increase in velocity from base to monitor
8
+ survey.
9
+
10
+ Parameters
11
+ ----------
12
+ tvd : np.ndarray
13
+ True vertical depth along wellbore [m].
14
+ vp_base : np.ndarray
15
+ Initial Vp [m/s].
16
+ vp_mon : np.ndarray
17
+ vp at time of monitor survey [m/s].
18
+ multiplier : int
19
+ Time shift multiplier.
20
+
21
+ Returns
22
+ -------
23
+ tuple
24
+ owt_pp_shift, twt_pp_shift : np.ndarray.
25
+ owt_pp_shift: one way time shift [ms],
26
+ twt_pp_shift: two way time shift [ms].
27
+
28
+ Notes
29
+ -----
30
+ Original function by Sascha Bussat, Equinor
31
+ Ported to Python by Harald Flesche, Equinor 2016.
32
+
33
+ """
34
+ dx = np.diff(tvd)
35
+ dx = np.append(dx, dx[-1])
36
+
37
+ time_base = np.cumsum(dx / vp_base)
38
+ time_monitor = np.cumsum(dx / vp_mon)
39
+
40
+ owt_pp_shift = (time_monitor - time_base) * 1000 * multiplier
41
+ twt_pp_shift = 2 * owt_pp_shift
42
+
43
+ return owt_pp_shift, twt_pp_shift
44
+
45
+
46
+ def time_shift_ps(tvd, vp_base, vp_mon, vs_base, vs_mon, multiplier):
47
+ """
48
+ Cumulative time shift calculation for 4D case. According to Equinor standard
49
+ the time shift is negative for an increase in velocity from base to monitor
50
+ survey.
51
+
52
+ Parameters
53
+ ----------
54
+ tvd : np.ndarray
55
+ True vertical depth along wellbore [m].
56
+ vp_base : np.ndarray
57
+ Initial vp [m/s].
58
+ vp_mon : np.ndarray
59
+ vs at time of monitor survey [m/s].
60
+ vs_base : np.ndarray
61
+ Initial vp [m/s].
62
+ vs_mon : np.ndarray
63
+ vs at time of monitor survey [m/s].
64
+ multiplier : int
65
+ Time shift multiplier.
66
+
67
+ Returns
68
+ -------
69
+ np.ndarray
70
+ twt_ps_shift: two way time shift [ms]
71
+
72
+ Notes
73
+ -----
74
+ Original function by Sascha Bussat, Equinor
75
+ Ported to Python by Harald Flesche, Equinor 2016.
76
+
77
+ """
78
+ dx = np.diff(tvd)
79
+ dx = np.append(dx, dx[-1])
80
+
81
+ time_base_vp = np.cumsum(dx / vp_base)
82
+ time_monitor_vp = np.cumsum(dx / vp_mon)
83
+
84
+ time_base_vs = np.cumsum(dx / vs_base)
85
+ time_monitor_vs = np.cumsum(dx / vs_mon)
86
+
87
+ return (
88
+ ((time_monitor_vp - time_base_vp) + (time_monitor_vs - time_base_vs))
89
+ * 1000
90
+ * multiplier
91
+ )