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 pyIntersecT

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

from pyIntersecT import IntersecT 
InT = IntersecT.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.2.tar.gz (693.7 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.2-py2.py3-none-any.whl (111.2 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for pyintersect-0.0.2.tar.gz
Algorithm Hash digest
SHA256 8646e67507c181b6db49cc01755ad99a3458e674d54002e36b2461fafd736a0a
MD5 be2b049b355998b63b04d0552b370a55
BLAKE2b-256 73fcd2d312c18fe2eb12c7ac9368e2c75bd5f71d2b55399bd32e9135ac74476a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pyintersect-0.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7a5adca0233856a06949c224a067bdd18e2b2765953cd1dc78bed3bc42d40893
MD5 c91471803aad12d2eca125e00ad61123
BLAKE2b-256 9409a20fa03492101090ccf94a76bf4b9719442636a5fe530cf5fd099a32a09d

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