rampedpyrox.RpoIsotopes

class rampedpyrox.RpoIsotopes(model, ratedata, t_frac, d13C_raw=None, d13C_raw_std=None, Fm_raw=None, Fm_raw_std=None, m_raw=None, m_raw_std=None, blk_corr=False, mb_corr=False, kie_corr=False)[source]

Class for inputting Ramped PyrOx isotopes, calculating p(0,E) contained in each RPO fraction, correcting isotope values for blank contribution, mass balance, and kinetic fractionation (d13C only), and storing resulting data and statistics.

Parameters:
  • blk_corr (boolean) – Boolean to determine if inputted isotope data have been blank corrected, defaults to False.
  • d13C_raw (None or array-like) – Array of the raw d13C values (VPDB) of each measured fraction, length nFrac. Defaults to None.
  • d13C_raw_std (None or array-like) – The standard deviation of d13C_raw with length nFrac. Defaults to zeros or None if d13C_raw is None.
  • Fm_raw (None or array-like) – Array of the raw Fm values of each measured fraction, length nFrac. Defaults to None.
  • Fm_raw_std (None or array-like) – The standard deviation of Fm_raw with length nFrac. Defaults to zeros or None if Fm_raw is None.
  • kie_corr (boolean) – Boolean to determine if inputted d13C data have been fractionation corrected, defaults to False.
  • m_raw (None or array-like) – Array of the raw masses (ugC) of each measured fraction, length nFrac. Defaults to None.
  • m_raw_std (None or array-like) – The standard deviation of d13C_raw with length nFrac. Defaults to zero or None if m_raw is None.
  • mb_corr (boolean) – Boolean to determine if inputted d13C data have been mass-balance corrected, defaults to False.
  • model (rp.Daem) – rp.Daem instance associated with the inputted energy complex, used for calculating the fractional E distributions and for KIE d13C correction.
  • ratedata (rp.EnergyComplex) – rp.EnergyComplex instance containing p(0,E) distribution for the thermogram associated with inputted isotopes. Used for calculating the fractional E distributions and for KIE d13C correction.
  • t_frac (None or array-like) – 2d array of the initial and final times of each fraction, in seconds. Shape [nFrac x 2]. Defaults to None.

Warning

UserWarning
If using an an isothermal model type for an RPO run.
UserWarning
If using a non-energy complex ratedata type for an RPO run.
Raises:
  • ArrayError – If t_frac is not array-like.
  • ArrayError – If nE is not the same in the rp.Model instance and the rp.RateData instance.

Notes

When inputting t_frac, a time of 0 (i.e. t0, the initial time) is defined as the first timepoint in the RpoThermogram instance. If time passed between the thermogram t0 and the beginning of fraction 1 trapping (as is almost always the case), t_frac must be adjusted accordingly. This is done automatically when importing from .csv (see RpoIsotopes.from_csv) documenatation for info.

See also

Daem
Model subclass used to generate the transform for RPO data and translate between time- and E-space.
EnergyComplex
RateData subclass for storing and analyzing RPO rate data.
RpoThermogram
TimeData subclass containing the time and fraction remaining data used for the inversion.

Examples

Generating a bare-bones isotope result instance containing only arbitrary time and Fm data for a given energy complex instance, ec, and a given model instance, Daem:

#import modules
import rampedpyrox as rp
import numpy as np

#generate arbitrary data for 3 fractions
t_frac = [[100, 200], [200, 300], [300, 1000]]
t_frac = np.array(t_frac)

Fm_raw = [1.0, 0.5, 0.0]

#create instance
ri = rp.RpoIsotopes(
        daem,
        ec,
        t_frac,
        Fm_raw = Fm_raw)

Generating a isotope result instance using an RPO output .csv file and the RpoIsotopes.from_csv class method:

#import modules
import rampedpyrox as rp

#create path to data file
file = 'path_to_folder_containing_data/isotope_data.csv'

#create instance
ri = rp.RpoThermogram.from_csv(
        file,
        model,
        ratedata,
        blk_corr = True,
        mass_err = 0.01,
        DE = 0.0018)

