For modeling diffusion in plagioclase
Project description
plag — diffusion modeling in plagioclase
A Python library for building and running trace-element diffusion models in plagioclase feldspar.
For complete documentation please see vsc.code-pages.usgs.gov/petro/tools/plag.
docs only available on internal USGS network for now, but will be made public in the future
Motivation
Diffusion chronometry in plagioclase is a powerful tool for constraining the timescales of magmatic processes. It is fairly ubiquitous in igneous systems, crystallizing over a wide range of $P-T-X-fO_2$ conditions, and has chronometers that span orders of magnitude allowing for the quantification of a range of timescales (i.e., days - millennia). Furthermore, many parameters to help aid in petrologic investigations (partition coefficients for calculating melt composition proxies) and diffusion studies (diffusion coefficients) can be calculated by only having knowledge of the plagioclase composition, temperature, and basic melt composition, making it a powerful tool in the petrologist toolkit. This, however, is where the fun seemingly ends. While these observations are incredibly useful, their numerical implementation is not exactly straightforward, and setting up forward diffusion models involves many interrelated steps: choosing partitioning and diffusivity models, constructing initial profiles, running finite-difference simulations, and propagating analytical and temperature uncertainties through Monte Carlo resampling.
plag wraps this entire workflow into a single, coherent API so that you can focus on the science rather than the bookkeeping.
Goals
- Provide a structured, reproducible workflow for calculations involving trace-element diffusion modeling in plagioclase.
- Make it easy to compare different partitioning and diffusivity parameterisations from the literature.
- Propagate uncertainties rigorously via Monte Carlo methods with random sampling that incorporates the covariance structure of the data that determines all the parameters utilized in the random sampling (e.g., $RT\ln{K_d} = A(\pm \sigma_A)\cdot X_{An} + B(\pm \sigma_B)$).
- Take advantage of
numbaaccelerated finite-difference solvers for fast forward modeling on a standard personal computer.
Installation
It is recommended to do this in a fresh virtual environment:
# Create a virtual environment (conda example)
conda create -n diffusion-modeling python=3.13
conda activate diffusion-modeling
# Install from PyPI
pip install plagioclase
# Install from source
git clone https://code.usgs.gov/vsc/petro/tools/plag.git
cd plag
pip install .
For development (includes pytest, pytest-cov, ruff):
pip install -e ".[dev]"
Citation
If you use plag in your research, please cite it:
Lubbers, J. (2026)
plag, version 1.0.0: U.S. Geological Survey software release https://doi.org/10.5066/P13OEK4A
To do
See todo.md for the full list of outstanding work items, each annotated with implementation guidance.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file plagioclase-1.0.0.tar.gz.
File metadata
- Download URL: plagioclase-1.0.0.tar.gz
- Upload date:
- Size: 87.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4325e7085a09e4caf8c944ef08cbc229ca0d06538b4964f9ca125cbc0933a335
|
|
| MD5 |
e60d4cf4ca8d0eecc200edd209d98159
|
|
| BLAKE2b-256 |
b90679973252efe119ea3fac21a4fa9d9cf04a99e2f2225d05f0a652bbd8f1d2
|
File details
Details for the file plagioclase-1.0.0-py3-none-any.whl.
File metadata
- Download URL: plagioclase-1.0.0-py3-none-any.whl
- Upload date:
- Size: 92.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d236fcc45cf03f635315aa791dc90ff3f24591c4b80e398d1cc68c03518a7790
|
|
| MD5 |
8d42413c7b39f803df9e2853d775c6f9
|
|
| BLAKE2b-256 |
d625c66d2f0861136ed4ce32cd99d5edddf242da5cab7b860f4ce44111f503b6
|