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.
- gebpy/__init__.py +55 -0
- gebpy/__pycache__/__init__.cpython-310.pyc +0 -0
- gebpy/adapters/__init__.py +0 -0
- gebpy/cli/__init__.py +0 -0
- gebpy/core/__init__.py +0 -0
- gebpy/core/chemistry/__init__.py +0 -0
- gebpy/core/chemistry/common.py +1369 -0
- gebpy/core/chemistry/elements.py +317 -0
- gebpy/core/chemistry/geochemistry.py +1728 -0
- gebpy/core/fluids/__init__.py +0 -0
- gebpy/core/io/__init__.py +0 -0
- gebpy/core/mathematics/__init__.py +0 -0
- gebpy/core/minerals/__init__.py +0 -0
- gebpy/core/minerals/carbonates.py +412 -0
- gebpy/core/minerals/common.py +555 -0
- gebpy/core/minerals/config.py +77 -0
- gebpy/core/minerals/cyclosilicates.py +0 -0
- gebpy/core/minerals/halides.py +0 -0
- gebpy/core/minerals/inosilicates.py +0 -0
- gebpy/core/minerals/nesosilicates.py +0 -0
- gebpy/core/minerals/organics.py +0 -0
- gebpy/core/minerals/oxides.py +589 -0
- gebpy/core/minerals/phosphates.py +0 -0
- gebpy/core/minerals/phospides.py +0 -0
- gebpy/core/minerals/phyllosilicates.py +436 -0
- gebpy/core/minerals/sorosilicates.py +0 -0
- gebpy/core/minerals/sulfates.py +0 -0
- gebpy/core/minerals/sulfides.py +459 -0
- gebpy/core/minerals/synthesis.py +201 -0
- gebpy/core/minerals/tectosilicates.py +433 -0
- gebpy/core/physics/__init__.py +0 -0
- gebpy/core/physics/common.py +53 -0
- gebpy/core/physics/geophysics.py +351 -0
- gebpy/core/rocks/__init__.py +0 -0
- gebpy/core/rocks/anisotropic_rocks.py +395 -0
- gebpy/core/rocks/common.py +95 -0
- gebpy/core/rocks/config.py +77 -0
- gebpy/core/rocks/isotropic_rocks.py +395 -0
- gebpy/core/rocks/sedimentary.py +385 -0
- gebpy/core/subsurface/__init__.py +0 -0
- gebpy/data_minerals/__init__.py +0 -0
- gebpy/data_minerals/albite.yaml +59 -0
- gebpy/data_minerals/anatase.yaml +43 -0
- gebpy/data_minerals/ankerite.yaml +47 -0
- gebpy/data_minerals/annite.yaml +57 -0
- gebpy/data_minerals/anorthite.yaml +59 -0
- gebpy/data_minerals/antigorite.yaml +53 -0
- gebpy/data_minerals/aragonite.yaml +48 -0
- gebpy/data_minerals/argutite.yaml +43 -0
- gebpy/data_minerals/arsenolite.yaml +40 -0
- gebpy/data_minerals/au3oxide.yaml +46 -0
- gebpy/data_minerals/avicennite.yaml +40 -0
- gebpy/data_minerals/azurite.yaml +53 -0
- gebpy/data_minerals/baddeleyite.yaml +49 -0
- gebpy/data_minerals/bismite.yaml +49 -0
- gebpy/data_minerals/boehmite.yaml +48 -0
- gebpy/data_minerals/brookite.yaml +46 -0
- gebpy/data_minerals/brucite.yaml +45 -0
- gebpy/data_minerals/bunsenite.yaml +40 -0
- gebpy/data_minerals/calcite.yaml +45 -0
- gebpy/data_minerals/cassiterite.yaml +43 -0
- gebpy/data_minerals/cerussite.yaml +48 -0
- gebpy/data_minerals/chamosite.yaml +56 -0
- gebpy/data_minerals/chlorite.yaml +75 -0
- gebpy/data_minerals/chromite.yaml +42 -0
- gebpy/data_minerals/chrysotile.yaml +53 -0
- gebpy/data_minerals/claudetite.yaml +49 -0
- gebpy/data_minerals/clinochlore.yaml +55 -0
- gebpy/data_minerals/cochromite.yaml +42 -0
- gebpy/data_minerals/corundum.yaml +43 -0
- gebpy/data_minerals/crocoite.yaml +51 -0
- gebpy/data_minerals/cuprite.yaml +40 -0
- gebpy/data_minerals/cuprospinel.yaml +42 -0
- gebpy/data_minerals/diaspore.yaml +48 -0
- gebpy/data_minerals/dolomite.yaml +47 -0
- gebpy/data_minerals/eastonite.yaml +57 -0
- gebpy/data_minerals/eskolaite.yaml +43 -0
- gebpy/data_minerals/fechlorite.yaml +61 -0
- gebpy/data_minerals/fecolumbite.yaml +48 -0
- gebpy/data_minerals/ferberite.yaml +51 -0
- gebpy/data_minerals/fetantalite.yaml +48 -0
- gebpy/data_minerals/franklinite.yaml +42 -0
- gebpy/data_minerals/gahnite.yaml +42 -0
- gebpy/data_minerals/galaxite.yaml +42 -0
- gebpy/data_minerals/geikielite.yaml +45 -0
- gebpy/data_minerals/gibbsite.yaml +51 -0
- gebpy/data_minerals/glauconite.yaml +69 -0
- gebpy/data_minerals/goethite.yaml +48 -0
- gebpy/data_minerals/groutite.yaml +48 -0
- gebpy/data_minerals/hematite.yaml +43 -0
- gebpy/data_minerals/hercynite.yaml +42 -0
- gebpy/data_minerals/huebnerite.yaml +51 -0
- gebpy/data_minerals/ikaite.yaml +53 -0
- gebpy/data_minerals/illite.yaml +55 -0
- gebpy/data_minerals/ilmenite.yaml +45 -0
- gebpy/data_minerals/jacobsite.yaml +42 -0
- gebpy/data_minerals/kalsilite.yaml +47 -0
- gebpy/data_minerals/kaolinite.yaml +59 -0
- gebpy/data_minerals/karelianite.yaml +43 -0
- gebpy/data_minerals/lime.yaml +40 -0
- gebpy/data_minerals/litharge.yaml +43 -0
- gebpy/data_minerals/magnesiochromite.yaml +42 -0
- gebpy/data_minerals/magnesioferrite.yaml +42 -0
- gebpy/data_minerals/magnesite.yaml +45 -0
- gebpy/data_minerals/magnetite.yaml +41 -0
- gebpy/data_minerals/malachite.yaml +53 -0
- gebpy/data_minerals/manganite.yaml +51 -0
- gebpy/data_minerals/manganochromite.yaml +42 -0
- gebpy/data_minerals/manganosite.yaml +40 -0
- gebpy/data_minerals/marialite.yaml +49 -0
- gebpy/data_minerals/massicot.yaml +46 -0
- gebpy/data_minerals/meionite.yaml +49 -0
- gebpy/data_minerals/mgchlorite.yaml +61 -0
- gebpy/data_minerals/mgcolumbite.yaml +48 -0
- gebpy/data_minerals/mgtantalite.yaml +48 -0
- gebpy/data_minerals/microcline.yaml +59 -0
- gebpy/data_minerals/minium.yaml +44 -0
- gebpy/data_minerals/mnchlorite.yaml +61 -0
- gebpy/data_minerals/mncolumbite.yaml +48 -0
- gebpy/data_minerals/mntantalite.yaml +48 -0
- gebpy/data_minerals/monteponite.yaml +40 -0
- gebpy/data_minerals/montmorillonite.yaml +77 -0
- gebpy/data_minerals/muscovite.yaml +55 -0
- gebpy/data_minerals/nanepheline.yaml +47 -0
- gebpy/data_minerals/nichlorite.yaml +61 -0
- gebpy/data_minerals/nichromite.yaml +42 -0
- gebpy/data_minerals/nimite.yaml +55 -0
- gebpy/data_minerals/nontronite.yaml +73 -0
- gebpy/data_minerals/orthoclase.yaml +53 -0
- gebpy/data_minerals/paratellurite.yaml +43 -0
- gebpy/data_minerals/pennantite.yaml +61 -0
- gebpy/data_minerals/periclase.yaml +40 -0
- gebpy/data_minerals/phlogopite.yaml +57 -0
- gebpy/data_minerals/plattnerite.yaml +43 -0
- gebpy/data_minerals/powellite.yaml +45 -0
- gebpy/data_minerals/pyrite.yaml +40 -0
- gebpy/data_minerals/pyrolusite.yaml +43 -0
- gebpy/data_minerals/pyrophanite.yaml +45 -0
- gebpy/data_minerals/pyrophyllite.yaml +59 -0
- gebpy/data_minerals/quartz.yaml +43 -0
- gebpy/data_minerals/rhodochrosite.yaml +45 -0
- gebpy/data_minerals/rutile.yaml +43 -0
- gebpy/data_minerals/saponite.yaml +77 -0
- gebpy/data_minerals/scheelite.yaml +45 -0
- gebpy/data_minerals/scrutinyite.yaml +46 -0
- gebpy/data_minerals/senarmontite.yaml +40 -0
- gebpy/data_minerals/siderite.yaml +45 -0
- gebpy/data_minerals/siderophyllite.yaml +57 -0
- gebpy/data_minerals/smithsonite.yaml +45 -0
- gebpy/data_minerals/spinel.yaml +42 -0
- gebpy/data_minerals/stishovite.yaml +43 -0
- gebpy/data_minerals/stolzite.yaml +45 -0
- gebpy/data_minerals/talc.yaml +53 -0
- gebpy/data_minerals/tistarite.yaml +43 -0
- gebpy/data_minerals/trevorite.yaml +42 -0
- gebpy/data_minerals/ulvoespinel.yaml +42 -0
- gebpy/data_minerals/uraninite.yaml +40 -0
- gebpy/data_minerals/valentinite.yaml +46 -0
- gebpy/data_minerals/vermiculite.yaml +69 -0
- gebpy/data_minerals/wulfenite.yaml +45 -0
- gebpy/data_minerals/wustite.yaml +40 -0
- gebpy/data_minerals/zincite.yaml +43 -0
- gebpy/data_minerals/zincochromite.yaml +42 -0
- gebpy/data_rocks/__init__.py +0 -0
- gebpy/data_rocks/dolostone.yaml +40 -0
- gebpy/data_rocks/limestone.yaml +40 -0
- gebpy/data_rocks/marl.yaml +50 -0
- gebpy/data_rocks/sandstone.yaml +39 -0
- gebpy/data_rocks/shale.yaml +50 -0
- gebpy/gebpy_app.py +8732 -0
- gebpy/gui/__init__.py +0 -0
- gebpy/lib/images/GebPy_Header.png +0 -0
- gebpy/lib/images/GebPy_Icon.png +0 -0
- gebpy/lib/images/GebPy_Logo.png +0 -0
- gebpy/main.py +29 -0
- gebpy/modules/__init__.py +0 -0
- gebpy/modules/__pycache__/__init__.cpython-310.pyc +0 -0
- gebpy/modules/__pycache__/metamorphics.cpython-310.pyc +0 -0
- gebpy/modules/__pycache__/silicates.cpython-310.pyc +0 -0
- gebpy/modules/carbonates.py +2658 -0
- gebpy/modules/chemistry.py +1369 -0
- gebpy/modules/core.py +1805 -0
- gebpy/modules/elements.py +317 -0
- gebpy/modules/evaporites.py +1299 -0
- gebpy/modules/exploration.py +1145 -0
- gebpy/modules/fluids.py +339 -0
- gebpy/modules/geochemistry.py +1727 -0
- gebpy/modules/geophysics.py +351 -0
- gebpy/modules/gui.py +9093 -0
- gebpy/modules/gui_elements.py +145 -0
- gebpy/modules/halides.py +485 -0
- gebpy/modules/igneous.py +2241 -0
- gebpy/modules/metamorphics.py +3222 -0
- gebpy/modules/mineralogy.py +442 -0
- gebpy/modules/minerals.py +7954 -0
- gebpy/modules/ore.py +1648 -0
- gebpy/modules/organics.py +530 -0
- gebpy/modules/oxides.py +9057 -0
- gebpy/modules/petrophysics.py +98 -0
- gebpy/modules/phosphates.py +589 -0
- gebpy/modules/phospides.py +194 -0
- gebpy/modules/plotting.py +619 -0
- gebpy/modules/pyllosilicates.py +380 -0
- gebpy/modules/sedimentary_rocks.py +908 -0
- gebpy/modules/sequences.py +2166 -0
- gebpy/modules/series.py +1625 -0
- gebpy/modules/silicates.py +11102 -0
- gebpy/modules/siliciclastics.py +1846 -0
- gebpy/modules/subsurface_2d.py +179 -0
- gebpy/modules/sulfates.py +1629 -0
- gebpy/modules/sulfides.py +4786 -0
- gebpy/plotting/__init__.py +0 -0
- gebpy/ui_nb/__init__.py +0 -0
- gebpy/user_data/.gitkeep +0 -0
- gebpy-1.1.3.dist-info/LICENSE +165 -0
- gebpy-1.1.3.dist-info/METADATA +207 -0
- gebpy-1.1.3.dist-info/RECORD +254 -0
- gebpy-1.1.3.dist-info/WHEEL +5 -0
- gebpy-1.1.3.dist-info/entry_points.txt +2 -0
- gebpy-1.1.3.dist-info/top_level.txt +1 -0
- modules/__init__.py +0 -0
- modules/carbonates.py +2658 -0
- modules/chemistry.py +1369 -0
- modules/core.py +1805 -0
- modules/elements.py +317 -0
- modules/evaporites.py +1299 -0
- modules/exploration.py +765 -0
- modules/fluids.py +339 -0
- modules/geochemistry.py +1727 -0
- modules/geophysics.py +337 -0
- modules/gui.py +9093 -0
- modules/gui_elements.py +145 -0
- modules/halides.py +485 -0
- modules/igneous.py +2196 -0
- modules/metamorphics.py +2699 -0
- modules/mineralogy.py +442 -0
- modules/minerals.py +7954 -0
- modules/ore.py +1628 -0
- modules/organics.py +530 -0
- modules/oxides.py +9057 -0
- modules/petrophysics.py +98 -0
- modules/phosphates.py +589 -0
- modules/phospides.py +194 -0
- modules/plotting.py +619 -0
- modules/pyllosilicates.py +380 -0
- modules/sedimentary_rocks.py +908 -0
- modules/sequences.py +2166 -0
- modules/series.py +1625 -0
- modules/silicates.py +11102 -0
- modules/siliciclastics.py +1830 -0
- modules/subsurface_2d.py +179 -0
- modules/sulfates.py +1629 -0
- modules/sulfides.py +4786 -0
- notebooks/__init__.py +0 -0
modules/gui_elements.py
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
# -*-coding: utf-8 -*-
|
|
3
|
+
# ----------------------
|
|
4
|
+
# gui_elements.py
|
|
5
|
+
# Maximilian Beeskow
|
|
6
|
+
# 22.03.2023
|
|
7
|
+
# ----------------------
|
|
8
|
+
#
|
|
9
|
+
## MODULES
|
|
10
|
+
import tkinter as tk
|
|
11
|
+
from tkinter import ttk
|
|
12
|
+
#
|
|
13
|
+
## CLASSES
|
|
14
|
+
class SimpleElements:
|
|
15
|
+
#
|
|
16
|
+
def __init__(self, parent, row_id, column_id, fg, bg, n_rows=1, n_columns=1):
|
|
17
|
+
self.parent = parent
|
|
18
|
+
self.row_id = row_id
|
|
19
|
+
self.column_id = column_id
|
|
20
|
+
self.n_rows = n_rows
|
|
21
|
+
self.n_columns = n_columns
|
|
22
|
+
self.fg = fg
|
|
23
|
+
self.bg = bg
|
|
24
|
+
#
|
|
25
|
+
def create_frame(self, relief=tk.FLAT):
|
|
26
|
+
frm = tk.Frame(self.parent, bg=self.bg, borderwidth=0, highlightthickness=0, relief=relief)
|
|
27
|
+
frm.grid(row=self.row_id, column=self.column_id, rowspan=self.n_rows, columnspan=self.n_columns, sticky="nesw")
|
|
28
|
+
#
|
|
29
|
+
return frm
|
|
30
|
+
#
|
|
31
|
+
def create_label(self, text, font_option=None, relief=tk.GROOVE, sticky_option="nesw", anchor_option=tk.CENTER):
|
|
32
|
+
if font_option != None:
|
|
33
|
+
lbl = tk.Label(self.parent, text=text, relief=relief, bg=self.bg, fg=self.fg, font=(font_option),
|
|
34
|
+
anchor=anchor_option)
|
|
35
|
+
else:
|
|
36
|
+
lbl = tk.Label(self.parent, text=text, relief=relief, bg=self.bg, fg=self.fg, font=(font_option),
|
|
37
|
+
anchor=anchor_option)
|
|
38
|
+
#
|
|
39
|
+
lbl.grid(row=self.row_id, column=self.column_id, rowspan=self.n_rows, columnspan=self.n_columns,
|
|
40
|
+
sticky=sticky_option)
|
|
41
|
+
#
|
|
42
|
+
return lbl
|
|
43
|
+
#
|
|
44
|
+
def create_option_menu(self, var_opt, var_opt_set, opt_list, active_bg="#F9DED7", command=None):
|
|
45
|
+
var_opt.set(var_opt_set)
|
|
46
|
+
if command == None:
|
|
47
|
+
opt_menu = tk.OptionMenu(self.parent, var_opt, *opt_list)
|
|
48
|
+
else:
|
|
49
|
+
opt_menu = tk.OptionMenu(self.parent, var_opt, *opt_list, command=command)
|
|
50
|
+
opt_menu.config(bg=self.bg)
|
|
51
|
+
opt_menu.grid(row=self.row_id, column=self.column_id, rowspan=self.n_rows, columnspan=self.n_columns,
|
|
52
|
+
sticky="nesw")
|
|
53
|
+
opt_menu.config(bg=self.bg, fg=self.fg, activebackground=active_bg, highlightthickness=0)
|
|
54
|
+
opt_menu["menu"].config(bg=self.bg, fg=self.fg, activebackground=active_bg)
|
|
55
|
+
#
|
|
56
|
+
return opt_menu
|
|
57
|
+
#
|
|
58
|
+
def create_entry(self, var_entr, var_entr_set=None, width=None, command=None):
|
|
59
|
+
if var_entr_set != None:
|
|
60
|
+
var_entr.set(var_entr_set)
|
|
61
|
+
if width == None:
|
|
62
|
+
entry = tk.Entry(self.parent, textvariable=var_entr, background=self.bg, fg=self.fg, highlightthickness=0)
|
|
63
|
+
else:
|
|
64
|
+
entry = tk.Entry(self.parent, textvariable=var_entr, background=self.bg, fg=self.fg, highlightthickness=0,
|
|
65
|
+
width=width)
|
|
66
|
+
entry.grid(row=self.row_id, column=self.column_id, rowspan=self.n_rows, columnspan=self.n_columns,
|
|
67
|
+
sticky="nesw")
|
|
68
|
+
if command != None:
|
|
69
|
+
entry.bind("<Return>", command)
|
|
70
|
+
#
|
|
71
|
+
return entry
|
|
72
|
+
#
|
|
73
|
+
def create_radiobutton(self, var_rb, value_rb, color_bg, relief=tk.FLAT, command=None, text="", anchor_option=tk.W):
|
|
74
|
+
if command == None:
|
|
75
|
+
rb = tk.Radiobutton(self.parent, text=text, variable=var_rb, value=value_rb, bg=self.bg, fg=self.fg,
|
|
76
|
+
activebackground=self.bg, highlightthickness=0, relief=relief, selectcolor=self.bg,
|
|
77
|
+
anchor=anchor_option)
|
|
78
|
+
else:
|
|
79
|
+
rb = tk.Radiobutton(self.parent, text=text, variable=var_rb, value=value_rb, bg=self.bg, fg=self.fg,
|
|
80
|
+
activebackground=self.bg, highlightthickness=0, relief=relief, selectcolor=self.bg,
|
|
81
|
+
anchor=anchor_option, command=command)
|
|
82
|
+
#
|
|
83
|
+
rb.grid(row=self.row_id, column=self.column_id, rowspan=self.n_rows, columnspan=self.n_columns, sticky="nesw")
|
|
84
|
+
#
|
|
85
|
+
return rb
|
|
86
|
+
#
|
|
87
|
+
def create_button(self, text, command=None):
|
|
88
|
+
if command == None:
|
|
89
|
+
btn = tk.Button(
|
|
90
|
+
self.parent, text=text, bg=self.bg, fg=self.fg, activebackground="#F9DED7", highlightbackground=self.bg,
|
|
91
|
+
highlightthickness=0)
|
|
92
|
+
else:
|
|
93
|
+
btn = tk.Button(
|
|
94
|
+
self.parent, text=text, bg=self.bg, fg=self.fg, activebackground="#F9DED7", highlightbackground=self.bg,
|
|
95
|
+
highlightthickness=0, command=command)
|
|
96
|
+
#
|
|
97
|
+
btn.grid(row=self.row_id, column=self.column_id, rowspan=self.n_rows, columnspan=self.n_columns, sticky="nesw")
|
|
98
|
+
#
|
|
99
|
+
return btn
|
|
100
|
+
#
|
|
101
|
+
def create_checkbox(self, text, var_cb, command=None):
|
|
102
|
+
if command == None:
|
|
103
|
+
cb = tk.Checkbutton(self.parent, text=text, variable=var_cb, bg=self.bg, fg=self.fg,
|
|
104
|
+
activebackground="#F9DED7", highlightbackground=self.bg, highlightthickness=0)
|
|
105
|
+
else:
|
|
106
|
+
cb = tk.Checkbutton(self.parent, text=text, variable=var_cb, bg=self.bg, fg=self.fg,
|
|
107
|
+
activebackground="#F9DED7", highlightbackground=self.bg, highlightthickness=0,
|
|
108
|
+
command=command)
|
|
109
|
+
cb.grid(row=self.row_id, column=self.column_id, rowspan=self.n_rows, columnspan=self.n_columns, sticky="nesw")
|
|
110
|
+
#
|
|
111
|
+
return cb
|
|
112
|
+
#
|
|
113
|
+
def create_treeview(self, n_categories=2, text_1="Ratio", text_2="\u03BC", width_1 = 90, width_2 = 90, text_n=[],
|
|
114
|
+
width_n=[], individual=False):
|
|
115
|
+
ttk.Style().configure("Treeview", background=self.bg, foreground=self.fg, fieldbackground=self.bg)
|
|
116
|
+
style = ttk.Style()
|
|
117
|
+
style.configure("Treeview.Heading", background=self.bg, pressed_color=self.bg,
|
|
118
|
+
highlight_color=self.bg, foreground=self.fg)
|
|
119
|
+
#
|
|
120
|
+
if n_categories == 2 and individual == False:
|
|
121
|
+
columns = ("#1", "#2")
|
|
122
|
+
treeview = ttk.Treeview(self.parent, columns=columns, show="headings")
|
|
123
|
+
treeview.heading("#1", text=text_1)
|
|
124
|
+
treeview.column("#1", minwidth=0, width=width_1, stretch=tk.NO, anchor=tk.CENTER)
|
|
125
|
+
treeview.heading("#2", text=text_2)
|
|
126
|
+
treeview.column("#2", minwidth=0, width=width_2, stretch=tk.YES, anchor=tk.CENTER)
|
|
127
|
+
treeview.grid(row=self.row_id, column=self.column_id, rowspan=self.n_rows, columnspan=self.n_columns,
|
|
128
|
+
sticky="nesw")
|
|
129
|
+
#
|
|
130
|
+
if n_categories > 1 and individual == True:
|
|
131
|
+
columns = []
|
|
132
|
+
for n in range(n_categories):
|
|
133
|
+
var_i = "#" + str(n + 1)
|
|
134
|
+
columns.append(var_i)
|
|
135
|
+
#
|
|
136
|
+
treeview = ttk.Treeview(self.parent, columns=columns, show="headings")
|
|
137
|
+
#
|
|
138
|
+
for index, element in enumerate(columns):
|
|
139
|
+
treeview.heading(element, text=text_n[index])
|
|
140
|
+
treeview.column(element, minwidth=0, width=width_n[index], stretch=tk.NO, anchor=tk.CENTER)
|
|
141
|
+
#
|
|
142
|
+
treeview.grid(row=self.row_id, column=self.column_id, rowspan=self.n_rows, columnspan=self.n_columns,
|
|
143
|
+
sticky="nesw")
|
|
144
|
+
#
|
|
145
|
+
return treeview
|
modules/halides.py
ADDED
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
# -*-coding: utf-8 -*-
|
|
3
|
+
|
|
4
|
+
# -----------------------------------------------
|
|
5
|
+
|
|
6
|
+
# Name: halides.py
|
|
7
|
+
# Author: Maximilian A. Beeskow
|
|
8
|
+
# Version: 1.0
|
|
9
|
+
# Date: 20.09.2022
|
|
10
|
+
|
|
11
|
+
# -----------------------------------------------
|
|
12
|
+
|
|
13
|
+
# MODULES
|
|
14
|
+
import numpy as np
|
|
15
|
+
import random as rd
|
|
16
|
+
from modules.chemistry import PeriodicSystem, DataProcessing
|
|
17
|
+
from modules.minerals import CrystalPhysics
|
|
18
|
+
from modules.geophysics import BoreholeGeophysics as bg
|
|
19
|
+
from modules.geophysics import WellLog as wg
|
|
20
|
+
from modules.geochemistry import MineralChemistry
|
|
21
|
+
|
|
22
|
+
# Halogenes
|
|
23
|
+
class Halides:
|
|
24
|
+
""" Class that generates geophysical and geochemical data of halogene minerals"""
|
|
25
|
+
#
|
|
26
|
+
def __init__(self, traces_list=[], impurity="pure", dict=False, mineral=None):
|
|
27
|
+
self.traces_list = traces_list
|
|
28
|
+
self.impurity = impurity
|
|
29
|
+
self.dict = dict
|
|
30
|
+
self.mineral = mineral
|
|
31
|
+
#
|
|
32
|
+
def generate_dataset(self, number):
|
|
33
|
+
dataset = {}
|
|
34
|
+
#
|
|
35
|
+
for index in range(number):
|
|
36
|
+
if self.mineral == "Halite":
|
|
37
|
+
data_mineral = self.create_halite()
|
|
38
|
+
elif self.mineral == "Fluorite":
|
|
39
|
+
data_mineral = self.create_fluorite()
|
|
40
|
+
elif self.mineral == "Sylvite":
|
|
41
|
+
data_mineral = self.create_sylvite()
|
|
42
|
+
elif self.mineral == "Carnallite":
|
|
43
|
+
data_mineral = self.create_carnallite()
|
|
44
|
+
#
|
|
45
|
+
for key, value in data_mineral.items():
|
|
46
|
+
if key in ["M", "rho", "rho_e", "V", "vP", "vS", "vP/vS", "K", "G", "E", "nu", "GR", "PE", "U",
|
|
47
|
+
"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"]:
|
|
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_halite(self): # NaCl
|
|
66
|
+
# Major elements
|
|
67
|
+
sodium = PeriodicSystem(name="Na").get_data()
|
|
68
|
+
chlorine = PeriodicSystem(name="Cl").get_data()
|
|
69
|
+
majors_name = ["Na", "Cl"]
|
|
70
|
+
majors_data = np.array([["Na", sodium[1], 1, sodium[2]], ["Cl", chlorine[1], 1, chlorine[2]]], dtype=object)
|
|
71
|
+
# Minor elements
|
|
72
|
+
traces_data = []
|
|
73
|
+
if len(self.traces_list) > 0:
|
|
74
|
+
self.impurity = "impure"
|
|
75
|
+
if self.impurity == "random":
|
|
76
|
+
self.traces_list = []
|
|
77
|
+
minors = ["I", "Br", "Fe", "O"]
|
|
78
|
+
n = rd.randint(1, len(minors))
|
|
79
|
+
while len(self.traces_list) < n:
|
|
80
|
+
selection = rd.choice(minors)
|
|
81
|
+
if selection not in self.traces_list and selection not in majors_name:
|
|
82
|
+
self.traces_list.append(selection)
|
|
83
|
+
else:
|
|
84
|
+
continue
|
|
85
|
+
traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
|
|
86
|
+
x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
|
|
87
|
+
for i in range(len(self.traces_list)):
|
|
88
|
+
traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
|
|
89
|
+
if len(traces_data) > 0:
|
|
90
|
+
traces_data = np.array(traces_data, dtype=object)
|
|
91
|
+
traces_data = traces_data[traces_data[:, 1].argsort()]
|
|
92
|
+
#
|
|
93
|
+
data = []
|
|
94
|
+
#
|
|
95
|
+
mineral = "Hl"
|
|
96
|
+
#
|
|
97
|
+
# Molar mass
|
|
98
|
+
molar_mass_pure = sodium[2] + chlorine[2]
|
|
99
|
+
molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
|
|
100
|
+
majors=majors_data).calculate_molar_mass()
|
|
101
|
+
element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
|
|
102
|
+
# Density
|
|
103
|
+
dataV = CrystalPhysics([[5.6404], [], "cubic"])
|
|
104
|
+
V = dataV.calculate_volume()
|
|
105
|
+
dataRho = CrystalPhysics([molar_mass, 4, V])
|
|
106
|
+
rho = dataRho.calculate_bulk_density()
|
|
107
|
+
rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
|
|
108
|
+
# Bulk modulus
|
|
109
|
+
K = 23*10**9
|
|
110
|
+
# Shear modulus
|
|
111
|
+
G = 14.33*10**9
|
|
112
|
+
# Young's modulus
|
|
113
|
+
E = (9*K*G)/(3*K + G)
|
|
114
|
+
# Poisson's ratio
|
|
115
|
+
nu = (3*K - 2*G)/(2*(3*K + G))
|
|
116
|
+
# vP/vS
|
|
117
|
+
vPvS = ((K + 4/3*G)/G)**0.5
|
|
118
|
+
# P-wave velocity
|
|
119
|
+
vP = ((K + 4/3*G)/rho)**0.5
|
|
120
|
+
# S-wave velocity
|
|
121
|
+
vS = (G/rho)**0.5
|
|
122
|
+
# Gamma ray
|
|
123
|
+
gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
|
|
124
|
+
# Photoelectricity
|
|
125
|
+
pe = wg(amounts=amounts, elements=element).calculate_pe()
|
|
126
|
+
U = pe*rho_e*10**(-3)
|
|
127
|
+
# Electrical resistivity
|
|
128
|
+
p = 5*10**8
|
|
129
|
+
#
|
|
130
|
+
if self.dict == False:
|
|
131
|
+
data.append(mineral)
|
|
132
|
+
data.append(round(molar_mass, 3))
|
|
133
|
+
data.append(round(rho, 2))
|
|
134
|
+
data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
|
|
135
|
+
data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
|
|
136
|
+
data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
|
|
137
|
+
data.append(amounts)
|
|
138
|
+
#
|
|
139
|
+
return data
|
|
140
|
+
else:
|
|
141
|
+
#
|
|
142
|
+
results = {}
|
|
143
|
+
results["mineral"] = mineral
|
|
144
|
+
results["M"] = molar_mass
|
|
145
|
+
element_list = np.array(amounts)[:, 0]
|
|
146
|
+
results["chemistry"] = {}
|
|
147
|
+
for index, element in enumerate(element_list, start=0):
|
|
148
|
+
results["chemistry"][element] = amounts[index][2]
|
|
149
|
+
results["rho"] = round(rho, 4)
|
|
150
|
+
results["rho_e"] = round(rho_e, 4)
|
|
151
|
+
results["V"] = round(V, 4)
|
|
152
|
+
results["vP"] = round(vP, 4)
|
|
153
|
+
results["vS"] = round(vS, 4)
|
|
154
|
+
results["vP/vS"] = round(vPvS, 4)
|
|
155
|
+
results["G"] = round(G*10**(-9), 4)
|
|
156
|
+
results["K"] = round(K*10**(-9), 4)
|
|
157
|
+
results["E"] = round(E*10**(-9), 4)
|
|
158
|
+
results["nu"] = round(nu, 4)
|
|
159
|
+
results["GR"] = round(gamma_ray, 4)
|
|
160
|
+
results["PE"] = round(pe, 4)
|
|
161
|
+
results["U"] = round(U, 4)
|
|
162
|
+
if p != None:
|
|
163
|
+
results["p"] = round(p, 4)
|
|
164
|
+
else:
|
|
165
|
+
results["p"] = p
|
|
166
|
+
#
|
|
167
|
+
return results
|
|
168
|
+
#
|
|
169
|
+
def create_sylvite(self): # KCl
|
|
170
|
+
# Major elements
|
|
171
|
+
potassium = PeriodicSystem(name="K").get_data()
|
|
172
|
+
chlorine = PeriodicSystem(name="Cl").get_data()
|
|
173
|
+
majors_name = ["K", "Cl"]
|
|
174
|
+
majors_data = np.array([["K", potassium[1], 1, potassium[2]], ["Cl", chlorine[1], 1, chlorine[2]]], dtype=object)
|
|
175
|
+
# Minor elements
|
|
176
|
+
traces_data = []
|
|
177
|
+
if len(self.traces_list) > 0:
|
|
178
|
+
self.impurity = "impure"
|
|
179
|
+
if self.impurity == "random":
|
|
180
|
+
self.traces_list = []
|
|
181
|
+
minors = ["Br", "C", "O"]
|
|
182
|
+
n = rd.randint(1, len(minors))
|
|
183
|
+
while len(self.traces_list) < n:
|
|
184
|
+
selection = rd.choice(minors)
|
|
185
|
+
if selection not in self.traces_list and selection not in majors_name:
|
|
186
|
+
self.traces_list.append(selection)
|
|
187
|
+
else:
|
|
188
|
+
continue
|
|
189
|
+
traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
|
|
190
|
+
x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
|
|
191
|
+
for i in range(len(self.traces_list)):
|
|
192
|
+
traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
|
|
193
|
+
if len(traces_data) > 0:
|
|
194
|
+
traces_data = np.array(traces_data, dtype=object)
|
|
195
|
+
traces_data = traces_data[traces_data[:, 1].argsort()]
|
|
196
|
+
#
|
|
197
|
+
data = []
|
|
198
|
+
#
|
|
199
|
+
mineral = "Syl"
|
|
200
|
+
#
|
|
201
|
+
# Molar mass
|
|
202
|
+
molar_mass_pure = potassium[2] + chlorine[2]
|
|
203
|
+
molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
|
|
204
|
+
majors=majors_data).calculate_molar_mass()
|
|
205
|
+
element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
|
|
206
|
+
# Density
|
|
207
|
+
dataV = CrystalPhysics([[6.2931], [], "cubic"])
|
|
208
|
+
V = dataV.calculate_volume()
|
|
209
|
+
dataRho = CrystalPhysics([molar_mass, 4, V])
|
|
210
|
+
rho = dataRho.calculate_bulk_density()
|
|
211
|
+
rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
|
|
212
|
+
# Bulk modulus
|
|
213
|
+
K = 16*10**9
|
|
214
|
+
# Shear modulus
|
|
215
|
+
G = 9*10**9
|
|
216
|
+
# Young's modulus
|
|
217
|
+
E = (9*K*G)/(3*K + G)
|
|
218
|
+
# Poisson's ratio
|
|
219
|
+
nu = (3*K - 2*G)/(2*(3*K + G))
|
|
220
|
+
# vP/vS
|
|
221
|
+
vPvS = ((K + 4/3*G)/G)**0.5
|
|
222
|
+
# P-wave velocity
|
|
223
|
+
vP = ((K + 4/3*G)/rho)**0.5
|
|
224
|
+
# S-wave velocity
|
|
225
|
+
vS = (G/rho)**0.5
|
|
226
|
+
# Gamma ray
|
|
227
|
+
gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
|
|
228
|
+
# Photoelectricity
|
|
229
|
+
pe = wg(amounts=amounts, elements=element).calculate_pe()
|
|
230
|
+
U = pe*rho_e*10**(-3)
|
|
231
|
+
# Electrical resistivity
|
|
232
|
+
p = None
|
|
233
|
+
#
|
|
234
|
+
if self.dict == False:
|
|
235
|
+
data.append(mineral)
|
|
236
|
+
data.append(round(molar_mass, 3))
|
|
237
|
+
data.append(round(rho, 2))
|
|
238
|
+
data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
|
|
239
|
+
data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
|
|
240
|
+
data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
|
|
241
|
+
data.append(amounts)
|
|
242
|
+
#
|
|
243
|
+
return data
|
|
244
|
+
else:
|
|
245
|
+
#
|
|
246
|
+
results = {}
|
|
247
|
+
results["mineral"] = mineral
|
|
248
|
+
results["M"] = molar_mass
|
|
249
|
+
element_list = np.array(amounts)[:, 0]
|
|
250
|
+
results["chemistry"] = {}
|
|
251
|
+
for index, element in enumerate(element_list, start=0):
|
|
252
|
+
results["chemistry"][element] = amounts[index][2]
|
|
253
|
+
results["rho"] = round(rho, 4)
|
|
254
|
+
results["rho_e"] = round(rho_e, 4)
|
|
255
|
+
results["V"] = round(V, 4)
|
|
256
|
+
results["vP"] = round(vP, 4)
|
|
257
|
+
results["vS"] = round(vS, 4)
|
|
258
|
+
results["vP/vS"] = round(vPvS, 4)
|
|
259
|
+
results["G"] = round(G*10**(-9), 4)
|
|
260
|
+
results["K"] = round(K*10**(-9), 4)
|
|
261
|
+
results["E"] = round(E*10**(-9), 4)
|
|
262
|
+
results["nu"] = round(nu, 4)
|
|
263
|
+
results["GR"] = round(gamma_ray, 4)
|
|
264
|
+
results["PE"] = round(pe, 4)
|
|
265
|
+
results["U"] = round(U, 4)
|
|
266
|
+
if p != None:
|
|
267
|
+
results["p"] = round(p, 4)
|
|
268
|
+
else:
|
|
269
|
+
results["p"] = p
|
|
270
|
+
#
|
|
271
|
+
return results
|
|
272
|
+
#
|
|
273
|
+
def create_fluorite(self): # CaF2
|
|
274
|
+
# Major elements
|
|
275
|
+
flourine = PeriodicSystem(name="F").get_data()
|
|
276
|
+
calcium = PeriodicSystem(name="Ca").get_data()
|
|
277
|
+
majors_name = ["F", "Ca"]
|
|
278
|
+
majors_data = np.array([["F", flourine[1], 2, flourine[2]], ["Ca", calcium[1], 1, 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 = ["Y", "Ce", "Si", "Al", "Fe", "Mg", "Eu", "Sm", "O", "C", "Cl"]
|
|
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
|
+
data = []
|
|
302
|
+
#
|
|
303
|
+
mineral = "Fl"
|
|
304
|
+
#
|
|
305
|
+
# Molar mass
|
|
306
|
+
molar_mass_pure = calcium[2] + 2*flourine[2]
|
|
307
|
+
molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
|
|
308
|
+
majors=majors_data).calculate_molar_mass()
|
|
309
|
+
element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
|
|
310
|
+
# Density
|
|
311
|
+
dataV = CrystalPhysics([[5.4626], [], "cubic"])
|
|
312
|
+
V = dataV.calculate_volume()
|
|
313
|
+
dataRho = CrystalPhysics([molar_mass, 4, V])
|
|
314
|
+
rho = dataRho.calculate_bulk_density()
|
|
315
|
+
rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
|
|
316
|
+
# Bulk modulus
|
|
317
|
+
K = 77*10**9
|
|
318
|
+
# Shear modulus
|
|
319
|
+
G = 38*10**9
|
|
320
|
+
# Young's modulus
|
|
321
|
+
E = (9*K*G)/(3*K + G)
|
|
322
|
+
# Poisson's ratio
|
|
323
|
+
nu = (3*K - 2*G)/(2*(3*K + G))
|
|
324
|
+
# vP/vS
|
|
325
|
+
vPvS = ((K + 4/3*G)/G)**0.5
|
|
326
|
+
# P-wave velocity
|
|
327
|
+
vP = ((K + 4/3*G)/rho)**0.5
|
|
328
|
+
# S-wave velocity
|
|
329
|
+
vS = (G/rho)**0.5
|
|
330
|
+
# Gamma ray
|
|
331
|
+
gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
|
|
332
|
+
# Photoelectricity
|
|
333
|
+
pe = wg(amounts=amounts, elements=element).calculate_pe()
|
|
334
|
+
U = pe*rho_e*10**(-3)
|
|
335
|
+
# Electrical resistivity
|
|
336
|
+
p = None
|
|
337
|
+
#
|
|
338
|
+
if self.dict == False:
|
|
339
|
+
data.append(mineral)
|
|
340
|
+
data.append(round(molar_mass, 3))
|
|
341
|
+
data.append(round(rho, 2))
|
|
342
|
+
data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
|
|
343
|
+
data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
|
|
344
|
+
data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
|
|
345
|
+
data.append(amounts)
|
|
346
|
+
#
|
|
347
|
+
return data
|
|
348
|
+
else:
|
|
349
|
+
#
|
|
350
|
+
results = {}
|
|
351
|
+
results["mineral"] = mineral
|
|
352
|
+
results["M"] = molar_mass
|
|
353
|
+
element_list = np.array(amounts)[:, 0]
|
|
354
|
+
results["chemistry"] = {}
|
|
355
|
+
for index, element in enumerate(element_list, start=0):
|
|
356
|
+
results["chemistry"][element] = amounts[index][2]
|
|
357
|
+
results["rho"] = round(rho, 4)
|
|
358
|
+
results["rho_e"] = round(rho_e, 4)
|
|
359
|
+
results["V"] = round(V, 4)
|
|
360
|
+
results["vP"] = round(vP, 4)
|
|
361
|
+
results["vS"] = round(vS, 4)
|
|
362
|
+
results["vP/vS"] = round(vPvS, 4)
|
|
363
|
+
results["G"] = round(G*10**(-9), 4)
|
|
364
|
+
results["K"] = round(K*10**(-9), 4)
|
|
365
|
+
results["E"] = round(E*10**(-9), 4)
|
|
366
|
+
results["nu"] = round(nu, 4)
|
|
367
|
+
results["GR"] = round(gamma_ray, 4)
|
|
368
|
+
results["PE"] = round(pe, 4)
|
|
369
|
+
results["U"] = round(U, 4)
|
|
370
|
+
if p != None:
|
|
371
|
+
results["p"] = round(p, 4)
|
|
372
|
+
else:
|
|
373
|
+
results["p"] = p
|
|
374
|
+
#
|
|
375
|
+
return results
|
|
376
|
+
#
|
|
377
|
+
def create_carnallite(self): # K Mg Cl3 * 6(H2O)
|
|
378
|
+
# Major elements
|
|
379
|
+
hydrogen = PeriodicSystem(name="H").get_data()
|
|
380
|
+
oxygen = PeriodicSystem(name="O").get_data()
|
|
381
|
+
magnesium = PeriodicSystem(name="Mg").get_data()
|
|
382
|
+
chlorine = PeriodicSystem(name="Cl").get_data()
|
|
383
|
+
potassium = PeriodicSystem(name="K").get_data()
|
|
384
|
+
majors_name = ["H", "O", "Mg", "Cl", "K"]
|
|
385
|
+
majors_data = np.array(
|
|
386
|
+
[["H", hydrogen[1], 12, hydrogen[2]], ["O", oxygen[1], 6, oxygen[2]],
|
|
387
|
+
["Mg", magnesium[1], 1, magnesium[2]], ["Cl", chlorine[1], 3, chlorine[2]],
|
|
388
|
+
["K", potassium[1], 1, potassium[2]]], dtype=object)
|
|
389
|
+
# Minor elements
|
|
390
|
+
traces_data = []
|
|
391
|
+
if len(self.traces_list) > 0:
|
|
392
|
+
self.impurity = "impure"
|
|
393
|
+
if self.impurity == "random":
|
|
394
|
+
self.traces_list = []
|
|
395
|
+
minors = ["Br" ,"Rb", "Cs", "Tl", "Fe"]
|
|
396
|
+
n = rd.randint(1, len(minors))
|
|
397
|
+
while len(self.traces_list) < n:
|
|
398
|
+
selection = rd.choice(minors)
|
|
399
|
+
if selection not in self.traces_list and selection not in majors_name:
|
|
400
|
+
self.traces_list.append(selection)
|
|
401
|
+
else:
|
|
402
|
+
continue
|
|
403
|
+
traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
|
|
404
|
+
x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
|
|
405
|
+
for i in range(len(self.traces_list)):
|
|
406
|
+
traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
|
|
407
|
+
if len(traces_data) > 0:
|
|
408
|
+
traces_data = np.array(traces_data, dtype=object)
|
|
409
|
+
traces_data = traces_data[traces_data[:, 1].argsort()]
|
|
410
|
+
#
|
|
411
|
+
data = []
|
|
412
|
+
#
|
|
413
|
+
mineral = "Car"
|
|
414
|
+
#
|
|
415
|
+
# Molar mass
|
|
416
|
+
molar_mass_pure = potassium[2] + magnesium[2] + 3*chlorine[2] + 6*(2*hydrogen[2] + oxygen[2])
|
|
417
|
+
molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
|
|
418
|
+
majors=majors_data).calculate_molar_mass()
|
|
419
|
+
element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
|
|
420
|
+
# Density
|
|
421
|
+
dataV = CrystalPhysics([[9.56, 16.05, 22.56], [], "orthorhombic"])
|
|
422
|
+
V = dataV.calculate_volume()
|
|
423
|
+
dataRho = CrystalPhysics([molar_mass, 12, V])
|
|
424
|
+
rho = dataRho.calculate_bulk_density()
|
|
425
|
+
rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
|
|
426
|
+
# Bulk modulus
|
|
427
|
+
K = 31*10**9 # estimated
|
|
428
|
+
# Shear modulus
|
|
429
|
+
G = 16*10**9 # estimated
|
|
430
|
+
# Young's modulus
|
|
431
|
+
E = (9*K*G)/(3*K + G)
|
|
432
|
+
# Poisson's ratio
|
|
433
|
+
nu = (3*K - 2*G)/(2*(3*K + G))
|
|
434
|
+
# vP/vS
|
|
435
|
+
vPvS = ((K + 4/3*G)/G)**0.5
|
|
436
|
+
# P-wave velocity
|
|
437
|
+
vP = ((K + 4/3*G)/rho)**0.5
|
|
438
|
+
# S-wave velocity
|
|
439
|
+
vS = (G/rho)**0.5
|
|
440
|
+
# Gamma ray
|
|
441
|
+
gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
|
|
442
|
+
# Photoelectricity
|
|
443
|
+
pe = wg(amounts=amounts, elements=element).calculate_pe()
|
|
444
|
+
U = pe*rho_e*10**(-3)
|
|
445
|
+
# Electrical resistivity
|
|
446
|
+
p = None
|
|
447
|
+
#
|
|
448
|
+
if self.dict == False:
|
|
449
|
+
data.append(mineral)
|
|
450
|
+
data.append(round(molar_mass, 3))
|
|
451
|
+
data.append(round(rho, 2))
|
|
452
|
+
data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
|
|
453
|
+
data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
|
|
454
|
+
data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
|
|
455
|
+
data.append(amounts)
|
|
456
|
+
#
|
|
457
|
+
return data
|
|
458
|
+
else:
|
|
459
|
+
#
|
|
460
|
+
results = {}
|
|
461
|
+
results["mineral"] = mineral
|
|
462
|
+
results["M"] = molar_mass
|
|
463
|
+
element_list = np.array(amounts)[:, 0]
|
|
464
|
+
results["chemistry"] = {}
|
|
465
|
+
for index, element in enumerate(element_list, start=0):
|
|
466
|
+
results["chemistry"][element] = amounts[index][2]
|
|
467
|
+
results["rho"] = round(rho, 4)
|
|
468
|
+
results["rho_e"] = round(rho_e, 4)
|
|
469
|
+
results["V"] = round(V, 4)
|
|
470
|
+
results["vP"] = round(vP, 4)
|
|
471
|
+
results["vS"] = round(vS, 4)
|
|
472
|
+
results["vP/vS"] = round(vPvS, 4)
|
|
473
|
+
results["G"] = round(G*10**(-9), 4)
|
|
474
|
+
results["K"] = round(K*10**(-9), 4)
|
|
475
|
+
results["E"] = round(E*10**(-9), 4)
|
|
476
|
+
results["nu"] = round(nu, 4)
|
|
477
|
+
results["GR"] = round(gamma_ray, 4)
|
|
478
|
+
results["PE"] = round(pe, 4)
|
|
479
|
+
results["U"] = round(U, 4)
|
|
480
|
+
if p != None:
|
|
481
|
+
results["p"] = round(p, 4)
|
|
482
|
+
else:
|
|
483
|
+
results["p"] = p
|
|
484
|
+
#
|
|
485
|
+
return results
|