radage.radage module

radage.radage.Pb_mix_t(r207_206, r238_206, Pbc='SK')[source]

Solve for age given a pair of 207/206 & 238/206 isotopic ratios and a common lead model.

Given a pair of 207/206 & 238/206 isotopic ratios, this function solves for the age such that one has a lead mixing model that results in identical Stacey & Kramers’ (1975) common lead model and lower intercept concordia ages while also passing through the observed pair of ratios.

Parameters:
  • r207_206 (float) – 207/206 ratio

  • r238_206 (float) – 238/206 ratio

  • Pbc (str or float, optional) – Initial common lead model to use, by default ‘SK’. If float, then the common lead model is defined by the input value.

Returns:

t – Age in Myr

Return type:

float

Examples

import radage

(Source code)

class radage.radage.UPb(r206_238, r206_238_std, r207_235, r207_235_std, r207_206, r207_206_std, rho75_68, rho86_76, name=None)[source]

Bases: object

class for handling U-Pb ages, where data are given as isotopic ratios and their uncertainties

Parameters:
  • r206_238 (float) – Pb206/U238 ratio

  • r206_238_std (float) – Standard deviation of Pb206/U238 ratio

  • r207_235 (float) – Pb207/U235 ratio

  • r207_235_std (float) – Standard deviation of Pb207/U235 ratio

  • r207_206 (float) – Pb207/Pb206 ratio

  • r207_206_std (float) – Standard deviation of Pb207/Pb206 ratio

  • rho75_68 (float) – Error correlation between 207/235 and 206/238 ratios. Must be between -1 and 1

  • rho86_76 (float) – Error correlation between 238/206 and 207/206 ratios. Must be between -1 and 1

  • name (str, optional) – Name for age, by default None. Useful for plotting

cov_235_238

Covariance matrix for 206/238 and 207/235 ratios

Type:

numpy.ndarray

eigval_235_238

Eigenvalues of covariance matrix for 206/238 and 207/235 ratios

Type:

numpy.ndarray

eigvec_235_238

Eigenvectors of covariance matrix for 206/238 and 207/235 ratios

Type:

numpy.ndarray

cov_238_207

Covariance matrix for 238/206 and 207/206 ratios

Type:

numpy.ndarray

eigval_238_207

Eigenvalues of covariance matrix for 238/206 and 207/206 ratios

Type:

numpy.ndarray

eigvec_238_207

Eigenvectors of covariance matrix for 238/206 and 207/206 ratios

Type:

numpy.ndarray

date68(conf=0.95)[source]

206/238 date with uncertainty.

Parameters:

conf (float or None, optional) – Confidence level for interval, by default 0.95. If None, only the age is returned.

Returns:

  • date (float) – Date in Myr

  • sig (float) – Standard deviation of date

  • confint (float) – Confidence interval at desired confidence level

date75(conf=0.95)[source]

207/235 date with uncertainty.

Parameters:

conf (float or None, optional) – Confidence level for interval, by default 0.95. If None, only the age is returned.

Returns:

  • date (float) – Date in Myr

  • sig (float) – Standard deviation of date

  • confint (float) – Confidence interval at desired confidence level.

date76(conf=0.95, u238u235=138.818)[source]

207/206 date with uncertainty.

Parameters:
  • conf (float or None, optional) – Confidence level for interval, by default 0.95. If None, only the age is returned.

  • u238u235 (float, optional) – Ratio of U238 to U235, by default u238u235

Returns:

  • date (float) – Date in Myr

  • sig (float) – Standard deviation of date

  • confint (float) – Confidence interval at desired confidence level.

date_207_238_concordia()[source]

207Pb/206Pb - 206Pb/238U concordia date

The date is calculate as per Ludwig (1998), with uncertainty and MSWD.

Utilizes the error transformation for 207Pb/235U computed from 206Pb/238U and 207Pb/206Pb as per Appendix A of Ludwig (1998).

Returns:

  • t (float) – Concordia date (Myr) for 207Pb/206Pb - 206Pb/238U

  • t_std (float) – Standard deviation of age

  • poc (float) – Probability of concordance.

