Skip to main content

Quantitative isopleth thermobarometry from PerpleX

Project description

IntersecT

IntersecT_logo

IntersecT is a Python script that allows quantitative isopleth thermobarometry on Perple_X pressure (P)-temperature (T)-composition (X) phase diagrams. The quality factor of the composition (Qcmp, as reported in Duesterhoeft and Lanari, 2020) is calculated for the extracted compositions using the WERAMI routine of Perple_X. The WERAMI output file must contain only the phases considered in equilibrium, and their composition must be in a.p.f.u. to allow the propagation of uncertainties.

For a step-by-step tutorial on calculating phase diagrams with Perple_X, refer to the Groppo & Castelli tutorial

How to run IntersecT

IntersecT requires Python v3.10 or more recent versions

Install Jupyter Notebook. Run the following to install:

pip install jupyterlab
pip install notebook

Download the Intersect Jupyter Notebook file and save it in the Python\Scripts directory.

In the Python\Script directory, double-click on the jupyter-notebook.exe file - it will open a browser tab which is a local folder - and run the IntersecT.ipynb file

Read the instructions and run the code cells (Shift+Enter when positioned in the cell, or Run all)

Input files

Also refer to the example folder

  1. WERAMI .tab file

Using the WERAMI routine of Perple_X, export the a.p.f.u. of the elements for each phase that are considered at equilibrium. Columns can be added or deleted manually (e.g., using Excel), but do not modify the rows.

  1. User's .txt file

The .txt input file must contain: i. As many rows of comment text as wanted, just make sure they start with ‘#’; these will not be read by the script, and can contain information about the sample or the calculation

ii. Any given name for the considered element; these will serve as titles for the plots and the saved .pdf files

iii. The measured composition (in a.p.f.u.) for each element corresponding to the WERAMI calculation

iv. The observed uncertainty (1σ) for each element; alternatively, “-“ must be inserted to let the script calculate an uncertainty based on the type of acquired analysis

v. Type of analysis: EDS, WDS map, WDS spot

vi. The name of the phases; these will serve as titles for the plots and the saved .pdf files

vii. A chosen colour scheme for the plots from the options available in Python

Explanation of the code cells

%pip install matplotlib
%pip install pandas
%pip install pytk
%pip install IntersecT

installs the required packages automatically if not already installed in the local environment.

import IntersecT as InersecT
InT = InersecT.QualityFactorAnalysis()

imports the IntersecT library, which is necessary to run the following calculations and defines the object InT to call the subroutines to calculate the quality factor.

InT.import_output_perplex()

imports the WERAMI .tab file. It identifies the x and y axes, the labels of the WERAMI columns, and how many columns for each phase are present.

InT.import_analytical_compo()

imports the .txt file with the observed compositions and recognizes the input values; if instead of the observed uncertainty (1σ) the user reports “-“, the script will calculate an uncertainty based on the type of measurement (EDS, WDS map, WDS spot).

InT.set_output_directory()

lets the user choose a directory in which the script will save all the output maps in .pdf format.

InT.Qcmp_elem(i)

calculates the Qcmp for each element of each phase.

Qcmp_phase_tot = InT.Qcmp_phase(i)

calculates the Qcmp for each phase.

redchi2_phase = InT.redchi2_phase()

calculates the reduced chi-squared statistic (best fit for values ≤ 1) for each phase and finds the lowest value; if only two elements are considered for a phase, the result will be a chi-squared statistic (best fit ~ 0).

redchi2_allphases = InT.redchi2_tot()

calculates the total reduced chi-squared statistic for the overall dataset, which can be helpful for inversion.

Qcmp_allphases = InT.Qcmp_tot(Qcmp_phase_tot, redchi2_phase)

calculates the total Qcmp for the overall dataset, assuming an equal weight for each phase (i.e., an unweighted total Qcmp).

Qcmp_allphases_weight = InT.Qcmp_tot_weight(Qcmp_phase_tot, redchi2_phase)

calculates a weighted total Qcmp for the overall dataset based on the best value of the reduced chi-squared statistic for each phase.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyintersect-0.0.1.tar.gz (348.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyintersect-0.0.1-py2.py3-none-any.whl (111.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pyintersect-0.0.1.tar.gz.

File metadata

  • Download URL: pyintersect-0.0.1.tar.gz
  • Upload date:
  • Size: 348.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.1

File hashes

Hashes for pyintersect-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c9d2ca4565fc6cc9c8b352442266525212f6b2d8ff10505c8503fee92f9b4157
MD5 d5f84d9ba0f209ffca18d7e1299e182b
BLAKE2b-256 4883ea24e8c1b2f550cf0d3ba29557abaa6a42c2271804d76d019a0f7077cf79

See more details on using hashes here.

File details

Details for the file pyintersect-0.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: pyintersect-0.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 111.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.1

File hashes

Hashes for pyintersect-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3d7da5d0a3552d2750d6e11c9065b59253100edaa9b1c73e4bd60f4d0cfb29e4
MD5 5bb33391c9be339458d9fd50934fd6c6
BLAKE2b-256 b12decdcc05bd99d55b89e215291607a7fba63ac724c184ff3bdf05df957b837

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page