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
modules/exploration.py ADDED
@@ -0,0 +1,765 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+
4
+ # ---- --- ---- --- ---- --- ---- --- ---- --- ---- --- ---- --- ---- --- ---- --- ---- --- ---- --- ---- --- ---- --- -
5
+
6
+ # File: exploration.py
7
+ # Description: Contains all necessary functions that are related to mineral exploration feature
8
+ # Author: Maximilian Beeskow
9
+ # Last updated: 10.12.2024
10
+ # License: GPL v3.0
11
+
12
+ # ---- --- ---- --- ---- --- ---- --- ---- --- ---- --- ---- --- ---- --- ---- --- ---- --- ---- --- ---- --- ---- --- -
13
+
14
+ # external packages
15
+ import tkinter as tk
16
+ from tkinter import ttk
17
+ import numpy as np
18
+ # internal packages
19
+ from modules.gui_elements import SimpleElements
20
+ from modules.siliciclastics import SiliciclasticRocks
21
+ from modules.carbonates import CarbonateRocks
22
+ from modules.igneous import Plutonic, Volcanic, UltraMafic, Pyroclastic
23
+ from modules.metamorphics import GranuliteFacies, GreenschistFacies, AmphiboliteFacies
24
+ from modules.ore import OreRocks
25
+
26
+ # ---- --- ---- --- ---- --- ---- --- ---- --- ---- --- ---- --- ---- --- ---- --- ---- --- ---- --- ---- --- ---- --- -
27
+
28
+
29
+ class ExplorationInterface:
30
+
31
+ def __init__(self, parent):
32
+ self.parent = parent
33
+ self.colors = {
34
+ "Background": "#ECEBEA", "Navigation": "#252422", "Accent": "#EB5E28", "Option": "#CCC5B9",
35
+ "White": "#FFFFFF", "Black": "#000000", "Accent Blue": "#118AB2"}
36
+
37
+ # Variables
38
+ self.initialization = False
39
+
40
+ self.var_rb_setup = tk.IntVar()
41
+ self.var_rb_setup.set(0)
42
+
43
+ self.var_entr_boreholes = tk.IntVar()
44
+ self.var_entr_boreholes.set(2)
45
+ self.var_entr_units = tk.IntVar()
46
+ self.var_entr_units.set(4)
47
+ self.var_entr_maximum_depth = tk.IntVar()
48
+ self.var_entr_maximum_depth.set(100)
49
+ self.var_entr_parts = tk.IntVar()
50
+ self.var_entr_parts.set(10)
51
+ self.dict_entr_top = {}
52
+ self.dict_entr_bottom = {}
53
+ self.var_entr_top = tk.StringVar()
54
+ self.var_entr_top.set("0.0")
55
+ self.var_entr_bottom = tk.StringVar()
56
+ self.var_entr_bottom.set("25.0")
57
+
58
+ self.var_opt_sedimentary = tk.StringVar()
59
+ self.var_opt_sedimentary.set("Select sedimentary rock")
60
+ self.var_opt_plutonic = tk.StringVar()
61
+ self.var_opt_plutonic.set("Select plutonic rock")
62
+ self.var_opt_volcanic = tk.StringVar()
63
+ self.var_opt_volcanic.set("Select volcanic rock")
64
+ self.var_opt_ore = tk.StringVar()
65
+ self.var_opt_ore.set("Select ore rock")
66
+ self.var_opt_igneous = tk.StringVar()
67
+ self.var_opt_igneous.set("Select igneous rock")
68
+ self.var_opt_metamorphic = tk.StringVar()
69
+ self.var_opt_metamorphic.set("Select metamorphic rock")
70
+ self.var_opt_ultramafic = tk.StringVar()
71
+ self.var_opt_ultramafic.set("Select ultramafic rock")
72
+
73
+ def create_subwindow_borehole_data(self):
74
+ ## Window Settings
75
+ window_width = 900
76
+ window_height = 750
77
+ var_geometry = str(window_width) + "x" + str(window_height) + "+" + str(0) + "+" + str(0)
78
+
79
+ row_min = 25
80
+ self.n_rows = int(window_height/row_min)
81
+ column_min = 20
82
+ n_columns = int(window_width/column_min)
83
+
84
+ str_title_window = "GebPy - Borehole data"
85
+ self.subwindow_borehole_data = tk.Toplevel(self.parent)
86
+ self.subwindow_borehole_data.title(str_title_window)
87
+ self.subwindow_borehole_data.geometry(var_geometry)
88
+ self.subwindow_borehole_data.resizable(False, False)
89
+ self.subwindow_borehole_data["bg"] = self.colors["Navigation"]
90
+
91
+ for x in range(n_columns):
92
+ tk.Grid.columnconfigure(self.subwindow_borehole_data, x, weight=1)
93
+ for y in range(self.n_rows):
94
+ tk.Grid.rowconfigure(self.subwindow_borehole_data, y, weight=1)
95
+
96
+ # Rows
97
+ for i in range(0, self.n_rows):
98
+ self.subwindow_borehole_data.grid_rowconfigure(i, minsize=row_min)
99
+ # Columns
100
+ for i in range(0, n_columns):
101
+ self.subwindow_borehole_data.grid_columnconfigure(i, minsize=column_min)
102
+
103
+ self.start_row = 0
104
+ self.n_columns_setup = 11
105
+
106
+ ## Frames
107
+ SimpleElements(
108
+ parent=self.subwindow_borehole_data, row_id=self.start_row, column_id=self.n_columns_setup + 1,
109
+ n_rows=self.n_rows, n_columns=n_columns - self.n_columns_setup - 1, bg=self.colors["Background"],
110
+ fg=self.colors["Background"]).create_frame()
111
+
112
+ ## Labels
113
+ SimpleElements(
114
+ parent=self.subwindow_borehole_data, row_id=self.start_row, column_id=1, n_rows=1,
115
+ n_columns=self.n_columns_setup - 1, bg=self.colors["Navigation"], fg=self.colors["White"]).create_label(
116
+ text="Settings", relief=tk.FLAT, font_option="sans 12 bold", anchor_option=tk.W)
117
+
118
+ ## Initialization
119
+ if self.initialization == False:
120
+ self.select_dataset_setup()
121
+ self.update_settings(initialization=True)
122
+ self.initialization = True
123
+
124
+ def select_dataset_setup(self):
125
+ if self.var_rb_setup.get() == 0:
126
+ ## Labels
127
+ SimpleElements(
128
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 1, column_id=1, n_rows=1,
129
+ n_columns=self.n_columns_setup - 1, bg=self.colors["Navigation"], fg=self.colors["White"]).create_label(
130
+ text="Number of boreholes (#)", relief=tk.FLAT, font_option="sans 10 bold", anchor_option=tk.W)
131
+ SimpleElements(
132
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 3, column_id=1, n_rows=1,
133
+ n_columns=self.n_columns_setup - 1, bg=self.colors["Navigation"], fg=self.colors["White"]).create_label(
134
+ text="Number of units (#)", relief=tk.FLAT, font_option="sans 10 bold", anchor_option=tk.W)
135
+ SimpleElements(
136
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 5, column_id=1, n_rows=1,
137
+ n_columns=self.n_columns_setup - 1, bg=self.colors["Navigation"], fg=self.colors["White"]).create_label(
138
+ text="Maximum depth (m)", relief=tk.FLAT, font_option="sans 10 bold", anchor_option=tk.W)
139
+ SimpleElements(
140
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 7, column_id=1, n_rows=1,
141
+ n_columns=self.n_columns_setup - 1, bg=self.colors["Navigation"], fg=self.colors["White"]).create_label(
142
+ text="Samples per unit (#)", relief=tk.FLAT, font_option="sans 10 bold", anchor_option=tk.W)
143
+
144
+ ## Entries
145
+ SimpleElements(
146
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 2, column_id=1, n_rows=1,
147
+ n_columns=self.n_columns_setup - 1, bg=self.colors["Background"],
148
+ fg=self.colors["Navigation"]).create_entry(var_entr=self.var_entr_boreholes)
149
+ SimpleElements(
150
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 4, column_id=1, n_rows=1,
151
+ n_columns=self.n_columns_setup - 1, bg=self.colors["Background"],
152
+ fg=self.colors["Navigation"]).create_entry(var_entr=self.var_entr_units)
153
+ SimpleElements(
154
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 6, column_id=1, n_rows=1,
155
+ n_columns=self.n_columns_setup - 1, bg=self.colors["Background"],
156
+ fg=self.colors["Navigation"]).create_entry(var_entr=self.var_entr_maximum_depth)
157
+ SimpleElements(
158
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 8, column_id=1, n_rows=1,
159
+ n_columns=self.n_columns_setup - 1, bg=self.colors["Background"],
160
+ fg=self.colors["Navigation"]).create_entry(var_entr=self.var_entr_parts)
161
+
162
+ ## Buttons
163
+ btn_01 = SimpleElements(
164
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 10, column_id=1, n_rows=1,
165
+ n_columns=self.n_columns_setup - 1, bg=self.colors["Background"],
166
+ fg=self.colors["Navigation"]).create_button(
167
+ text="Update settings", command=lambda initialization=False, update=True:
168
+ self.update_settings(initialization, update))
169
+ btn_01.configure(activebackground=self.colors["Accent"])
170
+
171
+ elif self.var_rb_setup.get() == 1:
172
+ print("Load dataset!")
173
+
174
+ def update_settings(self, initialization=False, update=False, changed_borehole=False):
175
+ """Updates the data for the borehole and unit data.
176
+ Arguments
177
+ initialization, boolean : specifies if the function runs the first time.
178
+ update, boolean : specifies if it has only to update already existing variables.
179
+ changed_borehole, boolean : specifies if only the ID of a borehole was changed.
180
+ Outputs
181
+ ---
182
+ """
183
+ ## Helper
184
+ if initialization or update and changed_borehole == False:
185
+ self.list_boreholes = np.arange(self.var_entr_boreholes.get()) + 1
186
+ self.list_units = np.arange(self.var_entr_units.get()) + 1
187
+ self.current_borehole_id = self.list_boreholes[0]
188
+ self.current_unit_id = self.list_units[0]
189
+
190
+ for index_borehole, borehole_id in enumerate(self.list_boreholes):
191
+ self.dict_entr_top[borehole_id] = {}
192
+ self.dict_entr_bottom[borehole_id] = {}
193
+ average_thickness = round(self.var_entr_maximum_depth.get()/len(self.list_units), 2)
194
+ current_bottom_depth = 0
195
+ for index_unit, unit_id in enumerate(self.list_units):
196
+ self.dict_entr_top[borehole_id][unit_id] = tk.IntVar()
197
+ self.dict_entr_bottom[borehole_id][unit_id] = tk.IntVar()
198
+
199
+ if index_unit == 0:
200
+ self.dict_entr_top[borehole_id][unit_id].set(0)
201
+ current_bottom_depth += average_thickness
202
+ self.dict_entr_bottom[borehole_id][unit_id].set(round(current_bottom_depth))
203
+ else:
204
+ self.dict_entr_top[borehole_id][unit_id].set(round(current_bottom_depth))
205
+ current_bottom_depth += average_thickness
206
+ self.dict_entr_bottom[borehole_id][unit_id].set(round(current_bottom_depth))
207
+
208
+ if initialization:
209
+ ## Labels
210
+ SimpleElements(
211
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 12, column_id=1, n_rows=1,
212
+ n_columns=self.n_columns_setup - 1, bg=self.colors["Navigation"], fg=self.colors["White"]).create_label(
213
+ text="Current borehole", relief=tk.FLAT, font_option="sans 10 bold", anchor_option=tk.W)
214
+ self.lbl_borehole_id = SimpleElements(
215
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 13, column_id=1, n_rows=1, n_columns=2,
216
+ bg=self.colors["Navigation"], fg=self.colors["White"]).create_label(
217
+ text=self.current_borehole_id, relief=tk.FLAT, font_option="sans 10 bold")
218
+ SimpleElements(
219
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 14, column_id=1, n_rows=1,
220
+ n_columns=self.n_columns_setup - 1, bg=self.colors["Navigation"], fg=self.colors["White"]).create_label(
221
+ text="Current unit", relief=tk.FLAT, font_option="sans 10 bold", anchor_option=tk.W)
222
+ self.lbl_unit_id = SimpleElements(
223
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 15, column_id=1, n_rows=1, n_columns=2,
224
+ bg=self.colors["Navigation"], fg=self.colors["White"]).create_label(
225
+ text=self.current_unit_id, relief=tk.FLAT, font_option="sans 10 bold")
226
+ SimpleElements(
227
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 17, column_id=1, n_rows=1,
228
+ n_columns=self.n_columns_setup - 1, bg=self.colors["Navigation"], fg=self.colors["White"]).create_label(
229
+ text="Lithology", relief=tk.FLAT, font_option="sans 10 bold", anchor_option=tk.W)
230
+ SimpleElements(
231
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 25, column_id=1, n_rows=1, n_columns=6,
232
+ bg=self.colors["Navigation"], fg=self.colors["White"]).create_label(
233
+ text="Top depth (m)", relief=tk.FLAT, font_option="sans 10 bold", anchor_option=tk.W)
234
+ SimpleElements(
235
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 26, column_id=1, n_rows=1, n_columns=6,
236
+ bg=self.colors["Navigation"], fg=self.colors["White"]).create_label(
237
+ text="Bottom depth (m)", relief=tk.FLAT, font_option="sans 10 bold", anchor_option=tk.W)
238
+
239
+ ## Buttons
240
+ btn_02 = SimpleElements(
241
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 13, column_id=3, n_rows=1, n_columns=4,
242
+ bg=self.colors["Background"], fg=self.colors["Navigation"]).create_button(
243
+ text="Previous", command=lambda mode="previous": self.change_borehole(mode))
244
+ btn_03 = SimpleElements(
245
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 13, column_id=7, n_rows=1, n_columns=4,
246
+ bg=self.colors["Background"], fg=self.colors["Navigation"]).create_button(
247
+ text="Next", command=lambda mode="next": self.change_borehole(mode))
248
+ btn_04 = SimpleElements(
249
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 15, column_id=3, n_rows=1, n_columns=4,
250
+ bg=self.colors["Background"], fg=self.colors["Navigation"]).create_button(
251
+ text="Previous", command=lambda mode="previous": self.change_unit(mode))
252
+ btn_05 = SimpleElements(
253
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 15, column_id=7, n_rows=1, n_columns=4,
254
+ bg=self.colors["Background"], fg=self.colors["Navigation"]).create_button(
255
+ text="Next", command=lambda mode="next": self.change_unit(mode))
256
+ btn_06 = SimpleElements(
257
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 28, column_id=1, n_rows=1,
258
+ n_columns=self.n_columns_setup - 1, bg=self.colors["Background"],
259
+ fg=self.colors["Navigation"]).create_button(text="Export data")
260
+ btn_02.configure(activebackground=self.colors["Accent"])
261
+ btn_03.configure(activebackground=self.colors["Accent"])
262
+ btn_04.configure(activebackground=self.colors["Accent"])
263
+ btn_05.configure(activebackground=self.colors["Accent"])
264
+ btn_06.configure(activebackground=self.colors["Accent"])
265
+
266
+ ## Entries
267
+ self.entr_top = SimpleElements(
268
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 25, column_id=7, n_rows=1, n_columns=4,
269
+ bg=self.colors["Background"], fg=self.colors["Navigation"]).create_entry(
270
+ var_entr=self.dict_entr_top[self.current_borehole_id][self.current_unit_id])
271
+ self.entr_bottom = SimpleElements(
272
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 26, column_id=7, n_rows=1, n_columns=4,
273
+ bg=self.colors["Background"], fg=self.colors["Navigation"]).create_entry(
274
+ var_entr=self.dict_entr_bottom[self.current_borehole_id][self.current_unit_id])
275
+ self.entr_top.bind(
276
+ "<Return>", lambda event, mode="top": self.change_depth(mode, event))
277
+ self.entr_bottom.bind(
278
+ "<Return>", lambda event, mode="bottom": self.change_depth(mode, event))
279
+
280
+ if self.current_unit_id == 1:
281
+ self.entr_top.configure(state="disabled")
282
+ else:
283
+ self.entr_top.configure(state="normal")
284
+
285
+ if self.current_unit_id == self.list_units[-1]:
286
+ self.entr_bottom.configure(state="disabled")
287
+ else:
288
+ self.entr_bottom.configure(state="normal")
289
+
290
+ ## Option Menus
291
+ list_opt_sedimentary = [
292
+ "Sandstone", "Shale", "Siltstone", "Mudstone", "Greywacke (Huckenholz)", "Conglomerate", "Limestone",
293
+ "Dolostone", "Marl"]
294
+ list_opt_plutonic = [
295
+ "Granite", "Granodiorite", "Tonalite", "Gabbro", "Norite", "Diorite", "Monzodiorite", "Monzogabbro",
296
+ "Monzonite", "Syenite", "Granitoid", "Quarzolite", "Foid-bearing Syenite", "Foid-bearing Monzonite",
297
+ "Foid-bearing Monzodiorite", "Foid-bearing Monzogabbro", "Foid Monzosyenite", "Foid Monzodiorite",
298
+ "Foid Monzogabbro", "Foidolite"]
299
+ list_opt_volcanic = [
300
+ "Rhyolite", "Dacite", "Trachyte", "Latite", "Andesite", "Basalt",
301
+ "Foid-bearing Trachyte", "Foid-bearing Latite", "Foid-bearing Andesite", "Foid-bearing Basalt",
302
+ "Phonolite", "Tephrite", "Foidite"]
303
+ list_opt_ultramafic = [
304
+ "Orthopyroxenite", "Clinopyroxenite", "Dunite", "Harzburgite", "Wehrlite", "Websterite", "Lherzolite",
305
+ "Olivine-Websterite", "Olivine-Orthopyroxenite", "Olivine-Clinopyroxenite", "Peridotite", "Pyroxenite"]
306
+ list_opt_metamorphic = [
307
+ "Felsic Granulite", "Mafic Granulite", "Basaltic Greenschist", "Ultramafic Greenschist",
308
+ "Pelitic Greenschist", "Ortho-Amphibolite"]
309
+ list_opt_ore = [
310
+ "Itabirite", "Banded Iron Formation", "Compact Hematite", "Friable Hematite", "Goethite Hematite",
311
+ "Al-rich Itabirite", "Compact Quartz Itabirite", "Friable Quartz Itabirite", "Goethite Itabirite"]
312
+ opt_sedimentary = SimpleElements(
313
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 18, column_id=1, n_rows=1,
314
+ n_columns=self.n_columns_setup - 1, bg=self.colors["Background"],
315
+ fg=self.colors["Navigation"]).create_option_menu(
316
+ var_opt=self.var_opt_sedimentary, var_opt_set=self.var_opt_sedimentary.get(),
317
+ opt_list=list_opt_sedimentary, active_bg=self.colors["Accent"],
318
+ command=lambda event, focus="sedimentary": self.select_lithology(focus, event))
319
+ opt_plutonic = SimpleElements(
320
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 19, column_id=1, n_rows=1,
321
+ n_columns=self.n_columns_setup - 1, bg=self.colors["Background"],
322
+ fg=self.colors["Navigation"]).create_option_menu(
323
+ var_opt=self.var_opt_plutonic, var_opt_set=self.var_opt_plutonic.get(), opt_list=list_opt_plutonic,
324
+ active_bg=self.colors["Accent"], command=lambda event, focus="plutonic":
325
+ self.select_lithology(focus, event))
326
+ opt_volcanic = SimpleElements(
327
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 20, column_id=1, n_rows=1,
328
+ n_columns=self.n_columns_setup - 1, bg=self.colors["Background"],
329
+ fg=self.colors["Navigation"]).create_option_menu(
330
+ var_opt=self.var_opt_volcanic, var_opt_set=self.var_opt_volcanic.get(), opt_list=list_opt_volcanic,
331
+ active_bg=self.colors["Accent"], command=lambda event, focus="volcanic":
332
+ self.select_lithology(focus, event))
333
+ opt_ultramafic = SimpleElements(
334
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 21, column_id=1, n_rows=1,
335
+ n_columns=self.n_columns_setup - 1, bg=self.colors["Background"],
336
+ fg=self.colors["Navigation"]).create_option_menu(
337
+ var_opt=self.var_opt_ultramafic, var_opt_set=self.var_opt_ultramafic.get(),
338
+ opt_list=list_opt_ultramafic, active_bg=self.colors["Accent"],
339
+ command=lambda event, focus="ultramafic": self.select_lithology(focus, event))
340
+ opt_metamorphic = SimpleElements(
341
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 22, column_id=1, n_rows=1,
342
+ n_columns=self.n_columns_setup - 1, bg=self.colors["Background"],
343
+ fg=self.colors["Navigation"]).create_option_menu(
344
+ var_opt=self.var_opt_metamorphic, var_opt_set=self.var_opt_metamorphic.get(),
345
+ opt_list=list_opt_metamorphic, active_bg=self.colors["Accent"],
346
+ command=lambda event, focus="metamorphic": self.select_lithology(focus, event))
347
+ opt_ore = SimpleElements(
348
+ parent=self.subwindow_borehole_data, row_id=self.start_row + 23, column_id=1, n_rows=1,
349
+ n_columns=self.n_columns_setup - 1, bg=self.colors["Background"],
350
+ fg=self.colors["Navigation"]).create_option_menu(
351
+ var_opt=self.var_opt_ore, var_opt_set=self.var_opt_ore.get(),
352
+ opt_list=list_opt_ore, active_bg=self.colors["Accent"],
353
+ command=lambda event, focus="ore": self.select_lithology(focus, event))
354
+ opt_sedimentary.configure(anchor=tk.W)
355
+ opt_plutonic.configure(anchor=tk.W)
356
+ opt_volcanic.configure(anchor=tk.W)
357
+ opt_ultramafic.configure(anchor=tk.W)
358
+ opt_metamorphic.configure(anchor=tk.W)
359
+ opt_ore.configure(anchor=tk.W)
360
+
361
+ ## Treeviews
362
+ categories = ["rho (kg/m\u00B3)", "phi (%)", "vP (m/s)", "vS (m/s)", "vP/vS (1)", "K (GPa)", "G (GPa)",
363
+ "E (GPa)", "nu (1)", "GR (API)", "PE (barns/e\u207B)"]
364
+ list_categories = ["Category", "Minimum", "Maximum", "Mean", "Standard Deviation"]
365
+ list_width = list(75*np.ones(len(list_categories)))
366
+ list_width = [int(item) for item in list_width]
367
+ list_width[0] = 90
368
+ list_width[-1] = 135
369
+
370
+ self.tv_lithology = SimpleElements(
371
+ parent=self.subwindow_borehole_data, row_id=self.start_row, column_id=self.n_columns_setup + 1,
372
+ n_rows=self.n_rows - 1, n_columns=2*self.n_columns_setup + 1, fg=self.colors["Black"],
373
+ bg=self.colors["White"]).create_treeview(
374
+ n_categories=len(list_categories), text_n=list_categories, width_n=list_width, individual=True)
375
+
376
+ scb_v = ttk.Scrollbar(self.subwindow_borehole_data, orient="vertical")
377
+ scb_h = ttk.Scrollbar(self.subwindow_borehole_data, orient="horizontal")
378
+ self.tv_lithology.configure(xscrollcommand=scb_h.set, yscrollcommand=scb_v.set)
379
+ scb_v.config(command=self.tv_lithology.yview)
380
+ scb_h.config(command=self.tv_lithology.xview)
381
+ scb_v.grid(
382
+ row=0, column=3*self.n_columns_setup + 2, rowspan=self.n_rows - 1, columnspan=1, sticky="ns")
383
+ scb_h.grid(
384
+ row=self.n_rows - 1, column=self.n_columns_setup + 1, rowspan=1, columnspan=2*self.n_columns_setup + 1,
385
+ sticky="ew")
386
+
387
+ for index, category in enumerate(categories):
388
+ entries = [category]
389
+ n_digits = 3
390
+ var_entr_min = round(0, n_digits)
391
+ var_entr_max = round(0, n_digits)
392
+ var_entr_mean = round(0, n_digits)
393
+ var_entr_error = round(0, n_digits)
394
+
395
+ entries.extend([var_entr_min, var_entr_max, var_entr_mean, var_entr_error])
396
+
397
+ self.tv_lithology.insert("", tk.END, values=entries)
398
+
399
+ if update:
400
+ self.lbl_borehole_id.configure(text=self.current_borehole_id)
401
+ self.lbl_unit_id.configure(text=self.current_unit_id)
402
+ self.entr_top.configure(textvariable=self.dict_entr_top[self.current_borehole_id][self.current_unit_id])
403
+ self.entr_bottom.configure(textvariable=self.dict_entr_bottom[self.current_borehole_id][
404
+ self.current_unit_id])
405
+ self.var_opt_sedimentary.set("Select sedimentary rock")
406
+ self.var_opt_igneous.set("Select igneous rock")
407
+ self.var_opt_metamorphic.set("Select metamorphic rock")
408
+
409
+ def change_borehole(self, mode):
410
+ """Changes the borehole.
411
+ Arguments
412
+ mode, str : specifies which borehole was selected.
413
+ Outputs
414
+ ---
415
+ """
416
+ if mode == "previous":
417
+ if self.current_borehole_id == 1:
418
+ self.current_borehole_id = self.list_boreholes[-1]
419
+ else:
420
+ self.current_borehole_id = self.current_borehole_id - 1
421
+ elif mode == "next":
422
+ if self.current_borehole_id == self.list_boreholes[-1]:
423
+ self.current_borehole_id = 1
424
+ else:
425
+ self.current_borehole_id += 1
426
+
427
+ self.lbl_borehole_id.configure(text=self.current_borehole_id)
428
+ self.current_unit_id = self.list_units[0]
429
+ self.update_settings(initialization=False, update=True, changed_borehole=True)
430
+
431
+ def change_unit(self, mode):
432
+ """Changes the unit within a borehole.
433
+ Arguments
434
+ mode, str : specifies which unit was selected.
435
+ Outputs
436
+ ---
437
+ """
438
+ if mode == "previous":
439
+ if self.current_unit_id == 1:
440
+ self.current_unit_id = self.list_units[-1]
441
+ else:
442
+ self.current_unit_id -= 1
443
+
444
+ self.entr_top.configure(textvariable=self.dict_entr_top[self.current_borehole_id][self.current_unit_id])
445
+ self.entr_bottom.configure(textvariable=self.dict_entr_bottom[self.current_borehole_id][
446
+ self.current_unit_id])
447
+
448
+ if self.current_unit_id == 1:
449
+ self.entr_top.configure(state="disabled")
450
+ else:
451
+ self.entr_top.configure(state="normal")
452
+
453
+ if self.current_unit_id == self.list_units[-1]:
454
+ self.entr_bottom.configure(state="disabled")
455
+ else:
456
+ self.entr_bottom.configure(state="normal")
457
+
458
+ elif mode == "next":
459
+ if self.current_unit_id == self.list_units[-1]:
460
+ self.current_unit_id = 1
461
+ else:
462
+ self.current_unit_id += 1
463
+
464
+ self.entr_top.configure(textvariable=self.dict_entr_top[self.current_borehole_id][self.current_unit_id])
465
+ self.entr_bottom.configure(textvariable=self.dict_entr_bottom[self.current_borehole_id][
466
+ self.current_unit_id])
467
+
468
+ if self.current_unit_id == 1:
469
+ self.entr_top.configure(state="disabled")
470
+ else:
471
+ self.entr_top.configure(state="normal")
472
+
473
+ if self.current_unit_id == self.list_units[-1]:
474
+ self.entr_bottom.configure(state="disabled")
475
+ else:
476
+ self.entr_bottom.configure(state="normal")
477
+
478
+ self.lbl_unit_id.configure(text=self.current_unit_id)
479
+
480
+ def change_depth(self, mode, event):
481
+ """Changes the depth of the top or bottom.
482
+ Arguments
483
+ mode, str : specifies if top or bottom was selected.
484
+ Outputs
485
+ ---
486
+ """
487
+ if mode == "top":
488
+ if self.current_unit_id >= 2:
489
+ new_depth = self.dict_entr_top[self.current_borehole_id][self.current_unit_id].get()
490
+ current_top_depth_above = self.dict_entr_top[self.current_borehole_id][self.current_unit_id - 1].get()
491
+
492
+ if new_depth > current_top_depth_above:
493
+ self.dict_entr_bottom[self.current_borehole_id][self.current_unit_id - 1].set(new_depth)
494
+ else:
495
+ self.dict_entr_top[self.current_borehole_id][self.current_unit_id].set(current_top_depth_above + 1)
496
+ self.dict_entr_bottom[self.current_borehole_id][self.current_unit_id - 1].set(
497
+ current_top_depth_above + 1)
498
+
499
+ elif mode == "bottom":
500
+ if self.current_unit_id <= len(self.list_units):
501
+ new_depth = self.dict_entr_bottom[self.current_borehole_id][self.current_unit_id].get()
502
+ current_bottom_depth_below = self.dict_entr_bottom[self.current_borehole_id][
503
+ self.current_unit_id + 1].get()
504
+
505
+ if new_depth < current_bottom_depth_below:
506
+ self.dict_entr_top[self.current_borehole_id][self.current_unit_id + 1].set(new_depth)
507
+ else:
508
+ self.dict_entr_bottom[self.current_borehole_id][self.current_unit_id].set(
509
+ current_bottom_depth_below - 1)
510
+ self.dict_entr_top[self.current_borehole_id][self.current_unit_id + 1].set(
511
+ current_bottom_depth_below - 1)
512
+
513
+ def select_lithology(self, focus, event):
514
+ """Selects a lithology (e.g. sandstone, granite, ...).
515
+ Arguments
516
+ focus, str : specifies which lithology was selected.
517
+ Outputs
518
+ ---
519
+ """
520
+ if len(self.tv_lithology.get_children()) > 0:
521
+ for item in self.tv_lithology.get_children():
522
+ self.tv_lithology.delete(item)
523
+
524
+ n_datapoints = self.var_entr_parts.get()
525
+ categories = ["rho (kg/m\u00B3)", "phi (%)", "vP (m/s)", "vS (m/s)", "vP/vS (1)", "K (GPa)", "G (GPa)",
526
+ "E (GPa)", "nu (1)", "GR (API)", "PE (barns/e\u207B)"]
527
+ categories_short = ["rho", "phi", "vP", "vS", "vPvS", "K", "G", "E", "v", "GR", "PE"]
528
+
529
+ if focus == "sedimentary":
530
+ self.var_opt_plutonic.set("Select plutonic rock")
531
+ self.var_opt_volcanic.set("Select volcanic rock")
532
+ self.var_opt_ultramafic.set("Select ultramafic rock")
533
+ self.var_opt_metamorphic.set("Select metamorphic rock")
534
+ self.var_opt_ore.set("Select ore rock")
535
+
536
+ # Siliciclastic rocks
537
+ if self.var_opt_sedimentary.get() == "Sandstone":
538
+ data = SiliciclasticRocks(fluid="water", actualThickness=0).create_sandstone(
539
+ number=n_datapoints, porosity=[0.0, 0.3])
540
+ elif self.var_opt_sedimentary.get() == "Conglomerate":
541
+ data = SiliciclasticRocks(fluid="water", actualThickness=0).create_conglomerate(
542
+ number=n_datapoints, porosity=[0.0, 0.3])
543
+ elif self.var_opt_sedimentary.get() == "Siltstone":
544
+ data = SiliciclasticRocks(fluid="water", actualThickness=0).create_siltstone(
545
+ number=n_datapoints, porosity=[0.0, 0.1])
546
+ elif self.var_opt_sedimentary.get() == "Mudstone":
547
+ data = SiliciclasticRocks(fluid="water", actualThickness=0).create_mudstone_alt(
548
+ number=n_datapoints, porosity=[0.0, 0.1])
549
+ elif self.var_opt_sedimentary.get() == "Shale":
550
+ data = SiliciclasticRocks(fluid="water", actualThickness=0).create_shale_alt(
551
+ number=n_datapoints, porosity=[0.0, 0.1])
552
+ elif self.var_opt_sedimentary.get() == "Greywacke (Huckenholz)":
553
+ data = SiliciclasticRocks(fluid="water", actualThickness=0).create_greywacke_huckenholz(
554
+ rock="Greywacke", number=n_datapoints, porosity=[0.0, 0.1])
555
+ # Carbonate rocks
556
+ elif self.var_opt_sedimentary.get() == "Limestone":
557
+ data = CarbonateRocks(fluid="water", actualThickness=0).create_limestone(
558
+ number=n_datapoints, porosity=[0.0, 0.4])
559
+ elif self.var_opt_sedimentary.get() == "Dolostone":
560
+ data = CarbonateRocks(fluid="water", actualThickness=0).create_dolostone(
561
+ number=n_datapoints, porosity=[0.0, 0.3])
562
+ elif self.var_opt_sedimentary.get() == "Marl":
563
+ data = CarbonateRocks(fluid="water", actualThickness=0).create_marl(
564
+ number=n_datapoints, porosity=[0.0, 0.3])
565
+
566
+ elif focus == "plutonic":
567
+ self.var_opt_sedimentary.set("Select sedimentary rock")
568
+ self.var_opt_volcanic.set("Select volcanic rock")
569
+ self.var_opt_ultramafic.set("Select ultramafic rock")
570
+ self.var_opt_metamorphic.set("Select metamorphic rock")
571
+ self.var_opt_ore.set("Select ore rock")
572
+
573
+ if self.var_opt_plutonic.get() in [
574
+ "Granite", "Granodiorite", "Tonalite", "Gabbro", "Norite", "Diorite", "Monzodiorite", "Monzogabbro",
575
+ "Monzonite", "Syenite", "Granitoid", "Quarzolite", "Foid-bearing Syenite", "Foid-bearing Monzonite",
576
+ "Foid-bearing Monzodiorite", "Foid-bearing Monzogabbro", "Foid Monzosyenite", "Foid Monzodiorite",
577
+ "Foid Monzogabbro", "Foidolite"]:
578
+ if self.var_opt_plutonic.get() in [
579
+ "Foid-bearing Syenite", "Foid-bearing Monzonite", "Foid-bearing Monzodiorite",
580
+ "Foid-bearing Monzogabbro", "Foid Monzosyenite", "Foid Monzodiorite", "Foid Monzogabbro",
581
+ "Foidolite"]:
582
+ data = Plutonic(
583
+ fluid="water", actualThickness=0, dict_output=True,
584
+ porosity=[0.0, 0.1]).create_plutonic_rock_streckeisen(
585
+ rock=self.var_opt_plutonic.get(), number=n_datapoints, porosity=[0.0, 0.1],
586
+ upper_streckeisen=False)
587
+ else:
588
+ data = Plutonic(
589
+ fluid="water", actualThickness=0, dict_output=True,
590
+ porosity=[0.0, 0.1]).create_plutonic_rock_streckeisen(
591
+ rock=self.var_opt_plutonic.get(), number=n_datapoints, porosity=[0.0, 0.1])
592
+ elif self.var_opt_igneous.get() in ["Rhyolite", "Dacite", "Trachyte", "Latite", "Andesite", "Basalt",
593
+ "Foid-bearing Trachyte", "Foid-bearing Latite", "Foid-bearing Andesite", "Foid-bearing Basalt",
594
+ "Phonolite", "Tephrite", "Foidite"]:
595
+ if self.var_opt_igneous.get() in [
596
+ "Foid-bearing Trachyte", "Foid-bearing Latite", "Foid-bearing Andesite", "Foid-bearing Basalt",
597
+ "Phonolite", "Tephrite", "Foidite"]:
598
+ data = Volcanic(
599
+ fluid="water", actualThickness=0, dict_output=True,
600
+ porosity=[0.0, 0.1]).create_volcanic_rock_streckeisen(
601
+ rock=self.var_opt_igneous.get(), number=n_datapoints, upper_streckeisen=False)
602
+ else:
603
+ data = Volcanic(
604
+ fluid="water", actualThickness=0, dict_output=True,
605
+ porosity=[0.0, 0.1]).create_volcanic_rock_streckeisen(
606
+ rock=self.var_opt_igneous.get(), number=n_datapoints)
607
+
608
+ elif focus == "volcanic":
609
+ self.var_opt_sedimentary.set("Select sedimentary rock")
610
+ self.var_opt_plutonic.set("Select plutonic rock")
611
+ self.var_opt_ultramafic.set("Select ultramafic rock")
612
+ self.var_opt_metamorphic.set("Select metamorphic rock")
613
+ self.var_opt_ore.set("Select ore rock")
614
+
615
+ if self.var_opt_volcanic.get() in ["Rhyolite", "Dacite", "Trachyte", "Latite", "Andesite", "Basalt",
616
+ "Foid-bearing Trachyte", "Foid-bearing Latite", "Foid-bearing Andesite", "Foid-bearing Basalt",
617
+ "Phonolite", "Tephrite", "Foidite"]:
618
+ if self.var_opt_volcanic.get() in [
619
+ "Foid-bearing Trachyte", "Foid-bearing Latite", "Foid-bearing Andesite", "Foid-bearing Basalt",
620
+ "Phonolite", "Tephrite", "Foidite"]:
621
+ data = Volcanic(
622
+ fluid="water", actualThickness=0, dict_output=True,
623
+ porosity=[0.0, 0.1]).create_volcanic_rock_streckeisen(
624
+ rock=self.var_opt_volcanic.get(), number=n_datapoints, upper_streckeisen=False)
625
+ else:
626
+ data = Volcanic(
627
+ fluid="water", actualThickness=0, dict_output=True,
628
+ porosity=[0.0, 0.1]).create_volcanic_rock_streckeisen(
629
+ rock=self.var_opt_volcanic.get(), number=n_datapoints)
630
+
631
+ elif focus == "ultramafic":
632
+ self.var_opt_sedimentary.set("Select sedimentary rock")
633
+ self.var_opt_plutonic.set("Select plutonic rock")
634
+ self.var_opt_volcanic.set("Select volcanic rock")
635
+ self.var_opt_metamorphic.set("Select metamorphic rock")
636
+ self.var_opt_ore.set("Select ore rock")
637
+
638
+ if self.var_opt_ultramafic.get() in [
639
+ "Orthopyroxenite", "Clinopyroxenite", "Dunite", "Harzburgite", "Wehrlite", "Websterite", "Lherzolite",
640
+ "Olivine-Websterite", "Olivine-Orthopyroxenite", "Olivine-Clinopyroxenite", "Peridotite", "Pyroxenite"]:
641
+ data = UltraMafic(
642
+ fluid="water", actualThickness=0, dict_output=True, porosity=[0.0, 0.1]).create_ultramafic_rock(
643
+ rock=self.var_opt_ultramafic.get(), number=n_datapoints)
644
+
645
+ elif focus == "metamorphic":
646
+ self.var_opt_sedimentary.set("Select sedimentary rock")
647
+ self.var_opt_plutonic.set("Select plutonic rock")
648
+ self.var_opt_volcanic.set("Select volcanic rock")
649
+ self.var_opt_ultramafic.set("Select ultramafic rock")
650
+ self.var_opt_ore.set("Select ore rock")
651
+
652
+ if self.var_opt_metamorphic.get() == "Felsic Granulite":
653
+ data = GranuliteFacies(
654
+ fluid="water", actual_thickness=0, porosity=[0.0, 0.1]).create_granulite(
655
+ number=n_datapoints, classification="felsic")
656
+ elif self.var_opt_metamorphic.get() == "Mafic Granulite":
657
+ data = GranuliteFacies(
658
+ fluid="water", actual_thickness=0, porosity=[0.0, 0.1]).create_granulite(
659
+ number=n_datapoints, classification="mafic")
660
+ elif self.var_opt_metamorphic.get() == "Basaltic Greenschist":
661
+ data = GreenschistFacies(
662
+ fluid="water", actual_thickness=0, porosity=[0.0, 0.1]).create_greenschist_basaltic_alt(
663
+ number=n_datapoints)
664
+ elif self.var_opt_metamorphic.get() == "Ultramafic Greenschist":
665
+ data = GreenschistFacies(
666
+ fluid="water", actual_thickness=0, porosity=[0.0, 0.1]).create_greenschist_ultramafic_alt(
667
+ number=n_datapoints)
668
+ elif self.var_opt_metamorphic.get() == "Pelitic Greenschist":
669
+ data = GreenschistFacies(
670
+ fluid="water", actual_thickness=0, porosity=[0.0, 0.1]).create_greenschist_pelitic_alt(
671
+ number=n_datapoints)
672
+ # Amphibolite-Facies
673
+ elif self.var_opt_metamorphic.get() == "Ortho-Amphibolite":
674
+ data = AmphiboliteFacies(
675
+ fluid="water", actual_thickness=0, porosity=[0.0, 0.1]).create_amphibolite_ortho(
676
+ number=n_datapoints)
677
+
678
+ elif focus == "ore":
679
+ self.var_opt_sedimentary.set("Select sedimentary rock")
680
+ self.var_opt_plutonic.set("Select plutonic rock")
681
+ self.var_opt_volcanic.set("Select volcanic rock")
682
+ self.var_opt_ultramafic.set("Select ultramafic rock")
683
+ self.var_opt_metamorphic.set("Select metamorphic rock")
684
+
685
+ if self.var_opt_ore.get() in [
686
+ "Itabirite", "Banded Iron Formation", "Compact Hematite", "Friable Hematite", "Goethite Hematite",
687
+ "Al-rich Itabirite", "Compact Quartz Itabirite", "Friable Quartz Itabirite", "Goethite Itabirite"]:
688
+ data = OreRocks(
689
+ fluid="water", actual_thickness=0, porosity=[0.0, 0.1]).create_siliciclastic_itabirite(
690
+ rock=self.var_opt_ore.get(), number=n_datapoints)
691
+
692
+ self.fill_lithology_table(dataset=data, categories_long=categories, categories_short=categories_short)
693
+
694
+ def fill_lithology_table(self, dataset, categories_long, categories_short):
695
+ for index, category in enumerate(categories_long):
696
+ entries = [category]
697
+
698
+ if categories_short[index] == "vPvS":
699
+ category_short = "vP/vS"
700
+ elif categories_short[index] == "v":
701
+ category_short = "nu"
702
+ else:
703
+ category_short = categories_short[index]
704
+
705
+ n_digits = 3
706
+
707
+ var_entr_min = round(min(dataset[category_short]), n_digits)
708
+ var_entr_max = round(max(dataset[category_short]), n_digits)
709
+ var_entr_mean = round(np.mean(dataset[category_short]), n_digits)
710
+ var_entr_error = round(np.std(dataset[category_short], ddof=1), n_digits)
711
+
712
+ entries.extend([var_entr_min, var_entr_max, var_entr_mean, var_entr_error])
713
+ self.tv_lithology.insert("", tk.END, values=entries)
714
+
715
+ entries = ["-", "-", "-", "-", "-"]
716
+ self.tv_lithology.insert("", tk.END, values=entries)
717
+
718
+ for mineral, data_values in dataset["mineralogy"].items():
719
+ entries = [str(mineral) + str(" (%)")]
720
+
721
+ n_digits = 2
722
+ var_factor = 100
723
+
724
+ var_entr_min = round(var_factor*min(data_values), n_digits)
725
+ var_entr_max = round(var_factor*max(data_values), n_digits)
726
+ var_entr_mean = round(var_factor*np.mean(data_values), n_digits)
727
+ var_entr_error = round(var_factor*np.std(data_values, ddof=1), n_digits)
728
+
729
+ entries.extend([var_entr_min, var_entr_max, var_entr_mean, var_entr_error])
730
+ self.tv_lithology.insert("", tk.END, values=entries)
731
+
732
+ entries = ["-", "-", "-", "-", "-"]
733
+ self.tv_lithology.insert("", tk.END, values=entries)
734
+
735
+ for element, data_values in dataset["chemistry"].items():
736
+ entries = [str(element) + str(" (%)")]
737
+
738
+ n_digits = 2
739
+ var_factor = 100
740
+
741
+ var_entr_min = round(var_factor*min(data_values), n_digits)
742
+ var_entr_max = round(var_factor*max(data_values), n_digits)
743
+ var_entr_mean = round(var_factor*np.mean(data_values), n_digits)
744
+ var_entr_error = round(var_factor*np.std(data_values, ddof=1), n_digits)
745
+
746
+ entries.extend([var_entr_min, var_entr_max, var_entr_mean, var_entr_error])
747
+ self.tv_lithology.insert("", tk.END, values=entries)
748
+
749
+ if "compounds" in dataset:
750
+ entries = ["-", "-", "-", "-", "-"]
751
+ self.tv_lithology.insert("", tk.END, values=entries)
752
+
753
+ for compound, data_values in dataset["compounds"].items():
754
+ entries = [str(compound) + str(" (%)")]
755
+
756
+ n_digits = 2
757
+ var_factor = 100
758
+
759
+ var_entr_min = round(var_factor*min(data_values), n_digits)
760
+ var_entr_max = round(var_factor*max(data_values), n_digits)
761
+ var_entr_mean = round(var_factor*np.mean(data_values), n_digits)
762
+ var_entr_error = round(var_factor*np.std(data_values, ddof=1), n_digits)
763
+
764
+ entries.extend([var_entr_min, var_entr_max, var_entr_mean, var_entr_error])
765
+ self.tv_lithology.insert("", tk.END, values=entries)