date_235_238_concordia()[source]

207Pb/235U - 206Pb/238U concordia date

The date is calculate as per Ludwig (1998), with uncertainty and MSWD.

Returns:

  • t (float) – Concordia date (Myr) for 207Pb/235U - 206Pb/238U

  • t_std (float) – Standard deviation of age

  • poc (float) – Probability of concordance.

discordance(method='relative')[source]

Date discordance.

Compute discordance according to a given method.

Parameters:

method (str, optional) –

Method for computing discordance, by default ‘relative’. Valid strings are:

  • ’SK’: mixture model with Stacey and Kramers’ (1975) common lead model

  • ’p_238_235’: use the probability of fit from the concordia age

  • ’relative’: relative age different, where the 206/238 vs 207/235 ages are

    used for 206/238 ages younger than 1 Ga, and the 207/206 vs 206/238 ages are used for ages older than 1 Ga

  • ’relative_68_76’: relative age difference using only the 206/238 and 206/207

    ages, computed as 1-(t68/t76)

  • ’concordia-distance’: as defined in Equation 8 of Vermeesch (2021) (see corrigendum).

Returns:

d – discordance

Return type:

float

ellipse_68_75(conf=0.95, patch_dict=None)[source]

Uncertainty ellipse for 206Pb/238U-207Pb/235U date

See here for more information.

Parameters:
  • conf (float, optional) – Confidence level for interval, by default 0.95

  • patch_dict (dict, optional) – Dictionary of keyword arguments for the ellipse, by default None. If None, a default style is used.

Returns:

ell – Ellipse object representing the uncertainty ellipse for the 206Pb/238U-207Pb/235U date.

Return type:

matplotlib.patches.Ellipse

ellipse_76_86(conf=0.95, patch_dict=None)[source]

Uncertainty ellipse for 207Pb/206Pb-238U/206Pb date

See here for more information.

radage.radage.concordia(t)[source]

Wetherill concordia curve.

207/235 and 206/238 ratios for given times.

Parameters:

t (array-like) – time points in Myr

Returns:

  • r207_235 (array-like) – 207/235 ratios for the given times

  • r206_238 (array-like) – 206/238 ratios for the given times

radage.radage.concordia_confint(t, conf=0.95)[source]

Confidence intervals on concordia.

Function giving 206/238, 207/235 ratios for bounds on confidence region around concordia at a given t Returns upper bound, then lower bound

Parameters:
  • t (array-like) – time points in Myr

  • conf (float, optional) – confidence level for interval, defaults to 0.95

Returns:

  • lower_bound (numpy.ndarray) – Lower bound of confidence interval, first column is 207/235, second column is 206/238

  • upper_bound (numpy.ndarray) – Upper bound of confidence interval, first column is 207/235, second column is 206/238

radage.radage.concordia_tw(t)[source]

Tara-Wasserberg concordia curve.

238/206 and 207/206 ratios for given times.

Parameters:

t (array-like) – time points in Myr

Returns:

  • r238_206 (array-like) – 238/206 ratios for the given times

  • r207_206 (array-like) – 207/206 ratios for the given times

radage.radage.discordance_filter(ages, method='relative', threshold=0.03, system_threshold=False)[source]

function to filter on discordance

Parameters:
  • ages (list) – List of UPb.radage objects

  • method (string) – ‘relative’, ‘absolute’, ‘aitchison’ discordance metric to use. Discordance is evaluated between 207/206-238/206 ages for samples with 207/206 ages > 1 Ga, and 206/238-207/235 ages for sample with 207/206 ages < 1 Ga

  • threshold (float, optional) – discordance value for chosen filtering method above which to flag ages as discordant

  • system_threshold (boolean, optional) – whether or not to switch discordance metrics between the 207/206-238/206 and 206/238-207/235 systems at 1 Ga. If false, then discordance is always computed between the 207/206-238/206 systems. If true, only works for aithison, relative, and absolute discordance metrics.

