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
|
@@ -0,0 +1,530 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
# -*-coding: utf-8 -*-
|
|
3
|
+
|
|
4
|
+
# -----------------------------------------------
|
|
5
|
+
|
|
6
|
+
# Name: organics.py
|
|
7
|
+
# Author: Maximilian A. Beeskow
|
|
8
|
+
# Version: 1.0
|
|
9
|
+
# Date: 21.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 Organics:
|
|
24
|
+
""" Class that generates geophysical and geochemical data of halogene minerals"""
|
|
25
|
+
#
|
|
26
|
+
def __init__(self, traces_list=[], impurity="pure", data_type=False, mineral=None):
|
|
27
|
+
self.traces_list = traces_list
|
|
28
|
+
self.impurity = impurity
|
|
29
|
+
self.data_type = data_type
|
|
30
|
+
self.mineral = mineral
|
|
31
|
+
#
|
|
32
|
+
def get_data(self, number=1):
|
|
33
|
+
if self.mineral == "Organic Matter":
|
|
34
|
+
if number > 1:
|
|
35
|
+
data = [self.create_organic_matter() for n in range(number)]
|
|
36
|
+
else:
|
|
37
|
+
data = self.create_organic_matter()
|
|
38
|
+
else:
|
|
39
|
+
data = "Nothing found!"
|
|
40
|
+
#
|
|
41
|
+
return data
|
|
42
|
+
#
|
|
43
|
+
def generate_dataset(self, number):
|
|
44
|
+
dataset = {}
|
|
45
|
+
#
|
|
46
|
+
for index in range(number):
|
|
47
|
+
if self.mineral == "Organic Matter":
|
|
48
|
+
data_mineral = self.create_organic_matter()
|
|
49
|
+
elif self.mineral == "Lignin":
|
|
50
|
+
data_mineral = self.create_lignin()
|
|
51
|
+
elif self.mineral == "Lipid":
|
|
52
|
+
data_mineral = self.create_lipid()
|
|
53
|
+
elif self.mineral == "Carbohydrate":
|
|
54
|
+
data_mineral = self.create_carbohydrates()
|
|
55
|
+
#
|
|
56
|
+
for key, value in data_mineral.items():
|
|
57
|
+
if key in ["M", "rho", "rho_e", "V", "vP", "vS", "vP/vS", "K", "G", "E", "nu", "GR", "PE", "U",
|
|
58
|
+
"p"]:
|
|
59
|
+
if key not in dataset:
|
|
60
|
+
dataset[key] = [value]
|
|
61
|
+
else:
|
|
62
|
+
dataset[key].append(value)
|
|
63
|
+
elif key in ["mineral", "state", "trace elements"] and key not in dataset:
|
|
64
|
+
dataset[key] = value
|
|
65
|
+
elif key in ["chemistry"]:
|
|
66
|
+
if key not in dataset:
|
|
67
|
+
dataset[key] = {}
|
|
68
|
+
for key_2, value_2 in value.items():
|
|
69
|
+
dataset[key][key_2] = [value_2]
|
|
70
|
+
else:
|
|
71
|
+
for key_2, value_2 in value.items():
|
|
72
|
+
dataset[key][key_2].append(value_2)
|
|
73
|
+
#
|
|
74
|
+
return dataset
|
|
75
|
+
|
|
76
|
+
# if self.mineral == "Organic Matter":
|
|
77
|
+
# dataset = [self.create_organics_matter() for n in range(number)]
|
|
78
|
+
#
|
|
79
|
+
# return dataset
|
|
80
|
+
#
|
|
81
|
+
def create_organic_matter(self):
|
|
82
|
+
# Major elements
|
|
83
|
+
carbohydrates = Organics(data_type=True).create_carbohydrates()
|
|
84
|
+
lignin = Organics(data_type=True).create_lignin()
|
|
85
|
+
lipid = Organics(data_type=True).create_lipid()
|
|
86
|
+
hydrogen = PeriodicSystem(name="H").get_data()
|
|
87
|
+
carbon = PeriodicSystem(name="C").get_data()
|
|
88
|
+
nitrogen = PeriodicSystem(name="N").get_data()
|
|
89
|
+
oxygen = PeriodicSystem(name="O").get_data()
|
|
90
|
+
sulfur = PeriodicSystem(name="S").get_data()
|
|
91
|
+
majors_name = ["H", "C", "N", "O", "S"]
|
|
92
|
+
# Minor elements
|
|
93
|
+
traces_data = []
|
|
94
|
+
if len(self.traces_list) > 0:
|
|
95
|
+
self.impurity = "impure"
|
|
96
|
+
if self.impurity == "pure":
|
|
97
|
+
var_state = "variable"
|
|
98
|
+
else:
|
|
99
|
+
var_state = "variable"
|
|
100
|
+
if self.impurity == "random":
|
|
101
|
+
self.traces_list = []
|
|
102
|
+
minors = [None]
|
|
103
|
+
n = rd.randint(1, len(minors))
|
|
104
|
+
while len(self.traces_list) < n:
|
|
105
|
+
selection = rd.choice(minors)
|
|
106
|
+
if selection not in self.traces_list and selection not in majors_name:
|
|
107
|
+
self.traces_list.append(selection)
|
|
108
|
+
else:
|
|
109
|
+
continue
|
|
110
|
+
traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
|
|
111
|
+
x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
|
|
112
|
+
for i in range(len(self.traces_list)):
|
|
113
|
+
traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
|
|
114
|
+
if len(traces_data) > 0:
|
|
115
|
+
traces_data = np.array(traces_data, dtype=object)
|
|
116
|
+
traces_data = traces_data[traces_data[:, 1].argsort()]
|
|
117
|
+
#
|
|
118
|
+
data = []
|
|
119
|
+
#
|
|
120
|
+
mineral = "Org"
|
|
121
|
+
#
|
|
122
|
+
# Molar mass
|
|
123
|
+
condition = False
|
|
124
|
+
while condition == False:
|
|
125
|
+
w_ch = round(rd.uniform(0.4, 0.6), 4)
|
|
126
|
+
w_lg = round(rd.uniform(0.2, float(1-w_ch)), 4)
|
|
127
|
+
w_lp = round(1 - w_ch - w_lg, 4)
|
|
128
|
+
if w_ch+w_lg+w_lp == 1.0:
|
|
129
|
+
condition = True
|
|
130
|
+
#
|
|
131
|
+
majors_data = np.array([["H", hydrogen[1], w_ch*carbohydrates["chemistry"]["H"] + w_lg*lignin["chemistry"]["H"] + w_lp*lipid["chemistry"]["H"], hydrogen[2]],
|
|
132
|
+
["C", carbon[1], w_ch*carbohydrates["chemistry"]["C"] + w_lg*lignin["chemistry"]["C"] + w_lp*lipid["chemistry"]["C"], carbon[2]],
|
|
133
|
+
["N", nitrogen[1], w_lg*lignin["chemistry"]["N"], nitrogen[2]],
|
|
134
|
+
["O", oxygen[1], w_ch*carbohydrates["chemistry"]["O"] + w_lg*lignin["chemistry"]["O"] + w_lp*lipid["chemistry"]["O"], oxygen[2]],
|
|
135
|
+
["S", sulfur[1], w_lg*lignin["chemistry"]["S"], sulfur[2]]], dtype=object)
|
|
136
|
+
#
|
|
137
|
+
molar_mass_pure = w_ch*carbohydrates["M"] + w_lg*lignin["M"] + w_lp*lipid["M"]
|
|
138
|
+
molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
|
|
139
|
+
majors=majors_data).calculate_molar_mass()
|
|
140
|
+
amounts2 = []
|
|
141
|
+
w_H = round((w_ch*carbohydrates["chemistry"]["H"] + w_lg*lignin["chemistry"]["H"] + w_lp*lipid["chemistry"]["H"])*hydrogen[2]/molar_mass_pure, 4)
|
|
142
|
+
w_C = round((w_ch*carbohydrates["chemistry"]["C"] + w_lg*lignin["chemistry"]["C"] + w_lp*lipid["chemistry"]["C"])*carbon[2]/molar_mass_pure, 4)
|
|
143
|
+
w_N = round((w_lg*lignin["chemistry"]["N"])*nitrogen[2]/molar_mass_pure, 4)
|
|
144
|
+
w_S = round((w_lg*lignin["chemistry"]["S"])*sulfur[2]/molar_mass_pure, 4)
|
|
145
|
+
w_O = round(1 - w_H - w_C - w_N - w_S, 4)
|
|
146
|
+
data_H = ["H", 1, w_H]
|
|
147
|
+
data_C = ["C", 6, w_C]
|
|
148
|
+
data_N = ["N", 7, w_N]
|
|
149
|
+
data_O = ["O", 8, w_O]
|
|
150
|
+
data_S = ["S", 16, w_S]
|
|
151
|
+
amounts2.extend([data_H, data_C, data_N, data_O, data_S])
|
|
152
|
+
amounts = amounts2
|
|
153
|
+
|
|
154
|
+
element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
|
|
155
|
+
# Density
|
|
156
|
+
rho = w_ch*carbohydrates["rho"] + w_lg*lignin["rho"] + w_lp*lipid["rho"]
|
|
157
|
+
V_m = molar_mass/rho
|
|
158
|
+
rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
|
|
159
|
+
# Bulk modulus
|
|
160
|
+
K = w_ch*carbohydrates["K"] + w_lg*lignin["K"] + w_lp*lipid["K"]*10**9
|
|
161
|
+
# Shear modulus
|
|
162
|
+
G = w_ch*carbohydrates["G"] + w_lg*lignin["G"] + w_lp*lipid["G"]*10**9
|
|
163
|
+
# Young's modulus
|
|
164
|
+
E = (9*K*G)/(3*K + G)
|
|
165
|
+
# Poisson's ratio
|
|
166
|
+
nu = (3*K - 2*G)/(2*(3*K + G))
|
|
167
|
+
# vP/vS
|
|
168
|
+
vPvS = ((K + 4/3*G)/G)**0.5
|
|
169
|
+
# P-wave velocity
|
|
170
|
+
vP = ((K + 4/3*G)/rho)**0.5
|
|
171
|
+
# S-wave velocity
|
|
172
|
+
vS = (G/rho)**0.5
|
|
173
|
+
# Gamma ray
|
|
174
|
+
gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
|
|
175
|
+
# Photoelectricity
|
|
176
|
+
pe = wg(amounts=amounts, elements=element).calculate_pe()
|
|
177
|
+
U = pe*rho_e*10**(-3)
|
|
178
|
+
# Electrical resistivity
|
|
179
|
+
p = None
|
|
180
|
+
#
|
|
181
|
+
if self.data_type == False:
|
|
182
|
+
data.append(mineral)
|
|
183
|
+
data.append(round(molar_mass, 3))
|
|
184
|
+
data.append(round(rho, 2))
|
|
185
|
+
data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
|
|
186
|
+
data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
|
|
187
|
+
data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
|
|
188
|
+
data.append(amounts)
|
|
189
|
+
#
|
|
190
|
+
return data
|
|
191
|
+
else:
|
|
192
|
+
#
|
|
193
|
+
results = {}
|
|
194
|
+
results["mineral"] = mineral
|
|
195
|
+
results["M"] = round(molar_mass, 3)
|
|
196
|
+
results["state"] = var_state
|
|
197
|
+
element_list = np.array(amounts)[:, 0]
|
|
198
|
+
results["chemistry"] = {}
|
|
199
|
+
for index, element in enumerate(element_list, start=0):
|
|
200
|
+
results["chemistry"][element] = amounts[index][2]
|
|
201
|
+
results["rho"] = round(rho, 4)
|
|
202
|
+
results["rho_e"] = round(rho_e, 4)
|
|
203
|
+
results["V"] = round(V_m, 4)
|
|
204
|
+
results["vP"] = round(vP, 4)
|
|
205
|
+
results["vS"] = round(vS, 4)
|
|
206
|
+
results["vP/vS"] = round(vPvS, 4)
|
|
207
|
+
results["G"] = round(G*10**(-9), 4)
|
|
208
|
+
results["K"] = round(K*10**(-9), 4)
|
|
209
|
+
results["E"] = round(E*10**(-9), 4)
|
|
210
|
+
results["nu"] = round(nu, 4)
|
|
211
|
+
results["GR"] = round(gamma_ray, 4)
|
|
212
|
+
results["PE"] = round(pe, 4)
|
|
213
|
+
results["U"] = round(U, 4)
|
|
214
|
+
if p != None:
|
|
215
|
+
results["p"] = round(p, 4)
|
|
216
|
+
else:
|
|
217
|
+
results["p"] = p
|
|
218
|
+
#
|
|
219
|
+
return results
|
|
220
|
+
#
|
|
221
|
+
def create_carbohydrates(self):
|
|
222
|
+
# Major elements
|
|
223
|
+
hydrogen = PeriodicSystem(name="H").get_data()
|
|
224
|
+
carbon = PeriodicSystem(name="C").get_data()
|
|
225
|
+
oxygen = PeriodicSystem(name="O").get_data()
|
|
226
|
+
majors_name = ["H", "C", "O"]
|
|
227
|
+
# Minor elements
|
|
228
|
+
traces_data = []
|
|
229
|
+
if len(self.traces_list) > 0:
|
|
230
|
+
self.impurity = "impure"
|
|
231
|
+
if self.impurity == "random":
|
|
232
|
+
self.traces_list = []
|
|
233
|
+
minors = [None]
|
|
234
|
+
n = rd.randint(1, len(minors))
|
|
235
|
+
while len(self.traces_list) < n:
|
|
236
|
+
selection = rd.choice(minors)
|
|
237
|
+
if selection not in self.traces_list and selection not in majors_name:
|
|
238
|
+
self.traces_list.append(selection)
|
|
239
|
+
else:
|
|
240
|
+
continue
|
|
241
|
+
traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
|
|
242
|
+
x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
|
|
243
|
+
for i in range(len(self.traces_list)):
|
|
244
|
+
traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
|
|
245
|
+
if len(traces_data) > 0:
|
|
246
|
+
traces_data = np.array(traces_data, dtype=object)
|
|
247
|
+
traces_data = traces_data[traces_data[:, 1].argsort()]
|
|
248
|
+
#
|
|
249
|
+
mineral = "carbohydrates"
|
|
250
|
+
#
|
|
251
|
+
# Molar mass
|
|
252
|
+
molar_mass_pure = 0.06*hydrogen[2] + 0.44*carbon[2] + 0.50*oxygen[2]
|
|
253
|
+
#
|
|
254
|
+
majors_data = np.array([["H", hydrogen[1], 0.06, hydrogen[2]], ["C", carbon[1], 0.44, carbon[2]],
|
|
255
|
+
["O", oxygen[1], 0.50, oxygen[2]]], dtype=object)
|
|
256
|
+
#
|
|
257
|
+
molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
|
|
258
|
+
majors=majors_data).calculate_molar_mass()
|
|
259
|
+
element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
|
|
260
|
+
# Density
|
|
261
|
+
rho = 1586
|
|
262
|
+
rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
|
|
263
|
+
# Bulk modulus
|
|
264
|
+
K = 10*10**9
|
|
265
|
+
# Shear modulus
|
|
266
|
+
G = 5*10**9
|
|
267
|
+
# Young's modulus
|
|
268
|
+
E = (9*K*G)/(3*K + G)
|
|
269
|
+
# Poisson's ratio
|
|
270
|
+
nu = (3*K - 2*G)/(2*(3*K + G))
|
|
271
|
+
# vP/vS
|
|
272
|
+
vPvS = ((K + 4/3*G)/G)**0.5
|
|
273
|
+
# P-wave velocity
|
|
274
|
+
vP = ((K + 4/3*G)/rho)**0.5
|
|
275
|
+
# S-wave velocity
|
|
276
|
+
vS = (G/rho)**0.5
|
|
277
|
+
# Gamma ray
|
|
278
|
+
gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
|
|
279
|
+
# Photoelectricity
|
|
280
|
+
pe = wg(amounts=amounts, elements=element).calculate_pe()
|
|
281
|
+
U = pe*rho_e*10**(-3)
|
|
282
|
+
# Electrical resistivity
|
|
283
|
+
p = None
|
|
284
|
+
#
|
|
285
|
+
if self.data_type == False:
|
|
286
|
+
data = []
|
|
287
|
+
data.append(mineral)
|
|
288
|
+
data.append(round(molar_mass, 3))
|
|
289
|
+
data.append(round(rho, 2))
|
|
290
|
+
data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
|
|
291
|
+
data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
|
|
292
|
+
data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
|
|
293
|
+
data.append(amounts)
|
|
294
|
+
#
|
|
295
|
+
return data
|
|
296
|
+
else:
|
|
297
|
+
#
|
|
298
|
+
results = {}
|
|
299
|
+
results["mineral"] = mineral
|
|
300
|
+
results["M"] = molar_mass
|
|
301
|
+
element_list = np.array(amounts)[:, 0]
|
|
302
|
+
results["chemistry"] = {}
|
|
303
|
+
for index, element in enumerate(element_list, start=0):
|
|
304
|
+
results["chemistry"][element] = amounts[index][2]
|
|
305
|
+
results["rho"] = round(rho, 4)
|
|
306
|
+
results["rho_e"] = round(rho_e, 4)
|
|
307
|
+
results["vP"] = round(vP, 4)
|
|
308
|
+
results["vS"] = round(vS, 4)
|
|
309
|
+
results["vP/vS"] = round(vPvS, 4)
|
|
310
|
+
results["G"] = round(G*10**(-9), 4)
|
|
311
|
+
results["K"] = round(K*10**(-9), 4)
|
|
312
|
+
results["E"] = round(E*10**(-9), 4)
|
|
313
|
+
results["nu"] = round(nu, 4)
|
|
314
|
+
results["GR"] = round(gamma_ray, 4)
|
|
315
|
+
results["PE"] = round(pe, 4)
|
|
316
|
+
results["U"] = round(U, 4)
|
|
317
|
+
if p != None:
|
|
318
|
+
results["p"] = round(p, 4)
|
|
319
|
+
else:
|
|
320
|
+
results["p"] = p
|
|
321
|
+
#
|
|
322
|
+
return results
|
|
323
|
+
#
|
|
324
|
+
def create_lignin(self):
|
|
325
|
+
# Major elements
|
|
326
|
+
hydrogen = PeriodicSystem(name="H").get_data()
|
|
327
|
+
carbon = PeriodicSystem(name="C").get_data()
|
|
328
|
+
nitrogen = PeriodicSystem(name="N").get_data()
|
|
329
|
+
oxygen = PeriodicSystem(name="O").get_data()
|
|
330
|
+
sulfur = PeriodicSystem(name="S").get_data()
|
|
331
|
+
majors_name = ["H", "C", "N", "O", "S"]
|
|
332
|
+
# Minor elements
|
|
333
|
+
traces_data = []
|
|
334
|
+
if len(self.traces_list) > 0:
|
|
335
|
+
self.impurity = "impure"
|
|
336
|
+
if self.impurity == "random":
|
|
337
|
+
self.traces_list = []
|
|
338
|
+
minors = [None]
|
|
339
|
+
n = rd.randint(1, len(minors))
|
|
340
|
+
while len(self.traces_list) < n:
|
|
341
|
+
selection = rd.choice(minors)
|
|
342
|
+
if selection not in self.traces_list and selection not in majors_name:
|
|
343
|
+
self.traces_list.append(selection)
|
|
344
|
+
else:
|
|
345
|
+
continue
|
|
346
|
+
traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
|
|
347
|
+
x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
|
|
348
|
+
for i in range(len(self.traces_list)):
|
|
349
|
+
traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
|
|
350
|
+
if len(traces_data) > 0:
|
|
351
|
+
traces_data = np.array(traces_data, dtype=object)
|
|
352
|
+
traces_data = traces_data[traces_data[:, 1].argsort()]
|
|
353
|
+
#
|
|
354
|
+
mineral = "lignin"
|
|
355
|
+
#
|
|
356
|
+
# Molar mass
|
|
357
|
+
molar_mass_pure = 0.06*hydrogen[2] + 0.626*carbon[2] + 0.003*nitrogen[2] + 0.31*oxygen[2] + 0.001*sulfur[2]
|
|
358
|
+
#
|
|
359
|
+
majors_data = np.array([["H", hydrogen[1], 0.06, hydrogen[2]], ["C", carbon[1], 0.626, carbon[2]],
|
|
360
|
+
["N", nitrogen[1], 0.003, nitrogen[2]], ["O", oxygen[1], 0.31, oxygen[2]],
|
|
361
|
+
["S", sulfur[1], 0.001, sulfur[2]]], dtype=object)
|
|
362
|
+
#
|
|
363
|
+
molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
|
|
364
|
+
majors=majors_data).calculate_molar_mass()
|
|
365
|
+
element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
|
|
366
|
+
# Density
|
|
367
|
+
rho = 680
|
|
368
|
+
rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
|
|
369
|
+
# Bulk modulus
|
|
370
|
+
K = 4*10**9
|
|
371
|
+
# Shear modulus
|
|
372
|
+
G = 2*10**9
|
|
373
|
+
# Young's modulus
|
|
374
|
+
E = (9*K*G)/(3*K + G)
|
|
375
|
+
# Poisson's ratio
|
|
376
|
+
nu = (3*K - 2*G)/(2*(3*K + G))
|
|
377
|
+
# vP/vS
|
|
378
|
+
vPvS = ((K + 4/3*G)/G)**0.5
|
|
379
|
+
# P-wave velocity
|
|
380
|
+
vP = ((K + 4/3*G)/rho)**0.5
|
|
381
|
+
# S-wave velocity
|
|
382
|
+
vS = (G/rho)**0.5
|
|
383
|
+
# Gamma ray
|
|
384
|
+
gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
|
|
385
|
+
# Photoelectricity
|
|
386
|
+
pe = wg(amounts=amounts, elements=element).calculate_pe()
|
|
387
|
+
U = pe*rho_e*10**(-3)
|
|
388
|
+
# Electrical resistivity
|
|
389
|
+
p = None
|
|
390
|
+
#
|
|
391
|
+
if self.data_type == False:
|
|
392
|
+
data = []
|
|
393
|
+
data.append(mineral)
|
|
394
|
+
data.append(round(molar_mass, 3))
|
|
395
|
+
data.append(round(rho, 2))
|
|
396
|
+
data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
|
|
397
|
+
data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
|
|
398
|
+
data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
|
|
399
|
+
data.append(amounts)
|
|
400
|
+
#
|
|
401
|
+
return data
|
|
402
|
+
else:
|
|
403
|
+
#
|
|
404
|
+
results = {}
|
|
405
|
+
results["mineral"] = mineral
|
|
406
|
+
results["M"] = molar_mass
|
|
407
|
+
element_list = np.array(amounts)[:, 0]
|
|
408
|
+
results["chemistry"] = {}
|
|
409
|
+
for index, element in enumerate(element_list, start=0):
|
|
410
|
+
results["chemistry"][element] = amounts[index][2]
|
|
411
|
+
results["rho"] = round(rho, 4)
|
|
412
|
+
results["rho_e"] = round(rho_e, 4)
|
|
413
|
+
results["vP"] = round(vP, 4)
|
|
414
|
+
results["vS"] = round(vS, 4)
|
|
415
|
+
results["vP/vS"] = round(vPvS, 4)
|
|
416
|
+
results["G"] = round(G*10**(-9), 4)
|
|
417
|
+
results["K"] = round(K*10**(-9), 4)
|
|
418
|
+
results["E"] = round(E*10**(-9), 4)
|
|
419
|
+
results["nu"] = round(nu, 4)
|
|
420
|
+
results["GR"] = round(gamma_ray, 4)
|
|
421
|
+
results["PE"] = round(pe, 4)
|
|
422
|
+
results["U"] = round(U, 4)
|
|
423
|
+
if p != None:
|
|
424
|
+
results["p"] = round(p, 4)
|
|
425
|
+
else:
|
|
426
|
+
results["p"] = p
|
|
427
|
+
#
|
|
428
|
+
return results
|
|
429
|
+
#
|
|
430
|
+
def create_lipid(self):
|
|
431
|
+
# Major elements
|
|
432
|
+
hydrogen = PeriodicSystem(name="H").get_data()
|
|
433
|
+
carbon = PeriodicSystem(name="C").get_data()
|
|
434
|
+
oxygen = PeriodicSystem(name="O").get_data()
|
|
435
|
+
majors_name = ["H", "C", "O"]
|
|
436
|
+
# Minor elements
|
|
437
|
+
traces_data = []
|
|
438
|
+
if len(self.traces_list) > 0:
|
|
439
|
+
self.impurity = "impure"
|
|
440
|
+
if self.impurity == "random":
|
|
441
|
+
self.traces_list = []
|
|
442
|
+
minors = [None]
|
|
443
|
+
n = rd.randint(1, len(minors))
|
|
444
|
+
while len(self.traces_list) < n:
|
|
445
|
+
selection = rd.choice(minors)
|
|
446
|
+
if selection not in self.traces_list and selection not in majors_name:
|
|
447
|
+
self.traces_list.append(selection)
|
|
448
|
+
else:
|
|
449
|
+
continue
|
|
450
|
+
traces = [PeriodicSystem(name=i).get_data() for i in self.traces_list]
|
|
451
|
+
x_traces = [round(rd.uniform(0., 0.001), 6) for i in range(len(self.traces_list))]
|
|
452
|
+
for i in range(len(self.traces_list)):
|
|
453
|
+
traces_data.append([str(self.traces_list[i]), int(traces[i][1]), float(x_traces[i])])
|
|
454
|
+
if len(traces_data) > 0:
|
|
455
|
+
traces_data = np.array(traces_data, dtype=object)
|
|
456
|
+
traces_data = traces_data[traces_data[:, 1].argsort()]
|
|
457
|
+
#
|
|
458
|
+
mineral = "lipid"
|
|
459
|
+
#
|
|
460
|
+
# Molar mass
|
|
461
|
+
molar_mass_pure = 0.10*hydrogen[2] + 0.80*carbon[2] + 0.10*oxygen[2]
|
|
462
|
+
#
|
|
463
|
+
majors_data = np.array([["H", hydrogen[1], 0.10, hydrogen[2]], ["C", carbon[1], 0.80, carbon[2]], ["O", oxygen[1], 0.10, oxygen[2]]], dtype=object)
|
|
464
|
+
#
|
|
465
|
+
molar_mass, amounts = MineralChemistry(w_traces=traces_data, molar_mass_pure=molar_mass_pure,
|
|
466
|
+
majors=majors_data).calculate_molar_mass()
|
|
467
|
+
element = [PeriodicSystem(name=amounts[i][0]).get_data() for i in range(len(amounts))]
|
|
468
|
+
# Density
|
|
469
|
+
rho = 850
|
|
470
|
+
rho_e = wg(amounts=amounts, elements=element, rho_b=rho).calculate_electron_density()
|
|
471
|
+
# Bulk modulus
|
|
472
|
+
K = 4*10**9
|
|
473
|
+
# Shear modulus
|
|
474
|
+
G = 2*10**9
|
|
475
|
+
# Young's modulus
|
|
476
|
+
E = (9*K*G)/(3*K + G)
|
|
477
|
+
# Poisson's ratio
|
|
478
|
+
nu = (3*K - 2*G)/(2*(3*K + G))
|
|
479
|
+
# vP/vS
|
|
480
|
+
vPvS = ((K + 4/3*G)/G)**0.5
|
|
481
|
+
# P-wave velocity
|
|
482
|
+
vP = ((K + 4/3*G)/rho)**0.5
|
|
483
|
+
# S-wave velocity
|
|
484
|
+
vS = (G/rho)**0.5
|
|
485
|
+
# Gamma ray
|
|
486
|
+
gamma_ray = wg(amounts=amounts, elements=element).calculate_gr()
|
|
487
|
+
# Photoelectricity
|
|
488
|
+
pe = wg(amounts=amounts, elements=element).calculate_pe()
|
|
489
|
+
U = pe*rho_e*10**(-3)
|
|
490
|
+
# Electrical resistivity
|
|
491
|
+
p = None
|
|
492
|
+
#
|
|
493
|
+
if self.data_type == False:
|
|
494
|
+
data = []
|
|
495
|
+
data.append(mineral)
|
|
496
|
+
data.append(round(molar_mass, 3))
|
|
497
|
+
data.append(round(rho, 2))
|
|
498
|
+
data.append([round(K*10**(-9), 2), round(G*10**(-9), 2), round(E*10**(-9), 2), round(nu, 4)])
|
|
499
|
+
data.append([round(vP, 2), round(vS, 2), round(vPvS, 2)])
|
|
500
|
+
data.append([round(gamma_ray, 2), round(pe, 2), round(U, 2), p])
|
|
501
|
+
data.append(amounts)
|
|
502
|
+
#
|
|
503
|
+
return data
|
|
504
|
+
else:
|
|
505
|
+
#
|
|
506
|
+
results = {}
|
|
507
|
+
results["mineral"] = mineral
|
|
508
|
+
results["M"] = molar_mass
|
|
509
|
+
element_list = np.array(amounts)[:, 0]
|
|
510
|
+
results["chemistry"] = {}
|
|
511
|
+
for index, element in enumerate(element_list, start=0):
|
|
512
|
+
results["chemistry"][element] = amounts[index][2]
|
|
513
|
+
results["rho"] = round(rho, 4)
|
|
514
|
+
results["rho_e"] = round(rho_e, 4)
|
|
515
|
+
results["vP"] = round(vP, 4)
|
|
516
|
+
results["vS"] = round(vS, 4)
|
|
517
|
+
results["vP/vS"] = round(vPvS, 4)
|
|
518
|
+
results["G"] = round(G*10**(-9), 4)
|
|
519
|
+
results["K"] = round(K*10**(-9), 4)
|
|
520
|
+
results["E"] = round(E*10**(-9), 4)
|
|
521
|
+
results["nu"] = round(nu, 4)
|
|
522
|
+
results["GR"] = round(gamma_ray, 4)
|
|
523
|
+
results["PE"] = round(pe, 4)
|
|
524
|
+
results["U"] = round(U, 4)
|
|
525
|
+
if p != None:
|
|
526
|
+
results["p"] = round(p, 4)
|
|
527
|
+
else:
|
|
528
|
+
results["p"] = p
|
|
529
|
+
#
|
|
530
|
+
return results
|