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,380 @@
1
+ #!/usr/bin/env python
2
+ # -*-coding: utf-8 -*-
3
+
4
+ # -----------------------------------------------
5
+
6
+ # Name: pyllosilicates.py
7
+ # Author: Maximilian A. Beeskow
8
+ # Version: 1.0
9
+ # Date: 15.11.2021
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
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
22
+
23
+ # Halogenes
24
+ class Pyllosilicates:
25
+ """ Class that generates geophysical and geochemical data of phyllosilicate minerals"""
26
+ #
27
+ def __init__(self, traces_list=[], impurity="pure", dict=False):
28
+ self.traces_list = traces_list
29
+ self.impurity = impurity
30
+ self.dict = dict
31
+ #
32
+ def create_illite(self): # (K,H3O) (Al,Mg,Fe)2 (Si,Al)4 O10 [(OH)2,(H2O)]
33
+ # Major elements
34
+ hydrogen = PeriodicSystem(name="H").get_data()
35
+ oxygen = PeriodicSystem(name="O").get_data()
36
+ magnesium = PeriodicSystem(name="Mg").get_data()
37
+ aluminium = PeriodicSystem(name="Al").get_data()
38
+ silicon = PeriodicSystem(name="Si").get_data()
39
+ potassium = PeriodicSystem(name="K").get_data()
40
+ iron = PeriodicSystem(name="Fe").get_data()
41
+ majors_name = ["H", "O", "Mg", "Al", "Si", "K", "Fe"]
42
+ #
43
+ a = round(rd.uniform(0.6, 0.8), 4)
44
+ b = round(rd.uniform(0.75, 1.0), 4)
45
+ b2 = round(rd.uniform(0.0, float(1-b)), 4)
46
+ c = round(rd.uniform(0.975, 1.0), 4)
47
+ d = round(rd.uniform(0.75, 1.0), 4)
48
+ #
49
+ majors_data = np.array([["H", hydrogen[1], 3*(1-a)+4*d, hydrogen[2]], ["O", oxygen[1], (1-a)+10+3*d, oxygen[2]],
50
+ ["Mg", magnesium[1], 2*b2, magnesium[2]], ["Al", aluminium[1], 2*b+4*(1-c), aluminium[2]],
51
+ ["Si", silicon[1], 4*c, silicon[2]], ["K", potassium[1], a, potassium[2]],
52
+ ["Fe", iron[1], 2*(1-b-b2), iron[2]]], dtype=object)
53
+ # Minor elements
54
+ traces_data = []
55
+ if len(self.traces_list) > 0:
56
+ self.impurity = "impure"
57
+ if self.impurity == "random":
58
+ self.traces_list = []
59
+ minors = [None]
60
+ n = rd.randint(1, len(minors))
61
+ while len(self.traces_list) < n:
62
+ selection = rd.choice(minors)
63
+ if selection not in self.traces_list and selection not in majors_name:
64
+ self.traces_list.append(selection)
65
+ else:
66
+ continue
67
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
68
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
69
+ for i in range(len(self.traces_list)):
70
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
71
+ if len(traces_data) > 0:
72
+ traces_data = np.array(traces_data, dtype=object)
73
+ traces_data = traces_data[traces_data[:, 1].argsort()]
74
+ #
75
+ mineral = "Ilt"
76
+ #
77
+ # Molar mass
78
+ molar_mass_pure = a*potassium[2] + (1-a)*(3*hydrogen[2] + oxygen[2]) \
79
+ + 2*(b*aluminium[2] + b2*magnesium[2] + (1-b-b2)*iron[2]) \
80
+ + 4*(c*silicon[2] + (1-c)*aluminium[2]) + 10*oxygen[2] \
81
+ + d*(2*(oxygen[2]+hydrogen[2]) + (2*hydrogen[2]+oxygen[2]))
82
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
83
+ majors=majors_data).calculate_molar_mass()
84
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
85
+ # Density
86
+ dataV = CrystalPhysics([[5.18, 8.98, 10.32], [101.83], "monoclinic"])
87
+ V = dataV.calculate_volume()
88
+ dataRho = CrystalPhysics([molar_mass, 2, V])
89
+ rho = dataRho.calculate_bulk_density()
90
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
91
+ # Bulk modulus
92
+ K = (35.72 + (62.21-35.72)/(2.706-2.546)*(rho/1000-2.546))*10**9
93
+ # Shear modulus
94
+ G = (17.80 + (25.70-17.80)/(2.706-2.546)*(rho/1000-2.546))*10**9
95
+ # Young's modulus
96
+ E = (9*K*G)/(3*K + G)
97
+ # Poisson's ratio
98
+ nu = (3*K - 2*G)/(2*(3*K + G))
99
+ # vP/vS
100
+ vPvS = ((K + 4/3*G)/G)**0.5
101
+ # P-wave velocity
102
+ vP = ((K + 4/3*G)/rho)**0.5
103
+ # S-wave velocity
104
+ vS = (G/rho)**0.5
105
+ # Gamma ray
106
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
107
+ # Photoelectricity
108
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
109
+ U = pe*rho_e*10**(-3)
110
+ # Electrical resistivity
111
+ p = None
112
+ #
113
+ if self.dict == False:
114
+ data = []
115
+ data.append(mineral)
116
+ data.append(round(molar_mass, 3))
117
+ data.append(round(rho, 2))
118
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
119
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
120
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
121
+ data.append(amounts)
122
+ #
123
+ return data
124
+ else:
125
+ #
126
+ results = {}
127
+ results["mineral"] = mineral
128
+ results["M"] = round(molar_mass, 3)
129
+ element_list = np.array(amounts)[:, 0]
130
+ results["chemistry"] = {}
131
+ for index, element in enumerate(element_list, start=0):
132
+ results["chemistry"][element] = amounts[index][2]
133
+ results["rho"] = round(rho, 4)
134
+ results["rho_e"] = round(rho_e, 4)
135
+ results["V"] = round(V, 4)
136
+ results["vP"] = round(vP, 4)
137
+ results["vS"] = round(vS, 4)
138
+ results["vP/vS"] = round(vPvS, 4)
139
+ results["G"] = round(G*10**(-9), 4)
140
+ results["K"] = round(K*10**(-9), 4)
141
+ results["E"] = round(E*10**(-9), 4)
142
+ results["nu"] = round(nu, 4)
143
+ results["GR"] = round(gamma_ray, 4)
144
+ results["PE"] = round(pe, 4)
145
+ results["U"] = round(U, 4)
146
+ if p != None:
147
+ results["p"] = round(p, 4)
148
+ else:
149
+ results["p"] = p
150
+ #
151
+ return results
152
+ #
153
+ def create_kaolinite(self): # Al2(OH)4Si2O5
154
+ # Major elements
155
+ hydrogen = PeriodicSystem(name="H").get_data()
156
+ oxygen = PeriodicSystem(name="O").get_data()
157
+ aluminium = PeriodicSystem(name="Al").get_data()
158
+ silicon = PeriodicSystem(name="Si").get_data()
159
+ majors_name = ["H", "O", "Al", "Si"]
160
+ #
161
+ majors_data = np.array([["H", hydrogen[1], 4, hydrogen[2]], ["O", oxygen[1], 9, oxygen[2]],
162
+ ["Al", aluminium[1], 2, aluminium[2]], ["Si", silicon[1], 2, silicon[2]]], dtype=object)
163
+ # Minor elements
164
+ traces_data = []
165
+ if len(self.traces_list) > 0:
166
+ self.impurity = "impure"
167
+ if self.impurity == "random":
168
+ self.traces_list = []
169
+ minors = ["Fe", "Mg", "Na", "K", "Ti", "Ca"]
170
+ n = rd.randint(1, len(minors))
171
+ while len(self.traces_list) < n:
172
+ selection = rd.choice(minors)
173
+ if selection not in self.traces_list and selection not in majors_name:
174
+ self.traces_list.append(selection)
175
+ else:
176
+ continue
177
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
178
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
179
+ for i in range(len(self.traces_list)):
180
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
181
+ if len(traces_data) > 0:
182
+ traces_data = np.array(traces_data, dtype=object)
183
+ traces_data = traces_data[traces_data[:, 1].argsort()]
184
+ #
185
+ mineral = "Kln"
186
+ #
187
+ # Molar mass
188
+ molar_mass_pure = 2*aluminium[2] + 4*(oxygen[2]+hydrogen[2]) + 2*silicon[2] + 5*oxygen[2]
189
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
190
+ majors=majors_data).calculate_molar_mass()
191
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
192
+ # Density
193
+ dataV = CrystalPhysics([[5.13, 8.89, 7.25], [90.0, 104.5, 89.8], "triclinic"])
194
+ V = dataV.calculate_volume()
195
+ dataRho = CrystalPhysics([molar_mass, 2, V])
196
+ rho = dataRho.calculate_bulk_density()
197
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
198
+ # Bulk modulus
199
+ K = 122.54*10**9
200
+ # Shear modulus
201
+ G = 66.63*10**9
202
+ # Young's modulus
203
+ E = (9*K*G)/(3*K + G)
204
+ # Poisson's ratio
205
+ nu = (3*K - 2*G)/(2*(3*K + G))
206
+ # vP/vS
207
+ vPvS = ((K + 4/3*G)/G)**0.5
208
+ # P-wave velocity
209
+ vP = ((K + 4/3*G)/rho)**0.5
210
+ # S-wave velocity
211
+ vS = (G/rho)**0.5
212
+ # Gamma ray
213
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
214
+ # Photoelectricity
215
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
216
+ U = pe*rho_e*10**(-3)
217
+ # Electrical resistivity
218
+ p = None
219
+ #
220
+ if self.dict == False:
221
+ data = []
222
+ data.append(mineral)
223
+ data.append(round(molar_mass, 3))
224
+ data.append(round(rho, 2))
225
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
226
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
227
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
228
+ data.append(amounts)
229
+ #
230
+ return data
231
+ else:
232
+ #
233
+ results = {}
234
+ results["mineral"] = mineral
235
+ results["M"] = round(molar_mass, 3)
236
+ element_list = np.array(amounts)[:, 0]
237
+ results["chemistry"] = {}
238
+ for index, element in enumerate(element_list, start=0):
239
+ results["chemistry"][element] = amounts[index][2]
240
+ results["rho"] = round(rho, 4)
241
+ results["rho_e"] = round(rho_e, 4)
242
+ results["V"] = round(V, 4)
243
+ results["vP"] = round(vP, 4)
244
+ results["vS"] = round(vS, 4)
245
+ results["vP/vS"] = round(vPvS, 4)
246
+ results["G"] = round(G*10**(-9), 4)
247
+ results["K"] = round(K*10**(-9), 4)
248
+ results["E"] = round(E*10**(-9), 4)
249
+ results["nu"] = round(nu, 4)
250
+ results["GR"] = round(gamma_ray, 4)
251
+ results["PE"] = round(pe, 4)
252
+ results["U"] = round(U, 4)
253
+ if p != None:
254
+ results["p"] = round(p, 4)
255
+ else:
256
+ results["p"] = p
257
+ #
258
+ return results
259
+ #
260
+ def create_montmorillonite(self): # (Na,Ca)0.3(Al,Mg)2Si4O10(OH2)(H2O)10
261
+ # Major elements
262
+ hydrogen = PeriodicSystem(name="H").get_data()
263
+ oxygen = PeriodicSystem(name="O").get_data()
264
+ sodium = PeriodicSystem(name="Na").get_data()
265
+ magnesium = PeriodicSystem(name="Mg").get_data()
266
+ aluminium = PeriodicSystem(name="Al").get_data()
267
+ silicon = PeriodicSystem(name="Si").get_data()
268
+ calcium = PeriodicSystem(name="Ca").get_data()
269
+ majors_name = ["H", "O", "Na", "Mg", "Al", "Si", "Ca"]
270
+ #
271
+ x = round(rd.uniform(0.6, 0.7), 2)
272
+ y = round(rd.uniform(0.9, 1), 2)
273
+ n = rd.randint(10, 12)
274
+ #
275
+ majors_data = np.array([["H", hydrogen[1], 2+2*n, hydrogen[2]], ["O", oxygen[1], 10+2+n, oxygen[2]],
276
+ ["Na", sodium[1], 0.3*x, sodium[2]], ["Mg", magnesium[1], 2*(1-y), magnesium[2]],
277
+ ["Al", aluminium[1], 2*y, aluminium[2]], ["Si", silicon[1], 4, silicon[2]],
278
+ ["Ca", calcium[1], 0.3*(1-x), calcium[2]]], dtype=object)
279
+ # Minor elements
280
+ traces_data = []
281
+ if len(self.traces_list) > 0:
282
+ self.impurity = "impure"
283
+ if self.impurity == "random":
284
+ self.traces_list = []
285
+ minors = ["Fe", "K"]
286
+ n = rd.randint(1, len(minors))
287
+ while len(self.traces_list) < n:
288
+ selection = rd.choice(minors)
289
+ if selection not in self.traces_list and selection not in majors_name:
290
+ self.traces_list.append(selection)
291
+ else:
292
+ continue
293
+ traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
294
+ x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
295
+ for i in range(len(self.traces_list)):
296
+ traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
297
+ if len(traces_data) > 0:
298
+ traces_data = np.array(traces_data, dtype=object)
299
+ traces_data = traces_data[traces_data[:, 1].argsort()]
300
+ #
301
+ mineral = "Mnt"
302
+ #
303
+ # Molar mass
304
+ molar_mass_pure = 0.3*(x*sodium[2]+(1-x)*calcium[2]) + 2*(y*aluminium[2]+(1-y)*magnesium[2]) + 4*silicon[2] \
305
+ + 10*oxygen[2] + 2*(hydrogen[2]+oxygen[2]) + n*(2*hydrogen[2]+oxygen[2])
306
+ molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
307
+ majors=majors_data).calculate_molar_mass()
308
+ element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
309
+ # Density
310
+ dataV = CrystalPhysics([[5.17, 8.94, 9.95], [99.9], "monoclinic"])
311
+ V = dataV.calculate_volume()
312
+ dataRho = CrystalPhysics([molar_mass, 1, V])
313
+ rho = dataRho.calculate_bulk_density()
314
+ rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
315
+ # Bulk modulus
316
+ x_rho = [2738, 2788, 3250, 2504, 3182]
317
+ y_K = [37.30, 35.31, 49.46, 29.71, 66.59]
318
+ a_K, b_K, r_value_K, p_value_K, std_err_K = stats.linregress(x_rho, y_K)
319
+ K = (a_K*rho + b_K)*10**9
320
+ # Shear modulus
321
+ y_G = [17.00, 20.19, 24.70, 16.30, 27.00]
322
+ a_G, b_G, r_value_G, p_value_G, std_err_G = stats.linregress(x_rho, y_G)
323
+ G = (a_G*rho + b_G)*10**9
324
+ # Young's modulus
325
+ E = (9*K*G)/(3*K + G)
326
+ # Poisson's ratio
327
+ nu = (3*K - 2*G)/(2*(3*K + G))
328
+ # vP/vS
329
+ vPvS = ((K + 4/3*G)/G)**0.5
330
+ # P-wave velocity
331
+ vP = ((K + 4/3*G)/rho)**0.5
332
+ # S-wave velocity
333
+ vS = (G/rho)**0.5
334
+ # Gamma ray
335
+ gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
336
+ # Photoelectricity
337
+ pe = wg(amounts=amounts, elements=element).calculate_pe()
338
+ U = pe*rho_e*10**(-3)
339
+ # Electrical resistivity
340
+ p = None
341
+ #
342
+ if self.dict == False:
343
+ data = []
344
+ data.append(mineral)
345
+ data.append(round(molar_mass, 3))
346
+ data.append(round(rho, 2))
347
+ data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
348
+ data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
349
+ data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
350
+ data.append(amounts)
351
+ #
352
+ return data
353
+ else:
354
+ #
355
+ results = {}
356
+ results["mineral"] = mineral
357
+ results["M"] = round(molar_mass, 3)
358
+ element_list = np.array(amounts)[:, 0]
359
+ results["chemistry"] = {}
360
+ for index, element in enumerate(element_list, start=0):
361
+ results["chemistry"][element] = amounts[index][2]
362
+ results["rho"] = round(rho, 4)
363
+ results["rho_e"] = round(rho_e, 4)
364
+ results["V"] = round(V, 4)
365
+ results["vP"] = round(vP, 4)
366
+ results["vS"] = round(vS, 4)
367
+ results["vP/vS"] = round(vPvS, 4)
368
+ results["G"] = round(G*10**(-9), 4)
369
+ results["K"] = round(K*10**(-9), 4)
370
+ results["E"] = round(E*10**(-9), 4)
371
+ results["nu"] = round(nu, 4)
372
+ results["GR"] = round(gamma_ray, 4)
373
+ results["PE"] = round(pe, 4)
374
+ results["U"] = round(U, 4)
375
+ if p != None:
376
+ results["p"] = round(p, 4)
377
+ else:
378
+ results["p"] = p
379
+ #
380
+ return results