This will automatically correct inputted isotopes for the inputted instrument blank carbon contribution using the blk_corr flag and will assumed a 1 percent uncertainty in mass measurements. Additionally, this will fractionation-correct d13C data (if they exist) using a KIE DE of 1.8 J/mol. NOTE: See RpoIsotopes.from_csv documentation for instructions on getting the .csv file in the right format.

Plotting resulting p(0,E) contained in each RPO fraction:

#import additional modules
import matplotlib.pyplot as plt

#create figure
fig, ax = plt.subplots(1,3)

#plot p(0,E) distributions
ax[0] = ri.plot(
        ax = ax[0],
        plt_var = 'p0E')

Plotting resulting isotope vs. E scatter plots:

#plot d13C data
ax[1] = ri.plot(
        ax = ax[1],
        plt_var = 'd13C',
        plt_corr = True) #plotting corrected values

#plot Fm data
ax[2] = ri.plot(
        ax = ax[2],
        plt_var = 'Fm',
        plt_corr = True) #plotting corrected values

Printing a summary of the raw and corrected isotope values:

#raw fraction information
print(ri.ri_raw_info)

#corrected fraction information
print(ri.ri_corr_info)

Attributes

d13C_corr : np.ndarray
Array of the d13C values (VPDB) of each measured fraction, corrected for any of: blank, mass-balance, KIE. Length nFrac.
d13C_corr_std : np.ndarray
The standard deviation of the d13C values (VPDB) of each measured fraction, corrected for any of: blank, mass-balance, KIE. Length nFrac.
d13C_raw : np.ndarray
Array of the raw d13C values (VPDB) of each measured fraction, length nFrac.
d13C_raw_std : np.ndarray
The standard deviation of d13C_raw with length nFrac.
E_frac : np.ndarray
Array of the mean E value (kJ) contained in each measured fraction as calculated by the inverse model, length nFrac.
E_frac_std : np.ndarray
The standard deviation of E (kJ) contained in each measured fraction as calculated by the inverse model, length nFrac.
Fm_corr : np.ndarray
Array of the blank-corrected Fm values of each measured fraction, length nFrac.
Fm_corr_std : np.ndarray
The standard deviation of Fm_corr with length nFrac.
Fm_raw : np.ndarray
Array of the raw Fm values of each measured fraction, length nFrac.
Fm_raw_std : np.ndarray
The standard deviation of Fm_raw with length nFrac.
m_corr : np.ndarray
Array of the blank-corrected masses (ugC) of each measured fraction, length nFrac.
m_corr_std : np.ndarray
The standard deviation of m_corr with length nFrac.
m_raw : np.ndarray
Array of the raw masses (ugC) of each measured fraction, length nFrac.
m_raw_std : np.ndarray
The standard deviation of m_raw with length nFrac.
nFrac : int
The number of measured fractions.
ri_corr_info : pd.DataFrame

Dataframe containing the inputted summary info, using corrected isotopes:

time (init. and final),

E (mean and std.),

mass (mean and std.),

d13C (mean and std.),

Fm (mean and std.)

ri_raw_info : pd.DataFrame

Dataframe containing the inputted summary info, using raw isotopes:

time (init. and final),

E (mean and std.),

mass (mean and std.),

d13C (mean and std.),

Fm (mean and std.)

t_frac : np.ndarray
2d array of the initial and final times of each fraction, in seconds. Shape [nFrac x 2].

Methods

blank_correct([blk_d13C, blk_flux, blk_Fm, …]) Method to blank- and mass-balance correct raw isotope values.
from_csv(file, model, ratedata[, blk_corr, …]) Class method to directly import RPO fraction data from a .csv file and create an RpoIsotopes class instance.
kie_correct(model, ratedata[, DE]) Method for further correcting d13C values to account for kinetic isotope fractionation occurring within the instrument.
plot([ax, plt_var, plt_corr]) Method for plotting results, either p(0,E) distributions contained within each RPO fraction or isotopes vs.