Returns:

  • ages_conc (list) – List of UPb.radage objects that pass the discordance filter

  • idx (np.ndarray) – Indices of the ages that pass the discordance filter

radage.radage.discordia_date_76_86(UPbs, conf=None, n_mc=500, Pbc=None, Pbc_std=0.01)[source]

Lower intercept date in Tera-Wasserburg space

Parameters:
  • UPbs (list) – List of UPb.radage objects

  • conf (float, optional) – Confidence level for interval, by default None. If None, only the lower intercept date is returned. Otherwise, a range corresponding to the confidence level is returned. Valid values are between 0 and 1.

  • n_mc (int, optional) – Number of Monte Carlo iterations to use for estimating uncertainty, by default 1000. This is only used if conf is not None.

  • Pbc (float, optional) – Common lead ratio to use, by default None. If None, the common lead ratio is estimated from the data. If a float, the common lead ratio is fixed to this value. If ‘SK’, the common lead ratio is determined such that it is equal to the Stacey and Kramers (1975) common lead ratio at the lower intercept date.

  • Pbc_std (float, optional) – Standard deviation of the common lead ratio, by default 1e-1. This is only used if conf is not None.

Returns:

result – Dictionary containing the following:

  • datefloat

    Date in Ma corresponding to the lower intercept of the line in Tera-Wasserburg space.

  • slopefloat

    Slope of the line in Tera-Wasserburg space.

  • slope_stdfloat

    Standard deviation of the slope.

  • interceptfloat

    Common lead ratio determined in the calculation. Returns same value as input if Pbc is a float.

  • intercept_stdfloat

    Standard deviation of the common lead ratio.

  • slope_intercept_covfloat

    Covariance between the slope and intercept.

  • mswdfloat

    Mean square weighted deviation of the fit.

  • confintlist

    List of lower and upper bounds of the confidence interval for the lower intercept date. This is only computed if conf is not None.

Return type:

dict

radage.radage.eHf(Hf176Hf177, Lu176Hf177, t, Hf_CHUR=0.282772, Lu_CHUR=0.0332)[source]

epsilon hafnium

for a given set of ratios

Parameters:
  • Hf176Hf177 (array-like) – 176Hf/177Hf ratio(s)

  • Lu176Hf177 (array-like) – 176Lu/177Hf ratio(s)

  • t (array-like) – age(s) in Myr. If float, then the same age is used for all ratios.

  • Hf_CHUR (float, optional) – 176Hf/177Hf ratio for CHUR, by default Hf_CHUR

  • Lu_CHUR (float, optional) – 176Lu/177Hf ratio for CHUR, by default Lu_CHUR

Returns:

eHf – epsilon hafnium value(s)

Return type:

array-like

radage.radage.eHf_DM(t)[source]

epsilon Hafnium for depleted mantle

Parameters:

t (array-like) – Age(s) in Myr

Returns:

eHf – epsilon hafnium value(s) for depleted mantle

Return type:

array-like

radage.radage.get_ages(df)[source]

Produce UPb age objects

Create UPb age objects from data in GeochemDB. This function assumes that the following quantities are present in the GeochemDB database and form columns in the input DataFrame: - Pb206/U238 - Pb207/U235 - Pb207/Pb206 - rho 206Pb/238U v 207Pb/235U - rho 207Pb/206Pb v 238U/206Pb These quantitues should have both mean and uncertainty values.

Parameters:

df (pd.DataFrame) – DataFrame of U-Pb measurements, ideally from GeochemDB.GeochemDB.measurements_by_sample(). Must have a hierarchical column index with the following levels: ‘Pb206/U238’, ‘Pb207/U235’, ‘Pb207/Pb206’, ‘rho 206Pb/238U v 207Pb/235U’, ‘rho 207Pb/206Pb v 238U/206Pb’. Each level should have ‘mean’ and ‘uncertainty’ sublevels.

Returns:

ages – List of UPb objects.

Return type:

list

radage.radage.kde(radages, t, kernel='gauss', bw='adaptive', weights='uncertainty', **kwargs)[source]

