PetThermoTools 0.2.38__py3-none-any.whl → 0.2.39__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.
- PetThermoTools/Melting.py +55 -18
- PetThermoTools/Plotting.py +5 -4
- PetThermoTools/_version.py +1 -1
- {PetThermoTools-0.2.38.dist-info → PetThermoTools-0.2.39.dist-info}/METADATA +1 -1
- {PetThermoTools-0.2.38.dist-info → PetThermoTools-0.2.39.dist-info}/RECORD +8 -8
- {PetThermoTools-0.2.38.dist-info → PetThermoTools-0.2.39.dist-info}/LICENSE.txt +0 -0
- {PetThermoTools-0.2.38.dist-info → PetThermoTools-0.2.39.dist-info}/WHEEL +0 -0
- {PetThermoTools-0.2.38.dist-info → PetThermoTools-0.2.39.dist-info}/top_level.txt +0 -0
PetThermoTools/Melting.py
CHANGED
@@ -49,14 +49,15 @@ def AdiabaticDecompressionMelting(cores = multiprocessing.cpu_count(),
|
|
49
49
|
P_path_bar = None, Frac = False, prop = None,
|
50
50
|
fO2_buffer = None, fO2_offset = None, Fe3Fet = None, MELTS_filter = True):
|
51
51
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
52
|
+
if Tp_Method == "pyMelt":
|
53
|
+
try:
|
54
|
+
import pyMelt as m
|
55
|
+
Lithologies = {'KLB-1': m.lithologies.matthews.klb1(),
|
56
|
+
'KG1': m.lithologies.matthews.kg1(),
|
57
|
+
'G2': m.lithologies.matthews.eclogite(),
|
58
|
+
'hz': m.lithologies.shorttle.harzburgite()}
|
59
|
+
except ImportError:
|
60
|
+
raise RuntimeError('You havent installed pyMelt or there is an error when importing pyMelt. pyMelt is currently required to estimate the starting point for the melting calculations.')
|
60
61
|
|
61
62
|
if bulk is not None and comp_lith_1 is None:
|
62
63
|
comp_lith_1 = bulk
|
@@ -155,7 +156,9 @@ def AdiabaticDecompressionMelting(cores = multiprocessing.cpu_count(),
|
|
155
156
|
|
156
157
|
return Results
|
157
158
|
|
158
|
-
def AdiabaticMelt(q, index, *, Model = None, comp_1 = None, comp_2 = None, comp_3 = None,
|
159
|
+
def AdiabaticMelt(q, index, *, Model = None, comp_1 = None, comp_2 = None, comp_3 = None,
|
160
|
+
Tp_C = None, P_start_bar = None, P_end_bar = None, dp_bar = None, P_path_bar = None,
|
161
|
+
Frac = None, fO2_buffer = None, fO2_offset = None, prop = None):
|
159
162
|
'''
|
160
163
|
Melting calculations to be performed in parallel.
|
161
164
|
|
@@ -163,21 +166,16 @@ def AdiabaticMelt(q, index, *, Model = None, comp_1 = None, comp_2 = None, comp_
|
|
163
166
|
Results = {}
|
164
167
|
if "MELTS" in Model:
|
165
168
|
try:
|
166
|
-
Results = AdiabaticDecompressionMelting_MELTS(Model = Model, comp = comp_1, Tp_C = Tp_C,
|
169
|
+
Results = AdiabaticDecompressionMelting_MELTS(Model = Model, comp = comp_1, Tp_C = Tp_C,
|
170
|
+
P_path_bar = P_path_bar, P_start_bar = P_start_bar, P_end_bar = P_end_bar, dp_bar = dp_bar,
|
171
|
+
fO2_buffer = fO2_buffer, fO2_offset = fO2_offset)
|
167
172
|
q.put([Results, index])
|
168
173
|
except:
|
169
174
|
q.put([])
|
170
175
|
|
171
176
|
return
|
172
|
-
|
173
|
-
if Model == "Holland":
|
174
|
-
# import pyMAGEMINcalc as MM
|
175
|
-
# Results = MM.AdiabaticDecompressionMelting(comp = comp_1, T_p_C = Tp_C, P_start_kbar = P_start_bar/1000, P_end_kbar = P_end_bar/1000, dp_kbar = dp_bar/1000, Frac = 0)
|
176
|
-
print('Note that the ability to use MAGEMin to performed adiabatic decompression melting in PetThermoTools has been temporarily disabled. The underlying issue will be fixed soon and this funciton will once again become available.')
|
177
|
-
q.put([Results, index])
|
178
|
-
return
|
179
177
|
|
180
|
-
|
178
|
+
elif Model == "pyMelt":
|
181
179
|
try:
|
182
180
|
import pyMelt as m
|
183
181
|
Lithologies = {'KLB-1': m.lithologies.matthews.klb1(),
|
@@ -239,5 +237,44 @@ def AdiabaticMelt(q, index, *, Model = None, comp_1 = None, comp_2 = None, comp_
|
|
239
237
|
|
240
238
|
q.put([Results, index])
|
241
239
|
return
|
240
|
+
|
241
|
+
else:
|
242
|
+
# import pyMAGEMINcalc as MM
|
243
|
+
# Results = MM.AdiabaticDecompressionMelting(comp = comp_1, T_p_C = Tp_C, P_start_kbar = P_start_bar/1000, P_end_kbar = P_end_bar/1000, dp_kbar = dp_bar/1000, Frac = 0)
|
244
|
+
# print('Note that the ability to use MAGEMin to performed adiabatic decompression melting in PetThermoTools has been temporarily disabled. The underlying issue will be fixed soon and this funciton will once again become available.')
|
245
|
+
|
246
|
+
try:
|
247
|
+
import pyMelt as m
|
248
|
+
Lithologies = {'KLB-1': m.lithologies.matthews.klb1(),
|
249
|
+
'KG1': m.lithologies.matthews.kg1(),
|
250
|
+
'G2': m.lithologies.matthews.eclogite(),
|
251
|
+
'hz': m.lithologies.shorttle.harzburgite()}
|
252
|
+
except ImportError:
|
253
|
+
raise RuntimeError('You havent installed pyMelt or there is an error when importing pyMelt. pyMelt is currently required to estimate the starting point for the melting calculations.')
|
254
|
+
|
255
|
+
lz = m.lithologies.matthews.klb1()
|
256
|
+
mantle = m.mantle([lz], [1], ['Lz'])
|
257
|
+
T_start_C = mantle.adiabat(P_start_bar/10000.0, Tp_C)
|
258
|
+
|
259
|
+
from juliacall import Main as jl, convert as jlconvert
|
260
|
+
|
261
|
+
jl.seval("using MAGEMinCalc")
|
262
|
+
|
263
|
+
comp_1['O'] = comp_1['Fe3Fet_Liq']*(((159.59/2)/71.844)*comp_1['FeOt_Liq'] - comp_1['FeOt_Liq'])
|
264
|
+
|
265
|
+
if type(comp_1) == dict:
|
266
|
+
comp_julia = jl.seval("Dict")(comp_1)
|
267
|
+
else:
|
268
|
+
comp_new = comp_1.loc[i].to_dict()
|
269
|
+
comp_julia = jl.seval("Dict")(comp_new)
|
270
|
+
|
271
|
+
Output_jl = jl.MAGEMinCalc.AdiabaticDecompressionMelting(comp = comp_julia, P_start_kbar = P_start_bar/1000.0,
|
272
|
+
P_end_kbar = P_end_bar/1000.0, dp_kbar = dp_bar/1000.0,
|
273
|
+
T_start_C = T_start_C, fo2_buffer = fO2_buffer, fo2_offset = fO2_offset, Model = Model)
|
274
|
+
Results = dict(Output_jl)
|
275
|
+
# Results = stich(Results, Model = Model)
|
276
|
+
|
277
|
+
q.put([Results, index])
|
278
|
+
return
|
242
279
|
|
243
280
|
|
PetThermoTools/Plotting.py
CHANGED
@@ -359,7 +359,7 @@ def residualT_plot(Results = None, P_bar = None, phases = None, H2O_Liq = None,
|
|
359
359
|
a[i][j].set_zlim([0,50])
|
360
360
|
|
361
361
|
def phase_plot(Results = None, y_axis = None, x_axis = None,
|
362
|
-
phases = ['Liq','Ol', 'Opx', 'Cpx', 'Sp', 'Grt'], cmap = "Reds",
|
362
|
+
phases = ['Liq', 'Ol', 'Opx', 'Cpx', 'Sp', 'Grt'], cmap = "Reds",
|
363
363
|
title = None, figsize = None):
|
364
364
|
|
365
365
|
if type(Results) != list:
|
@@ -373,10 +373,11 @@ def phase_plot(Results = None, y_axis = None, x_axis = None,
|
|
373
373
|
|
374
374
|
Stop = np.zeros(len(Results['All']['P_bar']))
|
375
375
|
for idx, p in enumerate(phases):
|
376
|
-
|
377
|
-
|
376
|
+
if 'mass_' + p in Results['All'].keys():
|
377
|
+
a.fill_betweenx(Results['All']['P_bar'], Stop,
|
378
|
+
x2= Stop + Results['All']['mass_' + p], alpha = 0.75, color = PhaseList[p], lw = 0)
|
378
379
|
|
379
|
-
|
380
|
+
Stop = Stop + Results['All']['mass_' + p]
|
380
381
|
|
381
382
|
a.set_ylabel('Pressure (bars)')
|
382
383
|
a.set_xlabel('Mass (g)')
|
PetThermoTools/_version.py
CHANGED
@@ -5,16 +5,16 @@ PetThermoTools/Holland.py,sha256=udBFeVUyTBpSfLIhx7Hy6o0I8ApNCDvwU_gZa0diY5w,725
|
|
5
5
|
PetThermoTools/Installation.py,sha256=UfVOW1NZFdzMWPyID5u7t0KwvpJA0AqYohzidXIAwYs,6098
|
6
6
|
PetThermoTools/Liq.py,sha256=2kdU8r00Y20khwvPvCvLr6P7y2HEOvCH2cwrF_qw5u8,35541
|
7
7
|
PetThermoTools/MELTS.py,sha256=DeTM8j2fJ5dAw_2DVCGfgh1R_lQB4Z5rLopKSJ1Q5xQ,73852
|
8
|
-
PetThermoTools/Melting.py,sha256=
|
8
|
+
PetThermoTools/Melting.py,sha256=6EXjDJi5ZEZkQdoZbClRvnm3la_9c1tqurwyagcp5ts,12808
|
9
9
|
PetThermoTools/Path.py,sha256=ey1nKnmdtriQ_0W6nG5Hbqhhk4EYqY64y1bMwhoXTW0,33050
|
10
10
|
PetThermoTools/Path_wrappers.py,sha256=_0pBs_cK2hICxAHkYxKXICUnUEBSiUg07-qhgBeuTdc,26555
|
11
11
|
PetThermoTools/PhaseDiagrams.py,sha256=8S_BcqggBzfUbiCPcsJRWFBenGL4tcCevte3-ATQjQI,30884
|
12
|
-
PetThermoTools/Plotting.py,sha256=
|
12
|
+
PetThermoTools/Plotting.py,sha256=uvL_j2emMveGumLQ-IeJqyMXGUQT_PyInOpGnsWziAI,28992
|
13
13
|
PetThermoTools/Saturation.py,sha256=XXY6fKVouQM3RLgQgXur4xSq7_uGp7bCw_k7NNlWYi8,14095
|
14
14
|
PetThermoTools/__init__.py,sha256=PbiwQj_mNNEwuIZOLETmtMMshiXa50wjCA6mfvpOpOs,2393
|
15
|
-
PetThermoTools/_version.py,sha256=
|
16
|
-
PetThermoTools-0.2.
|
17
|
-
PetThermoTools-0.2.
|
18
|
-
PetThermoTools-0.2.
|
19
|
-
PetThermoTools-0.2.
|
20
|
-
PetThermoTools-0.2.
|
15
|
+
PetThermoTools/_version.py,sha256=mHkADyHdAemaOsQ81BakYanLTpx-qI1XT0aama1lkCw,296
|
16
|
+
PetThermoTools-0.2.39.dist-info/LICENSE.txt,sha256=-mkx4iEw8Pk1RZUvncBhGLW87Uur5JB7FBQtOmX-VP0,1752
|
17
|
+
PetThermoTools-0.2.39.dist-info/METADATA,sha256=EaGuwfuigrt061ZQbwUN0JEYA0jg-D7YIQd-pXPwQe0,796
|
18
|
+
PetThermoTools-0.2.39.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
19
|
+
PetThermoTools-0.2.39.dist-info/top_level.txt,sha256=IqK8iYBR3YJozzMOTRZ8x8mU2k6x8ycoMBxZTm-I06U,15
|
20
|
+
PetThermoTools-0.2.39.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|