gebpy 1.1.3__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.
Files changed (254) hide show
  1. gebpy/__init__.py +55 -0
  2. gebpy/__pycache__/__init__.cpython-310.pyc +0 -0
  3. gebpy/adapters/__init__.py +0 -0
  4. gebpy/cli/__init__.py +0 -0
  5. gebpy/core/__init__.py +0 -0
  6. gebpy/core/chemistry/__init__.py +0 -0
  7. gebpy/core/chemistry/common.py +1369 -0
  8. gebpy/core/chemistry/elements.py +317 -0
  9. gebpy/core/chemistry/geochemistry.py +1728 -0
  10. gebpy/core/fluids/__init__.py +0 -0
  11. gebpy/core/io/__init__.py +0 -0
  12. gebpy/core/mathematics/__init__.py +0 -0
  13. gebpy/core/minerals/__init__.py +0 -0
  14. gebpy/core/minerals/carbonates.py +412 -0
  15. gebpy/core/minerals/common.py +555 -0
  16. gebpy/core/minerals/config.py +77 -0
  17. gebpy/core/minerals/cyclosilicates.py +0 -0
  18. gebpy/core/minerals/halides.py +0 -0
  19. gebpy/core/minerals/inosilicates.py +0 -0
  20. gebpy/core/minerals/nesosilicates.py +0 -0
  21. gebpy/core/minerals/organics.py +0 -0
  22. gebpy/core/minerals/oxides.py +589 -0
  23. gebpy/core/minerals/phosphates.py +0 -0
  24. gebpy/core/minerals/phospides.py +0 -0
  25. gebpy/core/minerals/phyllosilicates.py +436 -0
  26. gebpy/core/minerals/sorosilicates.py +0 -0
  27. gebpy/core/minerals/sulfates.py +0 -0
  28. gebpy/core/minerals/sulfides.py +459 -0
  29. gebpy/core/minerals/synthesis.py +201 -0
  30. gebpy/core/minerals/tectosilicates.py +433 -0
  31. gebpy/core/physics/__init__.py +0 -0
  32. gebpy/core/physics/common.py +53 -0
  33. gebpy/core/physics/geophysics.py +351 -0
  34. gebpy/core/rocks/__init__.py +0 -0
  35. gebpy/core/rocks/anisotropic_rocks.py +395 -0
  36. gebpy/core/rocks/common.py +95 -0
  37. gebpy/core/rocks/config.py +77 -0
  38. gebpy/core/rocks/isotropic_rocks.py +395 -0
  39. gebpy/core/rocks/sedimentary.py +385 -0
  40. gebpy/core/subsurface/__init__.py +0 -0
  41. gebpy/data_minerals/__init__.py +0 -0
  42. gebpy/data_minerals/albite.yaml +59 -0
  43. gebpy/data_minerals/anatase.yaml +43 -0
  44. gebpy/data_minerals/ankerite.yaml +47 -0
  45. gebpy/data_minerals/annite.yaml +57 -0
  46. gebpy/data_minerals/anorthite.yaml +59 -0
  47. gebpy/data_minerals/antigorite.yaml +53 -0
  48. gebpy/data_minerals/aragonite.yaml +48 -0
  49. gebpy/data_minerals/argutite.yaml +43 -0
  50. gebpy/data_minerals/arsenolite.yaml +40 -0
  51. gebpy/data_minerals/au3oxide.yaml +46 -0
  52. gebpy/data_minerals/avicennite.yaml +40 -0
  53. gebpy/data_minerals/azurite.yaml +53 -0
  54. gebpy/data_minerals/baddeleyite.yaml +49 -0
  55. gebpy/data_minerals/bismite.yaml +49 -0
  56. gebpy/data_minerals/boehmite.yaml +48 -0
  57. gebpy/data_minerals/brookite.yaml +46 -0
  58. gebpy/data_minerals/brucite.yaml +45 -0
  59. gebpy/data_minerals/bunsenite.yaml +40 -0
  60. gebpy/data_minerals/calcite.yaml +45 -0
  61. gebpy/data_minerals/cassiterite.yaml +43 -0
  62. gebpy/data_minerals/cerussite.yaml +48 -0
  63. gebpy/data_minerals/chamosite.yaml +56 -0
  64. gebpy/data_minerals/chlorite.yaml +75 -0
  65. gebpy/data_minerals/chromite.yaml +42 -0
  66. gebpy/data_minerals/chrysotile.yaml +53 -0
  67. gebpy/data_minerals/claudetite.yaml +49 -0
  68. gebpy/data_minerals/clinochlore.yaml +55 -0
  69. gebpy/data_minerals/cochromite.yaml +42 -0
  70. gebpy/data_minerals/corundum.yaml +43 -0
  71. gebpy/data_minerals/crocoite.yaml +51 -0
  72. gebpy/data_minerals/cuprite.yaml +40 -0
  73. gebpy/data_minerals/cuprospinel.yaml +42 -0
  74. gebpy/data_minerals/diaspore.yaml +48 -0
  75. gebpy/data_minerals/dolomite.yaml +47 -0
  76. gebpy/data_minerals/eastonite.yaml +57 -0
  77. gebpy/data_minerals/eskolaite.yaml +43 -0
  78. gebpy/data_minerals/fechlorite.yaml +61 -0
  79. gebpy/data_minerals/fecolumbite.yaml +48 -0
  80. gebpy/data_minerals/ferberite.yaml +51 -0
  81. gebpy/data_minerals/fetantalite.yaml +48 -0
  82. gebpy/data_minerals/franklinite.yaml +42 -0
  83. gebpy/data_minerals/gahnite.yaml +42 -0
  84. gebpy/data_minerals/galaxite.yaml +42 -0
  85. gebpy/data_minerals/geikielite.yaml +45 -0
  86. gebpy/data_minerals/gibbsite.yaml +51 -0
  87. gebpy/data_minerals/glauconite.yaml +69 -0
  88. gebpy/data_minerals/goethite.yaml +48 -0
  89. gebpy/data_minerals/groutite.yaml +48 -0
  90. gebpy/data_minerals/hematite.yaml +43 -0
  91. gebpy/data_minerals/hercynite.yaml +42 -0
  92. gebpy/data_minerals/huebnerite.yaml +51 -0
  93. gebpy/data_minerals/ikaite.yaml +53 -0
  94. gebpy/data_minerals/illite.yaml +55 -0
  95. gebpy/data_minerals/ilmenite.yaml +45 -0
  96. gebpy/data_minerals/jacobsite.yaml +42 -0
  97. gebpy/data_minerals/kalsilite.yaml +47 -0
  98. gebpy/data_minerals/kaolinite.yaml +59 -0
  99. gebpy/data_minerals/karelianite.yaml +43 -0
  100. gebpy/data_minerals/lime.yaml +40 -0
  101. gebpy/data_minerals/litharge.yaml +43 -0
  102. gebpy/data_minerals/magnesiochromite.yaml +42 -0
  103. gebpy/data_minerals/magnesioferrite.yaml +42 -0
  104. gebpy/data_minerals/magnesite.yaml +45 -0
  105. gebpy/data_minerals/magnetite.yaml +41 -0
  106. gebpy/data_minerals/malachite.yaml +53 -0
  107. gebpy/data_minerals/manganite.yaml +51 -0
  108. gebpy/data_minerals/manganochromite.yaml +42 -0
  109. gebpy/data_minerals/manganosite.yaml +40 -0
  110. gebpy/data_minerals/marialite.yaml +49 -0
  111. gebpy/data_minerals/massicot.yaml +46 -0
  112. gebpy/data_minerals/meionite.yaml +49 -0
  113. gebpy/data_minerals/mgchlorite.yaml +61 -0
  114. gebpy/data_minerals/mgcolumbite.yaml +48 -0
  115. gebpy/data_minerals/mgtantalite.yaml +48 -0
  116. gebpy/data_minerals/microcline.yaml +59 -0
  117. gebpy/data_minerals/minium.yaml +44 -0
  118. gebpy/data_minerals/mnchlorite.yaml +61 -0
  119. gebpy/data_minerals/mncolumbite.yaml +48 -0
  120. gebpy/data_minerals/mntantalite.yaml +48 -0
  121. gebpy/data_minerals/monteponite.yaml +40 -0
  122. gebpy/data_minerals/montmorillonite.yaml +77 -0
  123. gebpy/data_minerals/muscovite.yaml +55 -0
  124. gebpy/data_minerals/nanepheline.yaml +47 -0
  125. gebpy/data_minerals/nichlorite.yaml +61 -0
  126. gebpy/data_minerals/nichromite.yaml +42 -0
  127. gebpy/data_minerals/nimite.yaml +55 -0
  128. gebpy/data_minerals/nontronite.yaml +73 -0
  129. gebpy/data_minerals/orthoclase.yaml +53 -0
  130. gebpy/data_minerals/paratellurite.yaml +43 -0
  131. gebpy/data_minerals/pennantite.yaml +61 -0
  132. gebpy/data_minerals/periclase.yaml +40 -0
  133. gebpy/data_minerals/phlogopite.yaml +57 -0
  134. gebpy/data_minerals/plattnerite.yaml +43 -0
  135. gebpy/data_minerals/powellite.yaml +45 -0
  136. gebpy/data_minerals/pyrite.yaml +40 -0
  137. gebpy/data_minerals/pyrolusite.yaml +43 -0
  138. gebpy/data_minerals/pyrophanite.yaml +45 -0
  139. gebpy/data_minerals/pyrophyllite.yaml +59 -0
  140. gebpy/data_minerals/quartz.yaml +43 -0
  141. gebpy/data_minerals/rhodochrosite.yaml +45 -0
  142. gebpy/data_minerals/rutile.yaml +43 -0
  143. gebpy/data_minerals/saponite.yaml +77 -0
  144. gebpy/data_minerals/scheelite.yaml +45 -0
  145. gebpy/data_minerals/scrutinyite.yaml +46 -0
  146. gebpy/data_minerals/senarmontite.yaml +40 -0
  147. gebpy/data_minerals/siderite.yaml +45 -0
  148. gebpy/data_minerals/siderophyllite.yaml +57 -0
  149. gebpy/data_minerals/smithsonite.yaml +45 -0
  150. gebpy/data_minerals/spinel.yaml +42 -0
  151. gebpy/data_minerals/stishovite.yaml +43 -0
  152. gebpy/data_minerals/stolzite.yaml +45 -0
  153. gebpy/data_minerals/talc.yaml +53 -0
  154. gebpy/data_minerals/tistarite.yaml +43 -0
  155. gebpy/data_minerals/trevorite.yaml +42 -0
  156. gebpy/data_minerals/ulvoespinel.yaml +42 -0
  157. gebpy/data_minerals/uraninite.yaml +40 -0
  158. gebpy/data_minerals/valentinite.yaml +46 -0
  159. gebpy/data_minerals/vermiculite.yaml +69 -0
  160. gebpy/data_minerals/wulfenite.yaml +45 -0
  161. gebpy/data_minerals/wustite.yaml +40 -0
  162. gebpy/data_minerals/zincite.yaml +43 -0
  163. gebpy/data_minerals/zincochromite.yaml +42 -0
  164. gebpy/data_rocks/__init__.py +0 -0
  165. gebpy/data_rocks/dolostone.yaml +40 -0
  166. gebpy/data_rocks/limestone.yaml +40 -0
  167. gebpy/data_rocks/marl.yaml +50 -0
  168. gebpy/data_rocks/sandstone.yaml +39 -0
  169. gebpy/data_rocks/shale.yaml +50 -0
  170. gebpy/gebpy_app.py +8732 -0
  171. gebpy/gui/__init__.py +0 -0
  172. gebpy/lib/images/GebPy_Header.png +0 -0
  173. gebpy/lib/images/GebPy_Icon.png +0 -0
  174. gebpy/lib/images/GebPy_Logo.png +0 -0
  175. gebpy/main.py +29 -0
  176. gebpy/modules/__init__.py +0 -0
  177. gebpy/modules/__pycache__/__init__.cpython-310.pyc +0 -0
  178. gebpy/modules/__pycache__/metamorphics.cpython-310.pyc +0 -0
  179. gebpy/modules/__pycache__/silicates.cpython-310.pyc +0 -0
  180. gebpy/modules/carbonates.py +2658 -0
  181. gebpy/modules/chemistry.py +1369 -0
  182. gebpy/modules/core.py +1805 -0
  183. gebpy/modules/elements.py +317 -0
  184. gebpy/modules/evaporites.py +1299 -0
  185. gebpy/modules/exploration.py +1145 -0
  186. gebpy/modules/fluids.py +339 -0
  187. gebpy/modules/geochemistry.py +1727 -0
  188. gebpy/modules/geophysics.py +351 -0
  189. gebpy/modules/gui.py +9093 -0
  190. gebpy/modules/gui_elements.py +145 -0
  191. gebpy/modules/halides.py +485 -0
  192. gebpy/modules/igneous.py +2241 -0
  193. gebpy/modules/metamorphics.py +3222 -0
  194. gebpy/modules/mineralogy.py +442 -0
  195. gebpy/modules/minerals.py +7954 -0
  196. gebpy/modules/ore.py +1648 -0
  197. gebpy/modules/organics.py +530 -0
  198. gebpy/modules/oxides.py +9057 -0
  199. gebpy/modules/petrophysics.py +98 -0
  200. gebpy/modules/phosphates.py +589 -0
  201. gebpy/modules/phospides.py +194 -0
  202. gebpy/modules/plotting.py +619 -0
  203. gebpy/modules/pyllosilicates.py +380 -0
  204. gebpy/modules/sedimentary_rocks.py +908 -0
  205. gebpy/modules/sequences.py +2166 -0
  206. gebpy/modules/series.py +1625 -0
  207. gebpy/modules/silicates.py +11102 -0
  208. gebpy/modules/siliciclastics.py +1846 -0
  209. gebpy/modules/subsurface_2d.py +179 -0
  210. gebpy/modules/sulfates.py +1629 -0
  211. gebpy/modules/sulfides.py +4786 -0
  212. gebpy/plotting/__init__.py +0 -0
  213. gebpy/ui_nb/__init__.py +0 -0
  214. gebpy/user_data/.gitkeep +0 -0
  215. gebpy-1.1.3.dist-info/LICENSE +165 -0
  216. gebpy-1.1.3.dist-info/METADATA +207 -0
  217. gebpy-1.1.3.dist-info/RECORD +254 -0
  218. gebpy-1.1.3.dist-info/WHEEL +5 -0
  219. gebpy-1.1.3.dist-info/entry_points.txt +2 -0
  220. gebpy-1.1.3.dist-info/top_level.txt +1 -0
  221. modules/__init__.py +0 -0
  222. modules/carbonates.py +2658 -0
  223. modules/chemistry.py +1369 -0
  224. modules/core.py +1805 -0
  225. modules/elements.py +317 -0
  226. modules/evaporites.py +1299 -0
  227. modules/exploration.py +765 -0
  228. modules/fluids.py +339 -0
  229. modules/geochemistry.py +1727 -0
  230. modules/geophysics.py +337 -0
  231. modules/gui.py +9093 -0
  232. modules/gui_elements.py +145 -0
  233. modules/halides.py +485 -0
  234. modules/igneous.py +2196 -0
  235. modules/metamorphics.py +2699 -0
  236. modules/mineralogy.py +442 -0
  237. modules/minerals.py +7954 -0
  238. modules/ore.py +1628 -0
  239. modules/organics.py +530 -0
  240. modules/oxides.py +9057 -0
  241. modules/petrophysics.py +98 -0
  242. modules/phosphates.py +589 -0
  243. modules/phospides.py +194 -0
  244. modules/plotting.py +619 -0
  245. modules/pyllosilicates.py +380 -0
  246. modules/sedimentary_rocks.py +908 -0
  247. modules/sequences.py +2166 -0
  248. modules/series.py +1625 -0
  249. modules/silicates.py +11102 -0
  250. modules/siliciclastics.py +1830 -0
  251. modules/subsurface_2d.py +179 -0
  252. modules/sulfates.py +1629 -0
  253. modules/sulfides.py +4786 -0
  254. notebooks/__init__.py +0 -0
