Metadata-Version: 2.1
Name: PyIRoGlass
Version: 0.3.1
Summary: PyIRoGlass
Home-page: https://github.com/sarahshi/PyIRoGlass
Author: Sarah Shi
Author-email: sarah.c.shi@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: pandas
Requires-Dist: numpy
Requires-Dist: matplotlib
Requires-Dist: scikit-learn
Requires-Dist: scipy
Requires-Dist: mc3
Requires-Dist: pykrige
Requires-Dist: peakdetect

# PyIRoGlass
[![PyPI](https://badgen.net/pypi/v/PyIRoGlass)](https://pypi.org/project/PyIRoGlass/)
[![Build Status](https://github.com/SarahShi/PyIRoGlass/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/SarahShi/PyIRoGlass/actions/workflows/main.yml)
[![Documentation Status](https://readthedocs.org/projects/pyiroglass/badge/?version=latest)](https://pyiroglass.readthedocs.io/en/latest/?badge=latest)
[![codecov](https://codecov.io/gh/SarahShi/PyIRoGlass/branch/main/graph/badge.svg)](https://codecov.io/gh/SarahShi/PyIRoGlass/branch/main)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/SarahShi/PyIRoGlass/blob/main/PyIRoGlass_RUN_colab.ipynb)
[![Python 3.7](https://img.shields.io/badge/python-3.7+-blue.svg)](https://www.python.org/downloads/release/python-370/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

PyIRoGlass is a Bayesian MCMC-founded Python algorithm for determining volatile concentrations and speciation for $\mathrm{H_2O_{t, 3550}}$, $\mathrm{H_2O_{m, 1635}}$, $\mathrm{CO_{3, 1515}^{2-}}$, $\mathrm{CO_{3, 1430}^{2-}}$, $\mathrm{H_2O_{m, 5200}}$, and $\mathrm{OH_{4500}}$ from basaltic to andesitic transmission FTIR spectra. PyIRoGlass is written in the open-source language Python3 with the $\mathrm{MC^3}$ package, allowing for the proper sampling of parameter space and the determination of volatile concentrations with uncertainties. 

Quantifying concentrations of volatiles in magmas is critical for estimating the conditions of magma storage, assessing phase equilibria, and understanding eruption processes. We develop and present PyIRoGlass, a new open-source Python package implementing a Bayesian method with Markov Chain Monte Carlo sampling, to process the transmission FTIR spectra of basaltic to andesitic glasses and to quantify volatile concentrations with uncertainties for all $\mathrm{H_2O}$ and $\mathrm{CO_2}$ glass species, when devolatilized baselines are not readily available. We utilize a database of naturally degassed melt inclusions from the Aleutians and back-arc basin basalts to determine the fundamental shapes and variability of the baseline in the mid-IR region, in which the $\mathrm{CO_3^{2-}}$ doublets and $\mathrm{H_2O_{m, 1635}}$ peaks are found. The baseline and peak shapes vary across samples, dependent on the chemistry of samples and concentration of volatiles. All parameters within the Beer-Lambert Law — including the baseline, molar absorptivity, thickness, and density — are closely examined to quantify the associated uncertainties. Molar absorptivity is recalibrated as a function of compositional parameters by applying a Newtonian inversion, allowing for the quantification of the uncertainty of the inversion and of the uncertainty in composition. PyIRoGlass further provides functions for processing reflectance FTIR spectra to determine sample wafer thickness. This Bayesian method allows for the simultaneous MCMC sampling of all likely baselines and peaks to iteratively solve for the best-fit parameters. We present a promising method for confidently processing transmission FTIR spectra to determine volatile concentrations with robust estimation of uncertainty and  consideration of covariance within fit parameters. The open-source nature of the Python package allows for continuous evolution as more data become available.