Evaluate kde for radages at times t.

The 238/206 - 207/206 concordia ages are used for plotting, and the associated uncertainties are used as weights.

Parameters:
  • radages (arraylike) – list of radages.

  • t (arraylike) – times at which to evaluate the kde.

  • bw (str or float, optional) – Bandwidth, by default ‘adaptive’. Valid strings are ‘adaptive’, ‘scott’, ‘botev’. If float, specifies a fixed bandwidth directly.

  • kernel (str, optional) – Kernel function to use, by default ‘epa’. Valid strings are ‘epa’, ‘gauss’.

  • weights (arraylike or None or str, optional) – Weights for each age, by default ‘uncertainty’. Valid values are ‘uncertainty’, None, or an array of floats of the same length as radages.

  • **kwargs (dict, optional) – Additional arguments to pass to helper.kde_base

Returns:

kde_est – KDE estimate at times t

Return type:

arraylike

radage.radage.line_mswd(m, b, x, y, wx, wy, r)[source]

Reduced chi-squared statistic for a linear fit to data with errors in both x and y. This

Parameters:
  • m (float) – Slope of line

  • b (float) – Intercept of line

  • x (array-like) – x-values

  • y (array-like) – y-values

  • wx (array-like) – Weights for x-values (typically 1/sigma^2)

  • wy (array-like) – Weights for y-values (typically 1/sigma^2)

  • r (array-like) – Correlation coefficients of errors in x and y, must be between -1 and 1

Returns:

mswd – Reduced chi-squared statistic for residuals with respect to the line

Return type:

float

radage.radage.root_fun_76_86(r238_206, m, b)[source]

Root function for finding the lower intercept date in Tera-Wasserburg space :param r238_206: 238/206 ratio :type r238_206: float :param m: Slope of the line in Tera-Wasserburg space :type m: float :param b: Intercept of the line in Tera-Wasserburg space :type b: float

Returns:

r207_206_conc - r207_206_disc – Difference between the concordia and discordia ratios

Return type:

float

radage.radage.sk_pb(t, t0=4570.0, t1=3700.0, mu1=7.19, mu2=9.74, x0=9.307, y0=10.294)[source]

Common lead model from Stacey and Kramers (1975).

This model implements a two stage process for the evolution of common lead.

For times before \(t_1 = 3.7\) Ga, the following equations describe the temporal evolution of common lead:

\[\begin{split}\begin{align} \frac{^{206}\text{Pb}}{^{204}\text{Pb}}(t) &= \left(\frac{^{206}\text{Pb}}{^{204}\text{Pb}}\right)_0 + \mu_1\,\left(e^{\lambda_{238}t_0}-e^{\lambda_{238}t}\right) \\ \frac{^{207}\text{Pb}}{^{204}\text{Pb}}(t) &= \left(\frac{^{207}\text{Pb}}{^{204}\text{Pb}}\right)_0 + \frac{^{235}\text{U}}{^{238}\text{U}} \, \mu_1\, \left(e^{\lambda_{235}t_0}-e^{\lambda_{235}t}\right) \end{align}\end{split}\]

For times after \(t_1 = 3.7\) Ga, the following equations describe the temporal evolution of common lead:

\[\begin{split}\begin{align} \frac{^{206}\text{Pb}}{^{204}\text{Pb}}(t) &= \left(\frac{^{206}\text{Pb}}{^{204}\text{Pb}}\right)_1 + \mu_2\,\left(e^{\lambda_{238}t_1}-e^{\lambda_{238}t}\right) \\ \frac{^{207}\text{Pb}}{^{204}\text{Pb}}(t) &= \left(\frac{^{207}\text{Pb}}{^{204}\text{Pb}}\right)_1 + \frac{^{235}\text{U}}{^{238}\text{U}} \, \mu_2\, \left(e^{\lambda_{235}t_1}-e^{\lambda_{235}t}\right) \end{align}\end{split}\]

