import matplotlib.pyplot as plt
plt.rcParams['figure.dpi'] = 150
plt.rcParams['figure.figsize'] = [8, 4.5]
We need to import PTPS class, which contains most of the methods to work with already constructed pseudosection with ptbuilder
.
from pypsbuilder import PTPS
We create instance of PTPS by openning existing project file
pt = PTPS('avgpelite2.ptb')
We can check, whether the pseudosection already contains gridded calculations. If not, we can use calculate_composition
method to calculate compositional variations on grid.
if not pt.gridded:
pt.calculate_composition(nx=71, ny=51)
To show pseudosection, we can use show
method
pt.show()
pt.show(cmap='viridis', bulk=True)
pt.show(cmap='viridis', out=['g', 'chl', 'ep', 'law'])
pt.show(cmap='viridis', bulk=True, label=True)
identify
method could be used to identify stable assemblage for given p and T conditions.
key = pt.identify(550, 13)
print(key)
frozenset({'q', 'bi', 'g', 'mu', 'sph', 'H2O', 'pa'})
Most of methods, which needs expression as argument can list available variables when expression is ommitted.
pt.show_data(key, 'g')
Missing expression argument. Available variables for phase g are: mode x z m f xMgX xFeX xMnX xCaX xAlY xFe3Y H2O SiO2 Al2O3 CaO MgO FeO K2O Na2O TiO2 MnO O factor G H S V rho Available end-members for g: gr spss py alm kho
show_data
method will show available data for given stable assemblage. It is combination of calculations from invariant points, univariant lines and calculations on the grid.
pt.show_data(key, 'g', 'xCaX')
You can access data sources individually
pt.show_data(key, 'g', 'xCaX', which=1)
pt.show_data(key, 'g', 'xCaX', which=2)
pt.show_data(key, 'g', 'xCaX', which=4)
For data on the grid you can visualize them for all diagram in once
pt.show_grid('g', 'xCaX')
To create isopleths diagram you can use isopleths
method. Note that contours are created separately for each stable assemblage allowing proper geometry of isopleths.
pt.isopleths('g', 'xCaX', N=14)
pt.isopleths('chl')
Missing expression argument. Available variables for phase chl are: mode x y f m QAl Q1 Q4 xMgM1 xMnM1 xFeM1 xAlM1 xMgM23 xMnM23 xFeM23 xMgM4 xFeM4 xFe3M4 xAlM4 xSiT2 xAlT2 H2O SiO2 Al2O3 CaO MgO FeO K2O Na2O TiO2 MnO O factor G H S V rho Available end-members for chl: ochl4 daph mmchl ochl1 f3clin afchl ames clin
pt.isopleths('chl', 'mode')
psexplorer
allows you to evaluate equilibria along user-defined PT path. PT path is defined by series of points (path is interpolated) and method collect_ptpath
do actual calculations. It runs THERMOCALC with ptguesses obtained from existing calculations.
t = [380, 480, 580, 640, 500]
p = [7, 12, 15, 9, 5.5]
pa = pt.collect_ptpath(t, p)
Calculating: 100%|████████████████████████████| 100/100 [00:05<00:00, 16.89it/s]
You can see phase modes along PT path using show_path_modes
method.
pt.show_path_modes(pa, exclude=['H2O'])
or show value of user-defined expression shown as colored strip on PT space.
pt.show_path_data(pa, 'g', 'mode')
show_status
method shows status of calculations on the grid. Possible failed calculations are shown.
pt.show_status()
Do you want to know execution time of THERMOCALC on individual grid points? Check show_delta
method.
pt.show_delta(pointsec=True)