@@ -0,0 +1,98 @@
1
+ #!/usr/bin/env python
2
+ # -*-coding: utf-8 -*-
3
+
4
+ #-----------------------------------------------
5
+
6
+ # Name: petrophysics.py
7
+ # Author: Maximilian A. Beeskow
8
+ # Version: 1.0
9
+ # Date: 24.10.2023
10
+
11
+ #-----------------------------------------------
12
+
13
+ ## MODULES
14
+ import numpy as np
15
+ import random as rd
16
+
17
+ ## METHODS
18
+ class SolidProperties:
19
+ #
20
+ def __init__(self, value_amount, value_property):
21
+ self.value_amount = value_amount
22
+ self.value_property = value_property
23
+ #
24
+ def calculate_solid_density(self):
25
+ pass
26
+
27
+ class SeismicVelocities:
28
+ #
29
+ def __init__(self, rho_solid, rho_fluid):
30
+ self.rho_solid = rho_solid
31
+ self.rho_fluid = rho_fluid
32
+ #
33
+ def calculate_seismic_velocities(self, rho_limits, vP_limits, vS_limits, delta, porosity):
34
+ ## Density
35
+ rho_min = rho_limits[0]
36
+ rho_max = rho_limits[1]
37
+ ## Seismic Velocities
38
+ center = 1.00
39
+ upper_limit = center + delta
40
+ lower_limit = center - delta
41
+ #
42
+ # P-Wave
43
+ vP_min_theo = vP_limits[0]
44
+ vP_max_theo = vP_limits[1]
45
+ vP_min_sim_upper = int(rd.uniform(center, upper_limit)*vP_min_theo)
46
+ vP_mib_sim_lower = int(rd.uniform(lower_limit, center)*vP_min_theo)
47
+ vP_max_sim_upper = int(rd.uniform(center, upper_limit)*vP_max_theo)
48
+ vP_max_sim_lower = int(rd.uniform(lower_limit, center)*vP_max_theo)
49
+ vP_min = rd.randint(vP_mib_sim_lower, vP_min_sim_upper)
50
+ vP_max = rd.randint(vP_max_sim_lower, vP_max_sim_upper)
51
+ #
52
+ # S-Wave
53
+ vS_min_theo = vS_limits[0]
54
+ vS_max_theo = vS_limits[1]
55
+ vS_min_sim_upper = int(rd.uniform(center, upper_limit)*vS_min_theo)
56
+ vS_mib_sim_lower = int(rd.uniform(lower_limit, center)*vS_min_theo)
57
+ vS_max_sim_upper = int(rd.uniform(center, upper_limit)*vS_max_theo)
58
+ vS_max_sim_lower = int(rd.uniform(lower_limit, center)*vS_max_theo)
59
+ vS_min = rd.randint(vS_mib_sim_lower, vS_min_sim_upper)
60
+ vS_max = rd.randint(vS_max_sim_lower, vS_max_sim_upper)
61
+ #
62
+ constant_a_P = (vP_max - vP_min)/(rho_max - rho_min)
63
+ constant_b_P = vP_max - constant_a_P*rho_max
64
+ constant_a_S = (vS_max - vS_min)/(rho_max - rho_min)
65
+ constant_b_S = vS_max - constant_a_S*rho_max
66
+ #
67
+ condition_v = False
68
+ while condition_v == False:
69
+ ## Porosity
70
+ var_porosity = round(rd.uniform(porosity[0], porosity[1]), 4)
71
+ #
72
+ ## Density
73
+ rho = round((1 - var_porosity)*self.rho_solid + var_porosity*self.rho_fluid, 3)
74
+ #
75
+ ## Seismic Velocities
76
+ vP = constant_a_P * rho + constant_b_P
77
+ #
78
+ if vP_min <= vP <= vP_max:
79
+ vS = constant_a_S * rho + constant_b_S
80
+ if vS_min <= vS <= vS_max:
81
+ condition_v = True
82
+ # else:
83
+ # print("rho:", rho, "vS:", vS)
84
+ # else:
85
+ # print("rho:", rho, "vP:", vP, vP_max, vP_min)
86
+ #
87
+ vPvS = round(vP/vS, 4)
88
+ #
89
+ return vP, vS, vPvS, rho, var_porosity
90
+ #
91
+ def calculate_elastic_properties(self, rho, vP, vS):
92
+ ## Elastic Parameters
93
+ bulk_modulus = round(rho*(vP**2 - 4/3*vS**2)*10**(-9), 3)
94
+ shear_modulus = round((rho*vS**2)*10**(-9), 3)
95
+ youngs_modulus = round((9*bulk_modulus*shear_modulus)/(3*bulk_modulus + shear_modulus), 3)
96
+ poisson_ratio = round((3*bulk_modulus - 2*shear_modulus)/(6*bulk_modulus + 2*shear_modulus), 4)
97
+ #
98
+ return bulk_modulus, shear_modulus, youngs_modulus, poisson_ratio
modules/phosphates.py ADDED
@@ -0,0 +1,589 @@
1
+ #!/usr/bin/env python
2
+ # -*-coding: utf-8 -*-
3
+
4
+ # -----------------------------------------------
5
+
6
+ # Name: phosphates.py
7
+ # Author: Maximilian A. Beeskow
8
+ # Version: 1.0
9
+ # Date: 16.11.2023
10
+
11
+ # -----------------------------------------------
12
+
13
+ # MODULES
14
+ import numpy as np
15
+ import random as rd
16
+ from scipy import stats
17
+ from modules.chemistry import PeriodicSystem, DataProcessing, OxideCompounds
18
+ from modules.minerals import CrystalPhysics
19
+ from modules.geophysics import BoreholeGeophysics as bg
20
+ from modules.geophysics import WellLog as wg
21
+ from modules.geochemistry import MineralChemistry, TraceElements
22
+ #
23
+ # Phosphates
24
+ class Phosphates:
25
+ """ Class that generates geophysical and geochemical data of phosphate minerals"""
26
+ #
27
+ def __init__(self, traces_list=[], impurity="pure", data_type=False, mineral=None):
28
+ self.traces_list = traces_list
29
+ self.impurity = impurity
30
+ self.data_type = data_type
31
+ self.mineral = mineral
32
+ #
33
+ def generate_dataset(self, number):
34
+ dataset = {}
35
+ #
36
+ for index in range(number):
37
+ if self.mineral == "Apatite":
38
+ data_mineral = self.create_aptite()
39
+ elif self.mineral == "Fluoroapatite":
40
+ data_mineral = self.create_aptite_f()
41
+ elif self.mineral == "Chloroapatite":
42
+ data_mineral = self.create_aptite_cl()
43
+ elif self.mineral == "Hydroxyapatite":
44
+ data_mineral = self.create_aptite_oh()
45
+ #
46
+ for key, value in data_mineral.items():
47
+ if key in ["M", "rho", "rho_e", "V", "vP", "vS", "vP/vS", "K", "G", "E", "nu", "GR", "PE", "U", "p"]:
48
+ if key not in dataset:
49
+ dataset[key] = [value]
50
+ else:
51
+ dataset[key].append(value)
52
+ elif key in ["mineral", "state", "trace elements"] and key not in dataset:
53
+ dataset[key] = value
54
+ elif key in ["chemistry", "compounds"]:
55
+ if key not in dataset:
56
+ dataset[key] = {}
57
+ for key_2, value_2 in value.items():
58
+ dataset[key][key_2] = [value_2]
59
+ else:
60
+ for key_2, value_2 in value.items():
61
+ dataset[key][key_2].append(value_2)
62
+ #
63
+ return dataset
64
+ #
65
+ def create_aptite_f(self): # Ca5 F (PO4)3
66
+ # Major elements
67
+ oxygen = PeriodicSystem(name="O").get_data()
68
+ fluorine = PeriodicSystem(name="F").get_data()
69
+ phosphorus = PeriodicSystem(name="P").get_data()
70
+ calcium = PeriodicSystem(name="Ca").get_data()
71
+ majors_name = ["O", "F", "P", "Ca"]
72
+ majors_data = np.array([["O", oxygen[1], 12, oxygen[2]], ["F", fluorine[1], 1, fluorine[2]],
73
+ ["P", phosphorus[1], 3, phosphorus[2]], ["Ca", calcium[1], 5, calcium[2]]], dtype=object)
74
+ # Minor elements
75
+ traces_data = []
76
+ if len(self.traces_list) > 0:
77
+ self.impurity = "impure"
78
+ if self.impurity == "pure":
79
+ var_state = "fixed"
80
+ else:
81
+ var_state = "variable"
82
+ self.traces_list = []
83
+ minors_x = ["Ti", "Zr", "Hf", "Th"] # mainly 4+
84
+ minors_y = ["La", "Ce", "Pr", "Nd", "Sm", "Eu", "Gd", "Dy", "Y", "Er", "Cr", "As"] # mainly 3+
85
+ minors_z = ["Cl", "H", "Rb"] # mainly 1+
86
+ minors_w = ["Mn", "Co", "Sr", "Ba", "Pb"] # mainly 2+
87
+ if self.impurity == "random":
88
+ n_x = rd.randint(0, len(minors_x))
89
+ n_y = rd.randint(0, len(minors_y))
90
+ n_w = rd.randint(0, len(minors_w))
91
+ if n_x > 0:
92
+ selection_x = rd.sample(minors_x, n_x)
93
+ self.traces_list.extend(selection_x)
94
+ if n_y > 0 and n_w == 0:
95
+ n_z = rd.randint(1, n_y)
96
+ selection_y = rd.sample(minors_y, n_y)
97
+ selection_z = rd.sample(minors_z, n_z)
98
+ self.traces_list.extend(selection_y)
99
+ self.traces_list.extend(selection_z)
100
+ if n_w > 0 and n_y == 0:
101
+ n_z = rd.randint(1, n_w)
102
+ selection_w = rd.sample(minors_w, n_w)
103
+ selection_z = rd.sample(minors_z, n_z)
104
+ self.traces_list.extend(selection_w)
105
+ self.traces_list.extend(selection_z)
106
+ if n_y > 0 and n_w > 0:
107
+ if n_y + n_w <= len(minors_z):
108
+ n_z = rd.randint(1, (n_y + n_w))
109
+ else:
110
+ n_z = len(minors_z)
111
+ selection_y = rd.sample(minors_y, n_y)
112
+ selection_w = rd.sample(minors_w, n_w)
113
+ selection_z = rd.sample(minors_z, n_z)
114
+ self.traces_list.extend(selection_y)
115
+ self.traces_list.extend(selection_w)
116
+ self.traces_list.extend(selection_z)
117
+ elif self.impurity != "random":
118
+ self.traces_list = []
119
+ for element in self.impurity:
120
+ if element in minors_x:
121
+ self.traces_list.append(element)
122
+ elif element in minors_y:
123
+ self.traces_list.append(element)
124
+ elif element in minors_z:
125
+ self.traces_list.append(element)
126
+ elif element in minors_w:
127
+ self.traces_list.append(element)
128
+ # minors = ["Cl", "La", "Ce", "Pr", "Nd", "Sm", "Eu", "Gd", "Dy", "Y", "Er", "Mn", "H"]
129
+ # n = rd.randint(1, len(minors))
130
+ # while len(self.traces_list) < n:
131
+ # selection = rd.choice(minors)
132
+ # if selection not in self.traces_list and selection not in majors_name:
133
+ # self.traces_list.append(selection)
134
+ # else:
135
+ # continue
136
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
137
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
138
+ for i in range(len(self.traces_list)):
139
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
140
+ if len(traces_data) > 0:
141
+ traces_data = np.array(traces_data, dtype=object)
142
+ traces_data = traces_data[traces_data[:, 1].argsort()]
143
+ #
144
+ data = []
145
+ mineral = "Ap"
146
+ #
147
+ # Molar mass
148
+ try:
149
+ molar_mass_pure = 5*calcium[2] + fluorine[2] + 3*(phosphorus[2] + 4*oxygen[2])
150
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
151
+ majors=majors_data).calculate_molar_mass()
152
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
153
+ except:
154
+ compositon_data = TraceElements(tracer=self.traces_list).calculate_composition_apatite_f()
155
+ molar_mass = 0
156
+ amounts = []
157
+ for element in compositon_data:
158
+ chem_data = PeriodicSystem(name=element).get_data()
159
+ molar_mass += compositon_data[element]["x"]*chem_data[2]
160
+ amounts.append([chem_data[0], chem_data[1], compositon_data[element]["w"]])
161
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
162
+ # Density
163
+ dataV = CrystalPhysics([[9.367, 6.884], [], "hexagonal"])
164
+ V = dataV.calculate_volume()
165
+ Z = 2
166
+ V_m = MineralChemistry().calculate_molar_volume(volume_cell=V, z=Z)
167
+ dataRho = CrystalPhysics([molar_mass, Z, V*10**(6)])
168
+ rho = dataRho.calculate_bulk_density()
169
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
170
+ # Bulk modulus
171
+ K = 83*10**9
172
+ # Shear modulus
173
+ G = 41*10**9
174
+ # Young's modulus
175
+ E = (9*K*G)/(3*K + G)
176
+ # Poisson's ratio
177
+ nu = (3*K - 2*G)/(2*(3*K + G))
178
+ # vP/vS
179
+ vPvS = ((K + 4/3*G)/G)**0.5
180
+ # P-wave velocity
181
+ vP = ((K + 4/3*G)/rho)**0.5
182
+ # S-wave velocity
183
+ vS = (G/rho)**0.5
184
+ # Gamma ray
185
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
186
+ # Photoelectricity
187
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
188
+ U = pe*rho_e*10**(-3)
189
+ # Electrical resistivity
190
+ p = None
191
+ #
192
+ if self.data_type == False:
193
+ data.append(mineral)
194
+ data.append(round(molar_mass, 3))
195
+ data.append(round(rho, 2))
196
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
197
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
198
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
199
+ data.append(amounts)
200
+ #
201
+ return data
202
+ else:
203
+ #
204
+ results = {}
205
+ results["mineral"] = mineral
206
+ results["M"] = molar_mass
207
+ results["state"] = var_state
208
+ element_list = np.array(amounts)[:, 0]
209
+ results["chemistry"] = {}
210
+ for index, element in enumerate(element_list, start=0):
211
+ results["chemistry"][element] = amounts[index][2]
212
+ results["rho"] = round(rho, 4)
213
+ results["rho_e"] = round(rho_e, 4)
214
+ results["V"] = round(V_m, 4)
215
+ results["vP"] = round(vP, 4)
216
+ results["vS"] = round(vS, 4)
217
+ results["vP/vS"] = round(vPvS, 4)
218
+ results["G"] = round(G*10**(-9), 4)
219
+ results["K"] = round(K*10**(-9), 4)
220
+ results["E"] = round(E*10**(-9), 4)
221
+ results["nu"] = round(nu, 4)
222
+ results["GR"] = round(gamma_ray, 4)
223
+ results["PE"] = round(pe, 4)
224
+ results["U"] = round(U, 4)
225
+ if p != None:
226
+ results["p"] = round(p, 4)
227
+ else:
228
+ results["p"] = p
229
+ #
230
+ return results
231
+ #
232
+ def create_aptite_cl(self): # Ca5 Cl (PO4)3
233
+ # Major elements
234
+ oxygen = PeriodicSystem(name="O").get_data()
235
+ phosphorus = PeriodicSystem(name="P").get_data()
236
+ chlorine = PeriodicSystem(name="Cl").get_data()
237
+ calcium = PeriodicSystem(name="Ca").get_data()
238
+ majors_name = ["O", "P", "Cl", "Ca"]
239
+ majors_data = np.array([["O", oxygen[1], 12, oxygen[2]], ["P", phosphorus[1], 3, phosphorus[2]],
240
+ ["Cl", chlorine[1], 1, chlorine[2]], ["Ca", calcium[1], 5, calcium[2]]], dtype=object)
241
+ # Minor elements
242
+ traces_data = []
243
+ if len(self.traces_list) > 0:
244
+ self.impurity = "impure"
245
+ if self.impurity == "random":
246
+ self.traces_list = []
247
+ minors = ["F", "La", "Ce", "Pr", "Nd", "Sm", "Eu", "Gd", "Dy", "Y", "Er", "Mn", "H"]
248
+ n = rd.randint(1, len(minors))
249
+ while len(self.traces_list) < n:
250
+ selection = rd.choice(minors)
251
+ if selection not in self.traces_list and selection not in majors_name:
252
+ self.traces_list.append(selection)
253
+ else:
254
+ continue
255
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
256
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
257
+ for i in range(len(self.traces_list)):
258
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
259
+ if len(traces_data) > 0:
260
+ traces_data = np.array(traces_data, dtype=object)
261
+ traces_data = traces_data[traces_data[:, 1].argsort()]
262
+ #
263
+ data = []
264
+ mineral = "Ap"
265
+ #
266
+ # Molar mass
267
+ molar_mass_pure = 5*calcium[2] + chlorine[2] + 3*(phosphorus[2] + 4*oxygen[2])
268
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
269
+ majors=majors_data).calculate_molar_mass()
270
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
271
+ # Density
272
+ dataV = CrystalPhysics([[9.598, 6.776], [], "hexagonal"])
273
+ V = dataV.calculate_volume()
274
+ Z = 2
275
+ V_m = MineralChemistry().calculate_molar_volume(volume_cell=V, z=Z)
276
+ dataRho = CrystalPhysics([molar_mass, Z, V*10**(6)])
277
+ rho = dataRho.calculate_bulk_density()
278
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
279
+ # Bulk modulus
280
+ K = 98.70*10**9
281
+ # Shear modulus
282
+ G = 61.17*10**9
283
+ # Young's modulus
284
+ E = (9*K*G)/(3*K + G)
285
+ # Poisson's ratio
286
+ nu = (3*K - 2*G)/(2*(3*K + G))
287
+ # vP/vS
288
+ vPvS = ((K + 4/3*G)/G)**0.5
289
+ # P-wave velocity
290
+ vP = ((K + 4/3*G)/rho)**0.5
291
+ # S-wave velocity
292
+ vS = (G/rho)**0.5
293
+ # Gamma ray
294
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
295
+ # Photoelectricity
296
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
297
+ U = pe*rho_e*10**(-3)
298
+ # Electrical resistivity
299
+ p = None
300
+ #
301
+ if self.data_type == False:
302
+ data.append(mineral)
303
+ data.append(round(molar_mass, 3))
304
+ data.append(round(rho, 2))
305
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
306
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
307
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
308
+ data.append(amounts)
309
+ #
310
+ return data
311
+ else:
312
+ #
313
+ results = {}
314
+ results["mineral"] = mineral
315
+ results["M"] = molar_mass
316
+ element_list = np.array(amounts)[:, 0]
317
+ results["chemistry"] = {}
318
+ for index, element in enumerate(element_list, start=0):
319
+ results["chemistry"][element] = amounts[index][2]
320
+ results["rho"] = round(rho, 4)
321
+ results["rho_e"] = round(rho_e, 4)
322
+ results["V"] = round(V_m, 4)
323
+ results["vP"] = round(vP, 4)
324
+ results["vS"] = round(vS, 4)
325
+ results["vP/vS"] = round(vPvS, 4)
326
+ results["G"] = round(G*10**(-9), 4)
327
+ results["K"] = round(K*10**(-9), 4)
328
+ results["E"] = round(E*10**(-9), 4)
329
+ results["nu"] = round(nu, 4)
330
+ results["GR"] = round(gamma_ray, 4)
331
+ results["PE"] = round(pe, 4)
332
+ results["U"] = round(U, 4)
333
+ if p != None:
334
+ results["p"] = round(p, 4)
335
+ else:
336
+ results["p"] = p
337
+ #
338
+ return results
339
+ #
340
+ def create_aptite_oh(self): # Ca5 OH (PO4)3
341
+ # Major elements
342
+ hydrogen = PeriodicSystem(name="H").get_data()
343
+ oxygen = PeriodicSystem(name="O").get_data()
344
+ phosphorus = PeriodicSystem(name="P").get_data()
345
+ calcium = PeriodicSystem(name="Ca").get_data()
346
+ majors_name = ["H", "O", "P", "Ca"]
347
+ majors_data = np.array([["H", hydrogen[1], 1, hydrogen[2]], ["O", oxygen[1], 13, oxygen[2]],
348
+ ["P", phosphorus[1], 3, phosphorus[2]], ["Ca", calcium[1], 5, calcium[2]]], dtype=object)
349
+ # Minor elements
350
+ traces_data = []
351
+ if len(self.traces_list) > 0:
352
+ self.impurity = "impure"
353
+ if self.impurity == "random":
354
+ self.traces_list = []
355
+ minors = ["F", "La", "Ce", "Pr", "Nd", "Sm", "Eu", "Gd", "Dy", "Y", "Er", "Mn", "Cl"]
356
+ n = rd.randint(1, len(minors))
357
+ while len(self.traces_list) < n:
358
+ selection = rd.choice(minors)
359
+ if selection not in self.traces_list and selection not in majors_name:
360
+ self.traces_list.append(selection)
361
+ else:
362
+ continue
363
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
364
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
365
+ for i in range(len(self.traces_list)):
366
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
367
+ if len(traces_data) > 0:
368
+ traces_data = np.array(traces_data, dtype=object)
369
+ traces_data = traces_data[traces_data[:, 1].argsort()]
370
+ #
371
+ data = []
372
+ mineral = "Ap"
373
+ #
374
+ # Molar mass
375
+ molar_mass_pure = 5*calcium[2] + (hydrogen[2] + oxygen[2]) + 3*(phosphorus[2] + 4*oxygen[2])
376
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
377
+ majors=majors_data).calculate_molar_mass()
378
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
379
+ # Density
380
+ dataV = CrystalPhysics([[9.418, 6.875], [], "hexagonal"])
381
+ V = dataV.calculate_volume()
382
+ Z = 2
383
+ V_m = MineralChemistry().calculate_molar_volume(volume_cell=V, z=Z)
384
+ dataRho = CrystalPhysics([molar_mass, Z, V*10**(6)])
385
+ rho = dataRho.calculate_bulk_density()
386
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
387
+ # Bulk modulus
388
+ K = 105.01*10**9
389
+ # Shear modulus
390
+ G = 62.69*10**9
391
+ # Young's modulus
392
+ E = (9*K*G)/(3*K + G)
393
+ # Poisson's ratio
394
+ nu = (3*K - 2*G)/(2*(3*K + G))
395
+ # vP/vS
396
+ vPvS = ((K + 4/3*G)/G)**0.5
397
+ # P-wave velocity
398
+ vP = ((K + 4/3*G)/rho)**0.5
399
+ # S-wave velocity
400
+ vS = (G/rho)**0.5
401
+ # Gamma ray
402
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
403
+ # Photoelectricity
404
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
405
+ U = pe*rho_e*10**(-3)
406
+ # Electrical resistivity
407
+ p = None
408
+ #
409
+ if self.data_type == False:
410
+ data.append(mineral)
411
+ data.append(round(molar_mass, 3))
412
+ data.append(round(rho, 2))
413
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
414
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
415
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
416
+ data.append(amounts)
417
+ #
418
+ return data
419
+ else:
420
+ #
421
+ results = {}
422
+ results["mineral"] = mineral
423
+ results["M"] = molar_mass
424
+ element_list = np.array(amounts)[:, 0]
425
+ results["chemistry"] = {}
426
+ for index, element in enumerate(element_list, start=0):
427
+ results["chemistry"][element] = amounts[index][2]
428
+ results["rho"] = round(rho, 4)
429
+ results["rho_e"] = round(rho_e, 4)
430
+ results["V"] = round(V_m, 4)
431
+ results["vP"] = round(vP, 4)
432
+ results["vS"] = round(vS, 4)
433
+ results["vP/vS"] = round(vPvS, 4)
434
+ results["G"] = round(G*10**(-9), 4)
435
+ results["K"] = round(K*10**(-9), 4)
436
+ results["E"] = round(E*10**(-9), 4)
437
+ results["nu"] = round(nu, 4)
438
+ results["GR"] = round(gamma_ray, 4)
439
+ results["PE"] = round(pe, 4)
440
+ results["U"] = round(U, 4)
441
+ if p != None:
442
+ results["p"] = round(p, 4)
443
+ else:
444
+ results["p"] = p
445
+ #
446
+ return results
447
+ #
448
+ def create_aptite(self): # Ca5 (F,Cl,OH) (PO4)3
449
+ mineral = "Ap"
450
+ # Major elements
451
+ hydrogen = PeriodicSystem(name="H").get_data()
452
+ oxygen = PeriodicSystem(name="O").get_data()
453
+ fluorine = PeriodicSystem(name="F").get_data()
454
+ phosphorus = PeriodicSystem(name="P").get_data()
455
+ chlorine = PeriodicSystem(name="Cl").get_data()
456
+ calcium = PeriodicSystem(name="Ca").get_data()
457
+ majors_name = ["H", "O", "F", "P", "Cl", "Ca"]
458
+ a = round(rd.uniform(0, 1), 4)
459
+ b = round(rd.uniform(0, (1-a)), 4)
460
+ c = round(1-a-b, 4)
461
+ majors_data = np.array([["H", hydrogen[1], c, hydrogen[2]], ["O", oxygen[1], 12+c, oxygen[2]],
462
+ ["F", fluorine[1], a, fluorine[2]], ["P", phosphorus[1], 3, phosphorus[2]],
463
+ ["Cl", chlorine[1], b, chlorine[2]], ["Ca", calcium[1], 5, calcium[2]]], dtype=object)
464
+ # Minor elements
465
+ traces_data = []
466
+ if len(self.traces_list) > 0:
467
+ self.impurity = "impure"
468
+ if self.impurity == "random":
469
+ self.traces_list = []
470
+ minors = ["La", "Ce", "Pr", "Nd", "Sm", "Eu", "Gd", "Dy", "Y", "Er", "Mn"]
471
+ n = rd.randint(1, len(minors))
472
+ while len(self.traces_list) < n:
473
+ selection = rd.choice(minors)
474
+ if selection not in self.traces_list and selection not in majors_name:
475
+ self.traces_list.append(selection)
476
+ else:
477
+ continue
478
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
479
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
480
+ for i in range(len(self.traces_list)):
481
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
482
+ if len(traces_data) > 0:
483
+ traces_data = np.array(traces_data, dtype=object)
484
+ traces_data = traces_data[traces_data[:, 1].argsort()]
485
+ # Molar mass
486
+ molar_mass_pure = (5*calcium[2] + a*fluorine[2] + b*chlorine[2] + c*(hydrogen[2] + oxygen[2]) + 3*
487
+ (phosphorus[2] + 4*oxygen[2]))
488
+ molar_mass, amounts = MineralChemistry(
489
+ w_traces=traces_data, molar_mass_pure=molar_mass_pure, majors=majors_data).calculate_molar_mass()
490
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
491
+ # Oxide Composition
492
+ list_oxides = ["H2O", "P2O5", "CaO", "Cl", "F"]
493
+ composition_oxides = {}
494
+ for var_oxide in list_oxides:
495
+ oxide_data = OxideCompounds(var_compound=var_oxide, var_amounts=amounts).get_composition()
496
+ if self.impurity == "pure":
497
+ composition_oxides[var_oxide] = round(oxide_data["Oxide"][1], 4)
498
+ else:
499
+ composition_oxides[var_oxide] = round(oxide_data["Oxide"][1], 6)
500
+
501
+ if np.isclose(np.sum(list(composition_oxides.values())), 1.0000) == True:
502
+ condition = True
503
+ else:
504
+ pass
505
+ # Density
506
+ dataV_F = CrystalPhysics([[9.367, 6.884], [], "hexagonal"])
507
+ V_F = dataV_F.calculate_volume()
508
+ Z_F = 2
509
+ V_m_F = MineralChemistry().calculate_molar_volume(volume_cell=V_F, z=Z_F)*10**(6)
510
+ dataRho_F = CrystalPhysics([molar_mass, Z_F, V_F*10**(6)])
511
+ rho_F = dataRho_F.calculate_bulk_density()
512
+ rho_e_F = wg(amounts=amounts, elements=element, rho_b=rho_F).calculate_electron_density()
513
+ #
514
+ dataV_Cl = CrystalPhysics([[9.598, 6.776], [], "hexagonal"])
515
+ V_Cl = dataV_Cl.calculate_volume()
516
+ Z_Cl = 2
517
+ V_m_Cl = MineralChemistry().calculate_molar_volume(volume_cell=V_Cl, z=Z_Cl)*10**(6)
518
+ dataRho_Cl = CrystalPhysics([molar_mass, Z_Cl, V_Cl*10**(6)])
519
+ rho_Cl = dataRho_Cl.calculate_bulk_density()
520
+ rho_e_Cl = wg(amounts=amounts, elements=element, rho_b=rho_Cl).calculate_electron_density()
521
+ #
522
+ dataV_OH = CrystalPhysics([[9.418, 6.875], [], "hexagonal"])
523
+ V_OH = dataV_OH.calculate_volume()
524
+ Z_OH = 2
525
+ V_m_OH = MineralChemistry().calculate_molar_volume(volume_cell=V_OH, z=Z_OH)*10**(6)
526
+ dataRho_OH = CrystalPhysics([molar_mass, Z_OH, V_OH*10**(6)])
527
+ rho_OH = dataRho_OH.calculate_bulk_density()
528
+ rho_e_OH = wg(amounts=amounts, elements=element, rho_b=rho_OH).calculate_electron_density()
529
+ #
530
+ V_m = a*V_m_F + b*V_m_Cl + c*V_m_OH
531
+ rho = a*rho_F + b*rho_Cl + c*rho_OH
532
+ rho_e = a*rho_e_F + b*rho_e_Cl + c*rho_e_OH
533
+ # Bulk modulus
534
+ K_F = 83*10**9
535
+ K_Cl = 98.70*10**9
536
+ K_OH = 105.01*10**9
537
+ K = a*K_F + b*K_Cl + c*K_OH
538
+ # Shear modulus
539
+ G_F = 41*10**9
540
+ G_Cl = 61.17*10**9
541
+ G_OH = 62.69*10**9
542
+ G = a*G_F + b*G_Cl + c*G_OH
543
+ # Young's modulus
544
+ E = (9*K*G)/(3*K + G)
545
+ # Poisson's ratio
546
+ nu = (3*K - 2*G)/(2*(3*K + G))
547
+ # vP/vS
548
+ vPvS = ((K + 4/3*G)/G)**0.5
549
+ # P-wave velocity
550
+ vP = ((K + 4/3*G)/rho)**0.5
551
+ # S-wave velocity
552
+ vS = (G/rho)**0.5
553
+ # Gamma ray
554
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
555
+ # Photoelectricity
556
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
557
+ U = pe*rho_e*10**(-3)
558
+ # Electrical resistivity
559
+ p = None
560
+ # Results
561
+ results = {}
562
+ results["mineral"] = mineral
563
+ results["M"] = molar_mass
564
+ element_list = np.array(amounts)[:, 0]
565
+ results["chemistry"] = {}
566
+ for index, element in enumerate(element_list, start=0):
567
+ results["chemistry"][element] = amounts[index][2]
568
+ results["compounds"] = {}
569
+ for index, oxide in enumerate(list_oxides, start=0):
570
+ results["compounds"][oxide] = composition_oxides[oxide]
571
+ results["rho"] = round(rho, 4)
572
+ results["rho_e"] = round(rho_e, 4)
573
+ results["V"] = round(V_m, 4)
574
+ results["vP"] = round(vP, 4)
575
+ results["vS"] = round(vS, 4)
576
+ results["vP/vS"] = round(vPvS, 4)
577
+ results["G"] = round(G*10**(-9), 4)
578
+ results["K"] = round(K*10**(-9), 4)
579
+ results["E"] = round(E*10**(-9), 4)
580
+ results["nu"] = round(nu, 4)
581
+ results["GR"] = round(gamma_ray, 4)
582
+ results["PE"] = round(pe, 4)
583
+ results["U"] = round(U, 4)
584
+ if p != None:
585
+ results["p"] = round(p, 4)
586
+ else:
587
+ results["p"] = p
588
+ #
589
+ return results