where \(\left(\frac{^{206}\text{Pb}}{^{204}\text{Pb}}\right)_1\) and \(\left(\frac{^{207}\text{Pb}}{^{204}\text{Pb}}\right)_1\) are the above equations evaluated at \(t=t_1\).

Parameters:
  • t (1d array like) – Time(s) (in Ma) for which to return isotopic ratios for the linear mixing model from concordia to mantle

  • t0 (float, optional) – Age of earth in Myr, by default 4570.

  • t1 (float, optional) – Age of transition between model stages, by default 3700.

  • mu1 (float, optional)

  • mu2 (float, optional)

  • x0 (float, optional) – 206Pb/204Pb ratio for troilite lead, by default 9.307.

  • y0 (float, optional) – 207Pb/204Pb ratio for troilite lead, by default 10.294.

Returns:

  • r206_204 (1d array) – 206/204 ratio(s) for the given time(s)

  • r207_204 (1d array) – 207/204 ratio(s) for the given time(s)

Examples

import radage
import numpy as np
import matplotlib.pyplot as plt
t = np.linspace(0, 4500, 50)
r206_204, r207_204 = radage.sk_pb(t)
plt.figure(figsize=(6, 4))
plt.plot(r206_204, r207_204, linewidth=4)
plt.grid()
plt.xlabel(r'${}^{206}\mathrm{Pb}/{}^{204}\mathrm{Pb}$')
plt.ylabel(r'${}^{207}\mathrm{Pb}/{}^{204}\mathrm{Pb}$')
plt.title('Stacey and Kramers (1975) Common Lead Model')
plt.show()

(Source code, png, hires.png, pdf)

../_images/radage-radage-2.png
radage.radage.t207(r207_206, u238u235=138.818)[source]

207/206 date

Parameters:
  • r207_206 (float or numpy.ndarray) – 207/206 ratio(s)

  • u238u235 (float, optional) – Ratio of U238 to U235, by default u238u235

Returns:

date – Date in Myr

Return type:

float

radage.radage.t235(r07_35)[source]

207/235 date

Parameters:

r07_35 (float or numpy.ndarray) – 207/235 ratio

Returns:

t – Date in Myr

Return type:

float

radage.radage.t238(r06_38)[source]

206/238 date

Parameters:

r06_38 (float or numpy.ndarray) – 206/238 ratio

Returns:

t – Date in Myr

Return type:

float

radage.radage.wc1_corr(wc1_UPbs)[source]

Correct 238/206 ratios of WC1 analyses to achieve lower intercept age of 254 Ma with fixed common Pb 207/206 ratio of 0.85.

Parameters:

wc1_UPbs (list) – List of UPb.radage objects for WC1 analyses

Returns:

factor – Factor by which to multiply 238/206 ratios to achieve lower intercept age of 254 Ma with fixed common Pb 207/206 ratio of 0.85.

Return type:

float

radage.radage.weighted_mean(ages, ages_s, sig_method='naive', standard_error=True)[source]

Weighted-mean age computation

Parameters:
Returns:

  • mu (float) – Weighted mean age

  • sig (float) – Standard deviation or error of weighted mean age, depending on standard_error value

  • mswd (float) – Reduced chi-squared statistic for residuals with respect to the weighted mean

radage.radage.yorkfit(x, y, wx, wy, r, thres=0.001)[source]

Implementation of York 1969 10.1016/S0012-821X(68)80059-7

Parameters:
  • x (array-like) – Mean x-values

  • y (array-like) – Mean y-values

  • wx (array-like) – Weights for x-values (typically 1/sigma^2)

  • wy (array-like) – Weights for y-values (typically 1/sigma^2)

  • r (array-like) – Correlation coefficients of errors in x and y, must be between -1 and 1

Returns:

  • b (float) – Maximum likelihood estimate for slope of line

  • a (float) – Maximum likelihood estimate for intercept of line

  • b_sig (float) – Standard deviation of slope for line

  • a_sig (float) – Standard deviation of intercept for line

  • mswd (float) – Reduced chi-squared statistic for residuals with respect to the maximum likelihood linear model

  • ab_cov (float) – Covariance of slope and intercept for line