pysoplot package

Submodules

pysoplot.cfg module

Package-wide settings and constants.

pysoplot.cfg.U = 137.818

Modern natural 238U/235U ratio. Default [HIESS2012].

pysoplot.cfg.axis_labels_kw = {'color': 'black', 'fontsize': 10}

Axis labels key-word arguments.

pysoplot.cfg.conc_age_ellipse_kw = {'alpha': 1.0, 'edgecolor': 'black', 'facecolor': 'white', 'linewidth': 0.5, 'zorder': 10}

Concordia age ellipse marker key-word arguments.

pysoplot.cfg.conc_env_kw = {'alpha': 1.0, 'edgecolor': 'none', 'facecolor': 'white', 'linestyle': '-', 'linewidth': 0.0, 'zorder': 8}

Concordia uncertainty envelope fill key-word arguments.

pysoplot.cfg.conc_env_line_kw = {'alpha': 1.0, 'color': 'black', 'linestyle': '--', 'linewidth': 1.0, 'zorder': 8}

Concordia envelope line key-word arguments.

pysoplot.cfg.conc_intercept_ellipse_kw = {'alpha': 0.6, 'edgecolor': 'black', 'facecolor': 'lightgrey', 'linewidth': 1.0, 'zorder': 30}

Concordia intercept ellipse key-word arguments.

pysoplot.cfg.conc_intercept_markers_kw = {'alpha': 0.5, 'linewidth': 0, 'marker': ',', 'markeredgecolor': 'none', 'markerfacecolor': 'black', 'markersize': 4, 'zorder': 30}

Concordia intercept markers key-word arguments.

pysoplot.cfg.conc_line_kw = {'alpha': 1.0, 'color': 'black', 'linestyle': '-', 'linewidth': 0.8, 'zorder': 9}

Concordia line key-word arguments.

pysoplot.cfg.conc_markers_kw = {'alpha': 1.0, 'linewidth': 0, 'marker': 'o', 'markeredgecolor': 'black', 'markerfacecolor': 'white', 'markersize': 4, 'zorder': 10}

Concordia age markers key-word arguments.

pysoplot.cfg.conc_text_kw = {'annotation_clip': False, 'clip_on': True, 'color': 'black', 'fontsize': 8, 'horizontalalignment': 'left', 'textcoords': 'offset points', 'verticalalignment': 'center', 'xytext': (3, 3), 'zorder': 11}

Concordia marker labels key-word arguments. Caution: Be careful changing the annotation_clip and clip_on settings.

pysoplot.cfg.dp_ellipse_kw = {'alpha': 1.0, 'edgecolor': 'black', 'facecolor': 'white', 'linewidth': 0.8, 'zorder': 40}

Data point confidence ellipse key-word arguments.

pysoplot.cfg.dp_label_kw = {'color': 'black', 'fontsize': 8, 'horizontalalignment': 'center', 'textcoords': 'offset points', 'verticalalignment': 'center', 'xytext': (10, 0), 'zorder': 40}

Data point confidence ellipse key-word arguments.

pysoplot.cfg.fig_kw = {'dpi': 300, 'facecolor': 'white', 'figsize': (4.72, 4.012), 'tight_layout': True}

Figure key-word arguments.

pysoplot.cfg.gridlines_kw = {'alpha': 1.0, 'color': 'black', 'linestyle': ':', 'linewidth': 0.5}

Figure gridline key-word arguments.

pysoplot.cfg.h = 1.4

Spine h value (see [Powell2020]).

Type

float

pysoplot.cfg.hist_bars_kw = {'alpha': 0.75, 'edgecolor': 'red', 'facecolor': 'green', 'histtype': 'step', 'linewidth': 0.75}

Histogram bar key-word arguments.

pysoplot.cfg.hist_fig_kw = {'dpi': 300, 'facecolor': 'white', 'figsize': (4.72, 4.012), 'tight_layout': True}

Histogram figure key-word arguments.

pysoplot.cfg.lam226 = 433.2169878499658

226Ra decay constant [Ma^-1]

pysoplot.cfg.lam230 = 9.170554357535263

230Th decay constant [Ma^-1]. Default [CHENG2013].

pysoplot.cfg.lam231 = 21.15511004303205

231Pa decay constant [Ma^-1]. Default [ROBERT1969].

pysoplot.cfg.lam232 = 4.947517348750502e-05

232Th decay constant [Ma^-1] (default [HOLDEN1990])

pysoplot.cfg.lam234 = 2.822030700105632

234U decay constant [Ma^-1]. Default [CHENG2013].

pysoplot.cfg.lam235 = 0.000984849860843

235U decay constant [Ma^-1]. Default [JAFFEY1971].

pysoplot.cfg.lam238 = 0.000155125479614

238U decay constant [Ma^-1]. Default [JAFFEY1971].

pysoplot.cfg.major_ticks_kw = {'color': 'black', 'direction': 'in', 'length': 4, 'width': 0.5, 'zorder': 100}

Major axis tick key-word arguments.

pysoplot.cfg.minor_ticks_kw = {'color': 'black', 'direction': 'in', 'length': 2, 'width': 0.5, 'zorder': 100}

Minor axis tick key-word arguments.

pysoplot.cfg.mswd_ci_thresholds = [0.85, 0.95]

MSWD one-sided confidence interval thresholds for classical regression fits. First element is the model 1 –> 1x threshold, second element is the model 1x –> 2/3 threshold.

pysoplot.cfg.mswd_wav_ci_thresholds = [0.85, 0.95]

MSWD one-sided confidence interval thresholds for classical wtd. averages. First element is analytical –> analytical + observed scatter threshold. Second element is not yet used. Equivalent Isoplot default for first element is 0.70.

pysoplot.cfg.pb76_line_kw = {'alpha': 0.5, 'color': 'red', 'linestyle': '--', 'linewidth': 1.0, 'zorder': 10}

Common 207Pb/206Pb projection line key-word arguments.

pysoplot.cfg.renv_kw = {'alpha': 0.3, 'edgecolor': 'none', 'facecolor': 'none', 'linewidth': 0.0, 'zorder': 20}

Regression envelope key-word arguments.

pysoplot.cfg.renv_line_kw = {'alpha': 1.0, 'color': 'red', 'linestyle': '--', 'linewidth': 0.8, 'zorder': 20}

Regression envelope line key-word arguments.

pysoplot.cfg.rline_kw = {'alpha': 1.0, 'color': 'red', 'linestyle': '-', 'linewidth': 0.75, 'zorder': 21}

Regression line key-word arguments.

pysoplot.cfg.rng = Generator(PCG64) at 0x1124492A0

Random number generator used across all modules. Allows for reproducible Monte Carlo simulations results.

Type

numpy.Generator

pysoplot.cfg.s226 = 1.8953243218436007

226Ra decay constant 1 sigma uncertainty [Ma^-1]

pysoplot.cfg.s230 = 0.006673111897550267

230Th decay constant 1 sigma uncertainty [Ma^-1]. Default [CHENG2013].

pysoplot.cfg.s231 = 0.07102280191465059

231Pa decay constant 1 sigma uncertainty [Ma^-1]. Default [ROBERT1969].

pysoplot.cfg.s232 = 3.531422306388949e-07

232Th decay constant 1 sigma uncertainty [Ma^-1]. Default [HOLDEN1990].

pysoplot.cfg.s234 = 0.001493624261109568

234U decay constant 1 sigma uncertainty [Ma^-1]. Default [CHENG2013].

pysoplot.cfg.s235 = 6.716698160081028e-07

235U decay constant 1 sigma uncertainty [Ma^-1]. Default [JAFFEY1971].

pysoplot.cfg.s238 = 8.332053601458737e-08

238U decay constant 1 sigma uncertainty [Ma^-1]. Default [JAFFEY1971].

pysoplot.cfg.sU = 0.0225

Modern natural 238U/235U ratio 1 sigma uncertainty. Default [HIESS2012].

pysoplot.cfg.scatter_markers_kw = {'alpha': 0.3, 'linewidth': 0, 'marker': ',', 'markeredgecolor': 'none', 'markerfacecolor': 'black', 'markersize': 4, 'zorder': 1}

Scatter plot marker key-word arguments.

pysoplot.cfg.spine_kw = {'color': 'red', 'linewidth': 0.8, 'zorder': 100}

Figure axis spine key-word arguments. Spines are the axis lines.

pysoplot.cfg.subplot_kw = {'facecolor': 'white'}

subplot_kw passed to matplotlib.pyplot.subplots().

pysoplot.cfg.wav_env_kw = {'alpha': 0.8, 'edgecolor': 'none', 'facecolor': 'lightgrey', 'linestyle': '-', 'linewidth': 0.0, 'zorder': 19}

Weighted average envelope key-word arguments.

pysoplot.cfg.wav_fig_kw = {'dpi': 300, 'facecolor': 'white', 'figsize': (4.72, 4.012), 'tight_layout': True}

Weighted average figure key-word arguments.

pysoplot.cfg.wav_line_kw = {'alpha': 1.0, 'color': 'black', 'linestyle': '-', 'linewidth': 1.0, 'zorder': 20}

Weighted average line key-word arguments.

pysoplot.cfg.wav_markers_kw = {'alpha': 1.0, 'color': 'white', 'edgecolor': 'blue', 'linewidth': 1.0, 'zorder': 41}

Weighted average data point marker key-word arguments.

pysoplot.cfg.wav_markers_rand_kw = {'alpha': 1.0, 'color': 'blue', 'edgecolor': 'blue', 'linewidth': 1.0, 'zorder': 40}

Weighted average random only uncertainty data point marker key-word arguments.

pysoplot.concordia module

Concordia plotting routines for (dis)equilibrium U-Pb datasets.

pysoplot.concordia.age_ellipse_limits(ax, t0, dt, t_bounds, A, sA, init, p=0.998, trials=1000, diagram='tw', maxiter=40, negative_ratios=True)

Find concordia age ellipse limits near axis window boundaries. Will return age bound if it is inside the axis window.

Parameters
  • t0 (array-like) – Guess at limits (points must be inside plot window).

  • dt (float) – appropriate step size

pysoplot.concordia.age_ellipse_marker_spacing(ax, t, dt, A, sA, init, t_bounds, diagram='tw', maxiter=30, trials=1000)

Starting with regular concordia age marker spacing and limits, check if these are also suitable for disequilibrium age ellipses.

pysoplot.concordia.age_limits(ax, diagram, eq=True, A=None, init=(True, True), t_bounds=[0.01, 4600], max_tries=3)

Find concordia age limits at axis window boundaries. Will return age bound if it is inside the axis window.

pysoplot.concordia.age_marker_spacing(ax, t1, t2, diagram, A=None, init=None, eq=True, max_markers=12)

Estimate reasonable concordia age marker spacing given upper and lower age marker limits.

pysoplot.concordia.conc_age_ellipse(t, diagram)

Age ellipse params for displaying effects of decay constant errors on equilibrium concordia age markers. Requires computing uncertainty in x and y for a given t value using first-order error propagation.

pysoplot.concordia.conc_age_x(x, diagram)

Age of point on concordia at given x value.

pysoplot.concordia.conc_envelope(x, diagram)

Uncertainty in y for a given x value along the concordia to display the effects of decay constant errors on trajectory of the concordia curve. Requires computing uncertainty in y for a given x value using first-order error propagation.

pysoplot.concordia.conc_slope(t, diagram)

Compute tangent to concordia at given t. I.e. dy/dx for given t.

pysoplot.concordia.conc_xy(t, diagram)

Return x, y for given t along (equilibrium) concordia curve.

pysoplot.concordia.diseq_age_ellipse(t, A, sA, init, diagram, pA=None, trials=1000, negative_ratios=True)

Plot disequilibrium concordia marker as an “age ellipse” which provides a visual representation of uncertainty in x-y for given t value arising from uncertainties in activity ratio values.

pysoplot.concordia.diseq_dxdt(t, A, init, diagram)

Return x given t along disequilibrium concordia curve. Used e.g. to compute dx/dt

pysoplot.concordia.diseq_equi_points(t1, t2, xlim, ylim, A, init, diagram, ngp=500000, n=500)

Return ages that give equally spaced x, y points along disequilbrium concordia between upper and lower age limits.

pysoplot.concordia.diseq_slope(t, A, init, diagram)

Compute tangent to concordia at given t. I.e. dy/dx for given t.

pysoplot.concordia.diseq_velocity(t, xlim, ylim, A, init, diagram)

Estimate dr/dt, which is “velocity” along a diseq concordia curve in x-y space. Uses axis coordinates to circumvent scaling issues.

pysoplot.concordia.diseq_xy(t, A, init, diagram)

Return x, y for given t along disequilibrium concordia curve.

pysoplot.concordia.equi_points(t1, t2, xlim, ylim, diagram, ngp=500000, n=500)

Uses numerical method to obtain age points that are approximately evenly spaced in x, y along equilibrium U-Pb concordia between age limits t1 and t2.

pysoplot.concordia.estimate_marker_spacing(tspan)

Get initial estimate of good concordia marker spacing.

pysoplot.concordia.get_age_markers(ax, t1, t2, t_bounds, diagram, eq=True, ell=False, A=None, sA=None, init=None, marker_ages=(), age_prefix='Ma', auto=True, n_segments=1, negative_ratios=True)

Add concordia markers to concordia line and generate label text (but does not actually add marker labels).

Parameters
  • t1 (float) – lower concordia age in plot,

  • t2 (float) – upper concordia age

  • ell (bool) – plot age ellipses

pysoplot.concordia.individualised_labels(ax, markers_dict, diagram, eq=True, A=None, init=None, remove_overlaps=True)

Plot concordia age labels using individualised position and rotation.

Notes

This routine doesn’t currently work well for disequilibrium concordia curves that curve back around.

pysoplot.concordia.labels(ax, markers)

Add labels to concordia age markers. Uses the same offset and rotation for each marker.

Parameters

markers (dict) – age marker properties

pysoplot.concordia.mc_diseq_envelope(ax, t_limits, t_bounds, A, sA, diagram='tw', init=(True, True), trials=1000, limit_trials=1000, spaghetti=False, maxiter=50, negative_ratios=True, pA=None)

Plot uncertainty envelope about disequilibrium concordia based on Monte Carlo simulation. This displays uncertainty in trajectory of concordia arising from uncertainty in activity ratio values.

Parameters
  • t_limits (array-like) – minimum and maximum concordia ages for given axis window

  • t_bounds – minimum and maximum age bounds for full concordia curve

pysoplot.concordia.plot_age_markers(ax, markers, p=0.95)

Add age markers to plot.

Parameters

markers (dict) – age marker properties, typically returned from calling get_age_markers

pysoplot.concordia.plot_concordia(ax, diagram, plot_markers=True, env=False, age_ellipses=False, marker_max=None, marker_ages=(), auto_markers=True, remove_overlaps=True, age_prefix='Ma')

Plot equilibrium U-Pb concordia curve on concordia diagram.

Parameters
  • ax (matplotlib.pyplot.Axes) – Axes object to plot concordia curve in.

  • diagram ({'tw', 'wc'}) – Concordia diagram type.

  • marker_max (float, optional) – User specified age marker max (Ma).

Raises

UserWarning – if concordia lies entirely outside the axis limits.:

pysoplot.concordia.plot_diseq_concordia(ax, A, init, diagram, sA=None, age_ellipses=False, plot_markers=True, marker_max=None, env=False, env_method='mc', marker_ages=(), auto_markers=True, spaghetti=False, pA=None, remove_overlaps=True, env_trials=1000, negative_ratios=True, age_prefix='Ma')

Plot disequilibrium U-Pb concordia curve on concordia diagram.

Parameters
  • ax (matplotlib.pyplot.Axes) – Axes object to plot concordia curve in.

  • A (array-like) – one-dimensional array of activity ratio values arranged as follows - [234U/238U], [230Th/238U], [226Ra/238U], [231Pa/235U]

  • init (array-like) – two-element list of boolean values, the first is True if [234U/238U] is an initial value and False if a present-day value, the second is True if [230Th/238U] is an initial value and False if a present-day value

  • sA (array-like, optional) – one-dimensional array of activity ratio value uncertainties given as 1 sigma absolute and arranged in the same order as A

  • diagram ({'tw', 'wc'}) – Concordia diagram type.

  • marker_max (float, optional) – User specified age marker max (Ma).

  • spaghetti (bool) – plot each simulated line using arbitrary colours

Raises

UserWarning – if concordia lies entirely outside the axis limits.:

pysoplot.concordia.plot_envelope(ax, diagram, npts=100)

Plot concordia uncertainty envelope which displays effect of decay constant errors.

pysoplot.concordia.refine_t_limit(limits0, t_bounds, xlim, ylim, increasing_t, diagram='tw', eq=True, A=None, sA=None, init=(True, True), ell=False, trials=1000, ax=None)

Refine concordia age limits so they lie just outside axis window. Will return age bound if it is inside the axis window.

Parameters
  • tmin (float) – lowder t-bound

  • tmax (float) – upper t-bound

pysoplot.concordia.remove_overlapping_labels(an)

Naive routine for removing overlapping concordia labels older than first overlap point.

anarray-like

list of concordia age marker / ellipse label annotations

pysoplot.concordia.segment_2_markers(t_bounds, markers)

Function for adding markers to the second concordia segment (uses spacing etc. from first segement).

pysoplot.concordia.t_limits_from_cp(t, inside, tmin, tmax, eq=True)

Get estimated concordia age bounds from arbitrary age points within the plot window.

pysoplot.concordia.velocity(t, xlim, ylim, diagram)

Estimate dr/dt, which is “velocity” along an equilibrium concordia curve in x-y space. Uses axis coordinates to circumvent scaling issues.

pysoplot.concordia.walk_ellipse_outward(t0, dt, t_bounds, xlim, ylim, diagram, xtol, ytol, trials, A=None, init=None, pA=None, ttol=0.001, max_steps=100, p=0.999, ax=None)

Walk outward from t0 until an axis boundary is found (i.e. ellipse is pretty much outside axis window, where ‘pretty-muchness’ is determined by p).

pysoplot.concordia.walk_outward(t0, dt, t_bounds, xlim, ylim, diagram, xtol, ytol, eq=True, A=None, init=(True, True), ttol=0.001, max_steps=1000, ell=False, pA=None)

Walk outward from t0 until an axis boundary is found.

pysoplot.corrected module

pysoplot.data module

Test data sets.

pysoplot.data.KAMO1996 = {'tw': [[25.094102886, 0.200752823, 0.05131, 0.156], [25.125628141, 0.201005025, 0.051284216, 0.623], [25.138260432, 0.502765209, 0.05131, 0.312], [25.150905433, 0.251509054, 0.05129, 0.351], [25.176233635, 0.201409869, 0.05139, 0.234], [25.182573659, 0.503651473, 0.05134, 0.273], [25.207965717, 0.201663726, 0.05143, 0.428], [25.214321735, 0.302571861, 0.05139, 0.272], [25.163563161, 0.201308505, 0.0514, 0.233], [27.723870252, 0.277238703, 0.05135, 0.156]], 'wc': [[0.28192371858, 0.25418731559, 0.03985, 0.200752823087, 0.789783009514], [0.281428494984, 0.65490496998, 0.0398, 0.201005025126, 0.306922430489], [0.281428494984, 0.59161713696, 0.03978, 0.502765208648, 0.849815154496], [0.281177360352, 0.431763385404, 0.03976, 0.251509054326, 0.582515940045], [0.281442145104, 0.308370132215, 0.03972, 0.201409869084, 0.653143245868], [0.281097527832, 0.572735240723, 0.03971, 0.503651473181, 0.879379226857], [0.281306650428, 0.472918512578, 0.03967, 0.201663725737, 0.426423834919], [0.281017005912, 0.407143650097, 0.03966, 0.302571860817, 0.743157509014], [0.28163865168, 0.308269529828, 0.03974, 0.201308505284, 0.653027580756], [0.25538057766, 0.318014049572, 0.03607, 0.277238702523, 0.871781303046]]}

0708-LA speleothm LA-ICPMS Woodhead, J., Petrus, J., 2019. Exploring the advantages and limitations of in situ U–Pb carbonate geochronology using speleothems. Geochronology 1, 69–84. https://doi.org/10.5194/gchron-1-69-2019

Tera-Wasserburg data (errors 2s, abs.)

pysoplot.data.LA0708 = [[73.21, 2.25, 0.753, 0.015, -0.068], [260.42, 8.14, 0.435, 0.02, 0.189], [169.2, 4.87, 0.577, 0.02, 0.456], [79.18, 1.82, 0.751, 0.02, 0.196], [212.77, 5.89, 0.473, 0.017, 0.375], [154.56, 3.58, 0.615, 0.021, 0.226], [217.39, 5.67, 0.474, 0.019, 0.279], [209.64, 9.67, 0.484, 0.022, 0.11], [144.09, 4.98, 0.647, 0.021, 0.102], [174.22, 3.95, 0.584, 0.018, 0.214], [224.22, 6.54, 0.477, 0.024, 0.265], [236.41, 6.71, 0.461, 0.023, 0.147], [161.55, 5.74, 0.628, 0.022, -0.041], [265.25, 11.26, 0.385, 0.023, -0.043], [152.44, 4.65, 0.608, 0.019, 0.02], [151.75, 4.61, 0.626, 0.021, 0.003], [101.11, 2.35, 0.727, 0.017, 0.038], [265.18, 6.82, 0.427, 0.019, 0.07], [286.78, 6.33, 0.391, 0.017, 0.241], [287.6, 7.11, 0.365, 0.016, -0.041], [264.69, 5.67, 0.419, 0.016, 0.159], [274.57, 5.35, 0.378, 0.016, 0.177], [212.31, 8.56, 0.501, 0.026, 0.341], [161.29, 3.38, 0.591, 0.018, 0.144], [140.65, 3.17, 0.633, 0.021, 0.188], [183.15, 4.36, 0.557, 0.021, 0.494], [218.82, 4.79, 0.53, 0.024, 0.217], [312.5, 10.74, 0.334, 0.02, -0.081], [227.79, 4.41, 0.49, 0.021, 0.073], [212.77, 5.43, 0.507, 0.022, 0.255], [139.28, 4.07, 0.652, 0.02, 0.449], [179.53, 4.51, 0.556, 0.021, 0.243], [224.22, 5.03, 0.48, 0.017, 0.112], [219.78, 7.25, 0.519, 0.023, 0.313], [165.02, 5.72, 0.59, 0.023, 0.036], [145.77, 4.67, 0.61, 0.021, 0.099], [239.81, 8.05, 0.442, 0.019, -0.105], [187.27, 5.61, 0.538, 0.025, 0.119], [255.23, 5.28, 0.443, 0.017, 0.026], [141.44, 8.2, 0.616, 0.022, -0.155], [115.34, 2.0, 0.707, 0.02, 0.151], [117.51, 2.35, 0.68, 0.016, 0.339], [73.64, 1.25, 0.757, 0.013, 0.579], [160.26, 4.62, 0.605, 0.024, 0.164], [149.7, 3.14, 0.619, 0.018, 0.246], [245.28, 5.17, 0.452, 0.016, 0.337], [251.26, 8.21, 0.435, 0.028, 0.359], [130.21, 4.24, 0.666, 0.022, 0.184], [276.24, 8.39, 0.419, 0.02, 0.167], [298.51, 9.8, 0.359, 0.021, -0.091], [381.68, 12.82, 0.241, 0.026, 0.007]]

Young carbonate 238U-206Pb and 235U-207Pb isochron Richards, D.A., Bottrell, S.H., Cliff, R.A., Ströhle, K., Rowe, P.J., 1998. U-Pb dating of a speleothem of Quaternary age. Geochimica et Cosmochimica Acta 62, 3683–3688. https://doi.org/10.1016/S0016-7037(98)00256-7

Note: results are not directly comparable to publication, because data point uncertainty correlations are assumed equal to 0 here but we can see from figs in the article that this is not a great assumption.

235U/204Pb ratios are computed from 238U/204Pb ratios assuming 238U/235U = 137.88.

Isochron dataset DP errors: 2s, abs. Activity ratio errors: 1s, abs.

pysoplot.data.WHC1 = {'A': [1.155, 0.0, 0.0], 'init': [False, True], 'iso57-4': [[11.45923992, 0.652741514, 15.25, 0.18], [111.6913258, 2.901073397, 15.43, 0.92], [5.076878445, 1.378009864, 15.15, 0.25], [8275.311865, 1573.832318, 17.22, 1.0], [1624.601102, 65.27415144, 15.81, 0.25], [1037.133739, 43.51610096, 15.55, 0.45], [1436.031332, 79.77951842, 15.79, 0.56], [3996.228605, 514.940528, 16.24, 0.67]], 'iso68-4': [[1580.0, 90.0, 17.58, 0.15], [15400.0, 400.0, 17.85, 0.44], [700.0, 190.0, 17.08, 0.09], [1141000, 217000, 49.77, 6.1], [224000.0, 9000.0, 23.98, 0.25], [143000.0, 6000.0, 21.25, 0.25], [198000.0, 11000.0, 23.26, 0.43], [551000.0, 71000.0, 32.58, 1.95]], 'sA': [0.0145, 0.0, 0.0]}

Charm particle data Lyons, L., Gibaut, D., Clifford, P., 1988. How to combine correlated estimates of a single physical quantity. Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment 270, 110–117. https://doi.org/10.1016/0168-9002(88)90018-6

For testing wtd. average functions with correlated uncertainties.

pysoplot.dqmc module

pysoplot.dqpb module

Functions and routines for computing disequilibrium U-Pb ages.

pysoplot.dqpb.concint(a, b, A, init, t0)

Numercially compute disequilibrium U-Pb concordia-intercept age.

pysoplot.dqpb.concint_age(fit, A, sA, init, t0, diagram='tw', dc_errors=False, trials=50000, u_errors=False, negative_ratios=True, negative_ages=True, intercept_plot=True, hist=(False, False), conc_kw=None, intercept_plot_kw=None, A48i_lim=(0.0, 20.0), A08i_lim=(0.0, 10.0), age_lim=(0.0, 20.0), uncert='mc')

Compute disequilibrium U-Pb concordia intercept age and age uncertainties using Monte Carlo simulation. Optionally, produce a plot of the concordia intercept.

Notes

Only accepts data in 2-D Tera-Wasserburg form at present.

Parameters
  • fit (dict) – Linear regression fit parameters.

  • A (array-like) – One-dimensional array of activity ratio values arranged as follows - [234U/238U], [230Th/238U], [226Ra/238U], [231Pa/235U].

  • sA (array-like) – One-dimensional array of activity ratio value uncertainties given as 1 sigma absolute and arranged in the same order as A.

  • init (array-like) – Two-element list of boolean values, the first is True if [234U/238U] is an initial value and False if a present-day value, the second is True if [230Th/238U] is an initial value and False if a present-day value.

  • t0 (float) – Initial guess for numerical age solving (the equilibrium age is typically good enough).

  • uncert ({'mc', 'none'}) – Method of computing age uncertainties.

  • diagram ({'tw'}) – Concordia diagram type. Currently only accepts ‘tw’, i.e. Tera-Waserburg.

pysoplot.dqpb.concint_multiple(a, b, A, init, t0, age_lim=(0.0, 20.0), t_step=1e-05, A48i_lim=(0.0, 20.0), A08i_lim=(0.0, 20.0))

Search for all initial disequilibrium concordia-intercept age solutions within specified age and initial activity ratio limits.

If both [234U/238U] and [230Th/238U] are inputted as present-day values, it is possible for the concordia curve to curve around leading to two concordia intercepts in close age proximity. Typically, where this is the case, it seems the upper intercept will have a physically implausible initial activity ratio solution, so lower intercept is chosen.

pysoplot.dqpb.concordant_A48i(t75, b86, a230_238, a226_238, Lam238, coef238, a0=1.0)

Numerically compute initial U234/U238 activity ratio that forces concordance between 238U and 235U isochron ages.

Minimises function: f = F(t75, A234A238) - slope_86, where t75 is the 207Pb/x-235U/x isochron age.

pysoplot.dqpb.cor207(x, y, A, alpha, t0, init=(True, True))

Numerically compute disequilibrium 207Pb-corrected ages.

References

Ludwig, K.R., 1977. Effect of initial radioactive-daughter disequilibrium on U-Pb isotope apparent ages of young minerals. Journal of Research of the US Geological Survey 5, 663–667.

pysoplot.dqpb.find_roots(f, df, args, range=(0.0, 20.0), step=1e-05, rtol=1e-09)

Use brute force method to find all roots within given age range. Not guaranteed to work if two roots are close together, so use small step size.

pysoplot.dqpb.forced_concordance(fit57, fit86, A, sA, t0=1.0, norm_isotope='204Pb', negative_ratios=True, negative_ages=True, hist=(False, False), trials=50000)

Compute “forced concordance” [234U/238U] value following the approach of Engel et al. (2019).

Parameters
  • fit57 (dict) – 207Pb isochron linear regression fit

  • fit86 (dict) – 206Pb isochron linear regression fit

  • A (array-like) – one-dimensional array of activity ratio values arranged as follows - np.nan, [230Th/238U], [226Ra/238U], [231Pa/235U]

  • sA (array-like) – one-dimensional array of activity ratio value uncertainties given as 1 sigma absolute and arranged in the same order as A

References

Engel, J., Woodhead, J., Hellstrom, J., Maas, R., Drysdale, R., Ford, D., 2019. Corrections for initial isotopic disequilibrium in the speleothem U-Pb dating method. Quaternary Geochronology 54, 101009. https://doi.org/10.1016/j.quageo.2019.101009

pysoplot.dqpb.isochron(b, A, t0, age_type, init=(True, True))

Numerically compute disequilbrium U-Pb isohcron age.

pysoplot.dqpb.isochron_age(fit, A, sA, t0, init=(True, True), age_type='iso-206Pb', norm_isotope='204Pb', hist=(False, False), trials=50000, dc_errors=False, negative_ratios=True, negative_ages=True)

Compute disequilibrium 238U-206Pb or 235U-207Pb isochron age and Monte Carlo age uncertainties.

Parameters
  • fit (dict) – linear regression fit parameters

  • A (array-like) – one-dimensional array of activity ratio values arranged as follows - [234U/238U], [230Th/238U], [226Ra/238U], [231Pa/235U]

  • sA (array-like) – one-dimensional array of activity ratio value uncertainties given as 1 sigma absolute and arranged in the same order as A

  • init (array-like) – two-element list of boolean values, the first is True if [234U/238U] is an initial value and False if a present-day value, the second is True if [230Th/238U] is an initial value and False if a present-day value

  • t0 (float) – initial guess for numerical age solving (the equilibrium age is typically good enough)

  • age_type ({'iso-206Pb', 'iso-207Pb'}) – Isochron age type.

pysoplot.dqpb.pbu(x, A, t0, age_type, alpha=None, init=(True, True))

Numerically compute single analysis Pb/U age using Ludwig equations.

pysoplot.dqpb.pbu_age(x, Vx, t0, DThU=None, DThU_1s=None, DPaU=None, DPaU_1s=None, alpha=None, alpha_1s=None, age_type='206Pb*', uncert='analytical', rand=False, wav=False, wav_opts=None, mc_opts=None)

Compute disequilibrium radiogenic 206Pb*/238U, 207Pb*/235U ages, or 207Pb-corrected age assuming a constant ratio of minerl-melt partition coefficients, and optionally compute a weighted average age.

Parameters
  • x (ndarray (1-D, 2-D)) – Either a 1 x n array of measured 206Pb*/238U for each aliquot (for 206Pb* age), or 2 x n array of measured 238U/206Pb and 207Pb/206Pb (for 207Pb-corrected age).

  • Vx (ndarray (2-D)) – Covariance matrix of uncertainties on measured isotope ratios. This should be an n x n array for 206Pb* and 207Pb* ages, or a 2n x 2n array for 207Pb-corrected ages.

  • DThU (float, optional) – Ratio of mineral-melt distribution coefficients, DTh/DU.

  • DThU_1s (float, optional) – Uncertainty on ratio of mineral-melt distribution coefficients, DTh/DU.

  • DPaU (float, optional) – Ratio of mineral-melt distribution coefficients, DPu/DU.

  • DPaU_1s (float, optional) – Uncertainty on ratio of mineral-melt distribution coefficients, DPu/DU.

  • alpha (float, optional) – Common 207Pb/206Pb ratio.

  • alpha_1s (float, optional) – Uncertainty on common 207Pb/206Pb ratio.

  • t0 (ndarray or float, optional) – Age guess(es).

  • uncert ({'mc', 'analytical'}, optional) – Method of propagating age uncertainties.

  • rand (bool) – If true, compute random only uncertainties as well as total uncertainties (e.g., for plotting error bars).

  • mc_opts (dict) – Monte Carlo simulation options.

  • wav_opts (dict) – Weighted average calculation and plotting options.

Returns

results – Age and uncertainty results.

Return type

dict

pysoplot.dqpb.pbu_iterative(x, ThU_melt, t0, y=None, Th232_U238=None, Pb208_206=None, D_PaU=None, alpha=None, age_type='206Pb*', maxiter=50, tol=1e-08)

Compute disequilibrium 206Pb*/U238 or 207Pb-corrected ages iteratively. Either (232Th/238U)i is inferred from measured 232Th/238U, or from radiogenic 208Pb/206Pb and age.

Parameters
  • x (ndarray (1-D, 2-D)) – Either measured 206Pb*/238U for each aliquot (for 206Pb* age), or measured 238U/206Pb and 207Pb/206Pb (for 207Pb-corrected age).

  • ThU_melt (ndarray (1-D)) – Th/U ratio of the melt.

  • Th232_U238 (ndarray (1-D)) – Measured 232Th/238U for each aliquot.

  • Pb208_206 (ndarray (1-D)) – Measured radiogenic 208Pb/206Pb for each aliquot.

  • D_PaU (float, optional) – Ratio of mineral-melt distribution coefficients, DPu/DU.

  • alpha (float) – Common 207Pb/206Pb ratio.

  • t0 (float, optional) – Age guess.

Raises

exceptions.ConvergenceError – If no convergent age solution is found.

pysoplot.dqpb.pbu_iterative_age(x, Vx, ThU_melt, ThU_melt_1s, t0, Pb208_206=None, V_Pb208_206=None, Th232_U238=None, V_Th232_U238=None, DPaU=None, DPaU_1s=None, alpha=None, alpha_1s=None, age_type='206Pb*', uncert='analytical', rand=False, wav=False, wav_opts=None, mc_opts=None)

Compute disequilibrium 206Pb*/U238 or 207Pb-corrected ages iteratively along with age uncertainties. Either initial Th/U_min can be inferred from measured 232Th/238U, or from radiogenic 208Pb/206Pb and age.

Parameters
  • x (ndarray (1-D, 2-D)) – Either a 1 x n array of measured 206Pb*/238U for each aliquot (for 206Pb* age), or 2 x n array of measured 238U/206Pb and 207Pb/206Pb (for 207Pb-corrected age).

  • Vx (ndarray (2-D)) – Covariance matrix of uncertainties on measured isotope ratios. This should be an n x n array for 206Pb* and 207Pb* ages, or a 2n x 2n array for 207Pb-corrected ages.

  • ThU_melt (float) – Th/U ratio of the melt.

  • ThU_melt_1s (float) – Uncertainty on Th/U ratio of the melt (1 sigma).

  • Th232_U238 (ndarray (1-D), optional) – Measured 232Th/238U for each aliquot.

  • V_Th232_U238 (ndarray (2-D), optional) – Covariance matrix of uncertainties on measured 232Th/238U.

  • Pb208_206 (ndarray (1-D)) – Measured radiogenic 208Pb/206Pb for each aliquot.

  • V_Pb208_206 (ndarray (2-D):) – Covariance matrix of uncertainties on radiogenic 208Pb/206Pb values.

  • DPaU (float, optional) – Ratio of mineral-melt distribution coefficients, DPu/DU.

  • DPaU_1s (float, optional) – Uncertainty on ratio of mineral-melt distribution coefficients, DPu/DU.

  • alpha (float, optional) – Common 207Pb/206Pb ratio.

  • alpha_1s (float, optional) – Uncertainty on common 207Pb/206Pb ratio.

  • t0 (ndarray or float, optional) – Age guess(es).

  • uncert ({'mc', 'analytical'}, optional) – Method of propagating age uncertainties.

  • rand (bool) – If true, compute random only uncertainties as well as total uncertainties (e.g., for plotting error bars).

  • mc_opts (dict) – Monte Carlo simulation options.

  • wav_opts (dict) – Weighted average calculation and plotting options.

Returns

results – Age and uncertainty results.

Return type

dict

pysoplot.dqpb.pbu_iterative_uncert(t, ThU_min, x, Vx, ThU_melt, ThU_melt_1s, Th232_U238=None, V_Th232_U238=None, Pb208_206=None, V_Pb208_206=None, alpha=None, alpha_1s=None, age_type='206Pb*')

Compute uncertainties for a suite of co-genetic disequilibrium 206Pb*/238U, 207Pb*/235U or 207Pb-corrected ages using analytical error propagation. ThU_min is either computed from measured 232Th/238U, or computed numerically from radiogenic 208Pb/206Pb and age.

Parameters
  • t (ndarray (1-D)) – Ages.

  • ThU_min (ndarray (1-D)) – (Th/U)_min. solutions.

  • x (ndarray (1-D, 2-D)) – Measured isotope ratios. This should be a 1-D array for 206Pb* and 207Pb* ages, or a 2 x n array for 207Pb-corrected ages.

  • Vx (ndarray (2-D)) – Covariance matrix of uncertainties on measured isotope ratios. This should be an n x n array for 206Pb* and 207Pb* ages, or a 2n x 2n array for 207Pb-corrected ages.

  • ThU_melt (float) – Th/U ratio of the melt.

  • ThU_melt_1s (float) – Uncertainty (1 sigma) on Th/U ratio of the melt.

  • Pb208_206 (ndarray (1-D), optional) – Radiogenic 208Pb/206Pb ratios.

  • V_Pb208_206 (ndarray (2-D), optional) – Covariance matrix for radiogenic 208Pb/206Pb ratios.

  • Th232_U238 (ndarray, optional) – Measured 232Th/238U ratio.

  • V_Th232_U238 (ndarray, optional) – Covariance matrix for measured 232Th/238U ratios.

  • alpha (float, optional) – Common 207Pb/206Pb ratio.

  • alpha_1s (float, optional) – Uncertainty (1 sigma) on common 207Pb/206Pb ratio.

  • age_type ({'206Pb*', '207Pb*', 'cor207Pb'}) – Age type to calculate uncertainties for.

Returns

Vt – Covariance matrix of ages.

Return type

ndarray (2-D)

pysoplot.dqpb.pbu_uncert(t, x, Vx, a230_238=None, a231_235=None, V_a230_238=None, V_a231_235=None, alpha=None, alpha_1s=None, age_type='206Pb*')

Compute uncertainties for a suite of disequilibrium 206Pb*/238U, 207Pb*/235U or 207Pb-corrected ages using analytical error propagation.

Parameters
  • x (ndarray (1-D, 2-D)) – Measured isotope ratios. This should be a 1-D array for 206Pb* and 207Pb* ages, or a 2 x n array for 207Pb-corrected ages.

  • Vx (ndarray (2-D)) – Covariance matrix of uncertainties on measured isotope ratios. This should be an n x n array for 206Pb* and 207Pb* ages, or a 2n x 2n array for 207Pb-corrected ages.

  • a230_238 (ndarray (1-D), optional) – Initial [230Th/238U] activity ratios.

  • V_a230_238 (ndarray (2-D), optional) – Covariance matrix of initial [230Th/238U] uncertainties.

  • a231_235 (ndarray (1-D), optional) – Initial [231Pa/235U] activity ratios.

  • V_a231_235 (ndarray (2-D), optional) – Covariance matrix of initial [231Pa/235U] uncertainties.

  • alpha (float, optional) – Common 207Pb/206Pb ratio.

  • alpha_1s (float, optional) – Uncertainty (1 sigma) on common 207Pb/206Pb ratio.

  • age_type ({'206Pb*', '207Pb*', 'cor207Pb'}) – Age type to calculate uncertainties for.

Returns

Vt – Covariance matrix of ages.

Return type

ndarray (2-D)

pysoplot.exceptions module

Custom exceptions.

exception pysoplot.exceptions.ConvergenceError

Bases: Exception

Exception raised when a numerical routine fails to meet convergence criterion.

pysoplot.guillong module

Pb/U equations assuming disequilibrium in a single nuclide only.

pysoplot.guillong.f(t, fThU, l8, l0)

206Pb/238U atomic ratio as a function of time and actvitiy ratios using equation from Guillong et al. (2014).

Notes

This equation assumes that 226Ra is always in radioactive equilibrium with 230Th. Where [226Ra/238U]i does not equal [230Th/238U]i, this equation may be inaccurate.

References

Guillong, M., von Quadt, A., Sakata, S., Peytcheva, I., Bachmann, O., 2014. LA-ICP-MS Pb-U dating of young zircons from the Kos–Nisyros volcanic centre, SE aegean arc. Journal of Analytical Atomic Spectrometry 29, 963–970. https://doi.org/10.1039/C4JA00009A

pysoplot.guillong.g(t, fPaU, l5, l1)

207Pb/235U atomic ratio as a function of time and actvitiy ratios using equation from Sakata et al. (2018).

References

Sakata, S., Hirakawa, S., Iwano, H., Danhara, T., Guillong, M., Hirata, T., 2017. A new approach for constraining the magnitude of initial disequilibrium in Quaternary zircons by coupled uranium and thorium decay series dating. Quaternary Geochronology 38, 1–12. https://doi.org/10.1016/j.quageo.2016.11.002

pysoplot.isochron module

“Classical” isochron ages.

pysoplot.isochron.age(b, sb=None, age_type='iso-206Pb', dc_errors=False)

Calculate classical isochron age.

Parameters
  • b (float) – Linear regression slope

  • sb (float, optional) – Uncertaintiy in regression slope (\(1\sigma\))

  • age_type ({'iso-Pb6U8', 'iso-Pb7U5'}) – Isochron age type.

pysoplot.isochron.mc_uncert(fit, age_type='iso-206Pb', dc_errors=False, norm_isotope='204Pb', trials=50000, hist=False)

Compute classical isochron age uncertainties using Monte Carlo approach.

Compute Monte Carlo age uncertainties for equilibrium concordia intercept age.

Parameters
  • fit (dict) – Linear regression fit parameters.

  • age_type ({'iso-Pb6U8', 'iso-Pb7U5'}) – Isochron age type.

  • trials (int) – Number of Monte Carlo trials.

pysoplot.ludwig module

Disequilibrium U-Pb equations based on Ludwig (1977).

pysoplot.ludwig.bateman(Lam, series='238U')

Return Bateman coefficients for the 238U or 235U decay series as defined in Ludwig (1977).

Lamarray-like

array of relevant decay constants (see below)

Notes

References

Ludwig, K.R., 1977. Effect of initial radioactive-daughter disequilibrium on U-Pb isotope apparent ages of young minerals. Journal of Research of the US Geological Survey 5, 663–667.

pysoplot.ludwig.dfdt(t, A, Lam, coef, init=(True, True))

Derivative of 206Pb*/238U ratio (where * denotes radiogenic Pb) with respect to t.

Notes

These equations are based on secular equilibrium U-series equations only at present.

pysoplot.ludwig.dfdt_comp(t, A, Lam, coef, init=(True, True))

Individual components of derivative of 206Pb*/238U ratio (where * denotes radiogenic Pb) with respect to t.

Notes

These equations are based on secular equilibrium U-series equations only at present.

pysoplot.ludwig.dgdt(t, a231_235_i, Lam, coef)

Derivative of 207Pb*/235U (where * denotes radiogenic Pb) with respect to t.

pysoplot.ludwig.dgdt_comp(t, a231_235_i, Lam, coef)

Individual components of derivative of 207Pb*/235U (where * denotes radiogenic Pb) with respect to t.

pysoplot.ludwig.f(t, A, Lam, coef, init=(True, True))

206Pb*/238U ratio (where * denotes radiogenic Pb) as a function of t and activity ratio values following Ludwig (1977). Note there is a small typo in the original Ludwig article.

Parameters
  • t (float or array-like) – Age (Ma)

  • A (array-like) – One-dimensional array of activity ratio values arranged as follows [234U/238U], [230Th/238U], [226Ra/238U],

  • Lam (array-like) – One-dimensional array of decay constants (Ma^-1) arragend as follows [lam238, lam234, lam230, lam226]

  • coef (array-like) – One-dimensional array of Bateman coefficients [c1, c2, c3, c4, c5, p1, p2, p3, h1, h2]

  • init (array-like, optional) – Two element array of bools. First element is True if [234U/238U] is an initial value. Second element is True if [230Th/238U] is an initial value.

References

Ludwig, K.R., 1977. Effect of initial radioactive-daughter disequilibrium on U-Pb isotope apparent ages of young minerals. Journal of Research of the US Geological Survey 5, 663–667.

pysoplot.ludwig.f_comp(t, A, Lam, coef, init=(True, True))

Return individual components of f.

pysoplot.ludwig.g(t, a231_235_i, Lam, coef)

207Pb*/235U ratio (where * denotes radiogenic Pb) as a function of t and activity ratio values following Ludwig (1977).

Parameters
  • t (float or array-like) – Age (Ma)

  • a231_235_i (float or array-like) – [231Pa/235U] activity ratio.

  • Lam (array-like) – One-dimensional array of decay constants (Ma^-1) arragend as follows [lam235, lam231]

  • coef (array-like) – One-dimensional array of Bateman coefficients [d1, d2]

References

Ludwig, K.R., 1977. Effect of initial radioactive-daughter disequilibrium on U-Pb isotope apparent ages of young minerals. Journal of Research of the US Geological Survey 5, 663–667.

pysoplot.ludwig.g_comp(t, a231_235_i, Lam, coef)

Return individual components of g.

pysoplot.minimise module

Minimisation functions for numerical disequilibrium age solutions.

pysoplot.minimise.concage_x(diagram, init=(False, False))
pysoplot.minimise.concint(diagram='tw', init=(True, True))

Disequilbrium concordia-intercept age minimisation function.

pysoplot.minimise.concordant_A48()

Minimisation function for computing initial U234/U238 activity ratio that forces concordance between 238U and 235U isochron ages.

Minimises function: f(t75, A) - slope_86, where t75 is the 207Pb/x-235U/x isochron age.

pysoplot.minimise.guillong(t0=1.0)

Minimisation function for disequilibrium Pb/U ages using the equations of Guillong et al., (2014) - eith 206Pb/238U or 207Pb/235U ages. fXU is either fThU or fPaU

Parameters
  • lam235 (lamU is either lam238 or) –

  • lam231 (lamX is either lam230 or) –

References

Guillong, M., von Quadt, A., Sakata, S., Peytcheva, I., Bachmann, O., 2014. LA-ICP-MS Pb-U dating of young zircons from the Kos–Nisyros volcanic centre, SE aegean arc. Journal of Analytical Atomic Spectrometry 29, 963–970. https://doi.org/10.1039/C4JA00009A

pysoplot.minimise.isochron(age_type='iso-206Pb', init=(True, True))

Disequilibrium isochron age minimisation function.

pysoplot.minimise.pbu(age_type='206Pb*', init=(True, True))

Age minimisation function for disequilibrium Pb*/U and 207Pb-corrected ages.

pysoplot.minimise.pbu_iterative(age_type='206Pb*', meas_232Th_238U=True)

Age functions for disequilibrium 206Pb*/U238 ages computed iteratively. Either (232Th/238U)i is inferred from measured 232Th/238U, or from radiogenic 208Pb/206Pb and age.

pysoplot.minimise.sakata(t0=1.0)

Pb/U age minimisation functions using equaitons of Sakata (2017).

References

Sakata, S., Hirakawa, S., Iwano, H., Danhara, T., Guillong, M., Hirata, T., 2017. A new approach for constraining the magnitude of initial disequilibrium in Quaternary zircons by coupled uranium and thorium decay series dating. Quaternary Geochronology 38, 1–12. https://doi.org/10.1016/j.quageo.2016.11.002

pysoplot.misc module

Miscellaneous functions.

pysoplot.misc.cdiff(x, f, h, *args, **kwargs)

Estimate derivative using central difference method.

Notes

The result is quite sensitive to the h value chosen. A suitable h is difficult to determine a priori, but often 1e-08 imes x is a reasonable guess.

pysoplot.misc.compile_vxy(x, sx, y, sy, rxy=None)

Compile full covariance matrix for 2-D data points.

pysoplot.misc.covmat_to_cormat(cov)

Compute correlation matrix from covariance matrix. Based on: https://gist.github.com/wiso/ce2a9919ded228838703c1c7c7dad13b

pysoplot.misc.eigsorted(cov)

Return eigenvalues and vectors sorted from largest to smallest. Based on code by Joe Kington: https://github.com/joferkington/oost_paper_code/blob/master/error_ellipse.py

pysoplot.misc.get_exponent(n)

Return order of magnitude of n

pysoplot.misc.num_dec_places(n)

Return number of decimal digits in string representation of a decimal number.

pysoplot.misc.pos_def(x, tol=1e-08)

Verify that matrix is positive semi-definite. Based on numpy multivariate_normal code, e.g.: https://github.com/numpy/numpy/blob/main/numpy/random/mtrand.pyx

pysoplot.misc.print_result(dic, title='Result')
pysoplot.misc.print_table(cols, title='Table')
pysoplot.misc.round_down(n, sf=2)

Round float down to n significant figures.

pysoplot.monte_carlo module

pysoplot.plotting module

Plotting routines and functions.

pysoplot.plotting.apply_plot_settings(fig, plot_type='isochron', diagram=None, xlim=(None, None), ylim=(None, None), axis_labels=(None, None), norm_isotope='204Pb')

Set axis labels and limits. Apply label, tick, grid formatting settings as defined in pysoplot.cfg.

Parameters
  • fig (matplotlib.pyplot.Figure) – Figure to apply settings to.

  • plot_type ({'isochron', 'intercept', 'wav', 'hist'}, optional) – Plot type.

pysoplot.plotting.box_line_intersection(xmin, xmax, ymin, ymax, a, b)

Find intercpet points between line defined by slope = a, int = b, and axis window limits.

pysoplot.plotting.confidence_ellipse(ax, x, sx, y, sy, r_xy, p=0.95, mpl_label='data ellipse', ellipse_kw=None, outline_alpha=False)

Plot 2D correlated data point as covariance ellipse. Assumes large sample size was used to estimate data point uncertainties and covariance.

Based partly on code implemented in Knighton and Tobin (2011), see: https://github.com/joferkington/oost_paper_code/blob/master/error_ellipse.py

pysoplot.plotting.in_box(p, xmin, xmax, ymin, ymax)

Check if point p = (x, y) is within bounding rectangle defined by x, y limits, allowing some tolerance for floating points numbers.

pysoplot.plotting.line_intersection(a1, b1, L2)

Return intersection point between line defined by slope, b1, and y-int, a1, and a line segment defined by end points as L2 = ((x1, y1), (x2, y2)).

pysoplot.plotting.oned_dp(ax, x, xpm, rand_pm=None, sorted=False, labels=None)

Plot 1-d data points (e.g. ages used to compute weighted mean).

pysoplot.plotting.plot_cor207_projection(ax, x, sx, y, sy, r_xy, Pb76, t=None, A=None, init=None)

Plot projection line from the common 207Pb/206Pb value through the center of the data ellipse. If t is supplied, then the line will be projected to the concordia intercept. Otherwise, it will continue to the edge of the plot.

Parameters

t (array-like, optional) – Intercept age for data point. Must be same length as x and y.

pysoplot.plotting.plot_dp(x, sx, y, sy, r_xy, labels=None, p=0.95, reset_axis_limits=True)

Plot 2-dimensional data points with assigned uncertainties as confidence ellipses.

Parameters
  • x (np.ndarray) – x values (as 1-dimensional array)

  • sx (np.ndarray) – uncertainty on x at \(1\sigma\) abs.

  • y (np.ndarray) – y values

  • sy (np.ndaray) – uncertainty on y at \(1\sigma\) abs.

  • r_xy (np.ndarray) – x-y correlation coefficient

Notes

Assumes a large sample size was used to estimate data point uncertainties and covariances.

pysoplot.plotting.plot_rfit(ax, fit)

Plot regression line and uncertainty envelope about regression line indicating 95% confidence limits on fit.

Parameters
  • ax (matplotlib.pyplot.Axes) – Axes to plot fit to.

  • fit (dict) – Linear regression fit results.

pysoplot.plotting.renv(ax, fit)

Plot uncertainty envelope about regression line indicating 95% confidence limits on fit. For classical regression fits, uses the approach of Ludwig (1980), for non-classical fits uses Monte Carlo simulation.

Parameters
  • ax (matplotlib.pyplot.Axes) – Axes to plot to.

  • fit (dict) – Linear regression fit results.

References

Ludwig, K.R., 1980. Calculation of uncertainties of U-Pb isotope data. Earth and Planetary Science Letters 212–202.

pysoplot.plotting.renv_mc(ax, fit)

Use Monte Carlo simulation to plot regression error envelope.

pysoplot.plotting.rline(ax, theta)

Plot regression line.

Parameters
  • ax (matplotlib.pyplot.Axes) – Axes to plot to.

  • theta (array-like) – Array with y-intercept as first element and slope as second.

pysoplot.plotting.set_axis_labels(ax, diagram='tw', norm_isotope='204Pb', axis_labels=(None, None))

Set axis x, y axis labels for default diagram types, or use inputted axis labels.

pysoplot.plotting.set_axis_limits(ax, xmin=None, xmax=None, ymin=None, ymax=None)

Set axis limits if user specified limits are supplied.

pysoplot.plotting.tick_label_format(ax, ticks, sci_limits, comma_sep_thousands, axis='x')

Format plot tick labels.

Parameters
  • ticks (array-like) – List of ticks.

  • sci_limits (array-like) – Axis scientific notation exponent limits as [lower, upper]. If the maximum axis value is greater than 10 ^ upper then scientific notation is used for tick labels. An equivalent test is applied to the lower limit.

  • comma_sep_thousands (bool) – True if use comma to separate each 10^3 increment, e.g. “10,450”.

Returns

tick_formatter

Return type

matplotlib.ticker.Formatter

pysoplot.plotting.wav_line(ax, xb, xbpm, env=True)

Add weighted average line and error envelope to plot of 1-D data points.

pysoplot.plotting.wav_plot(x, xpm, xb, xbpm, rand_pm=None, sorted=False, ylim=(None, None), x_multiplier=1.0, dp_labels=None)

Plot weighted average as line and uncertainty band and data points as uncertainty bars.

Parameters
  • x (np.ndarray) – Values to be averaged as 1-dimensional array.

  • xpm (np.ndarray) – Symmetrical +/- errors on x.

  • xb (float) – Average value (x-bar).

  • xbpm (float) – Symmetrical +/- error on xb.

  • rand_pm (np.ndarray, optional) – Random symmetrical +/- errors on x.

  • x_multiplier – Use for unit conversion (e.g. set to 1000 for Ma to ka conversion)

  • dp_labels (array-like, optional) – Data point labels.

pysoplot.regression module

Linear regression algorithms for 2-dimensional datasets.

pysoplot.regression.classical_fit(x, sx, y, sy, r_xy, model='ca', plot=False, diagram=None, isochron=True, xlim=(None, None), ylim=(None, None), axis_labels=(None, None), norm_isotope=None, dp_labels=None)

Fit a classical linear regression line to 2-dimensional data and optionally create plot of the fit. If model is set to ‘ca’, then routine will emulate default the protocols of Isoplot Ludwig (2012).

Parameters
  • x (np.ndarray) – x values (as 1-dimensional array)

  • sx (np.ndarray) – analytical uncertainty on x at \(1\sigma\) abs.

  • y (np.ndarray) – y values

  • sy (np.ndaray) – analytical uncertainty on y at \(1\sigma\) abs.

  • r_xy (np.ndarray) – x-y correlation coefficient

  • isochron (bool, optional) – If true and model is ‘ca’ then fits model 3 for excess scatter data sets instead of model 2.

  • model ({'ca', 'c1', 'c2', 'c3'}) – Regression model to fit to data.

Notes

model should be one of

  • ‘ca’ fit ‘best’ model depending on MSWD of york fit; emulates Isoplot behaviour

  • ‘c1’ standard York fit with analytical errors

  • ‘c2’ model of McSaveney in Faure (1977), equivalent to Isoplot model 2

  • ‘c3’ equivalent to Isoplot model 3

References

Faure, G., 1977. Appendix 1: Fitting of isochrons for dating by the Rb-Sr method, in: Principles of Isotope Geology. John Wiley and Sons, pp. 1–17.

Ludwig, K.R., 2012. Isoplot/Ex Version 3.75: A Geochronological Toolkit for Microsoft Excel, Special Publication 4. Berkeley Geochronology Center.

pysoplot.regression.huberu(x, y, xy_err=None, h=1.4, itmax=250)

Huber line-fitter with analytical errors discarded. Used for robust model 2 fit. Can take many iterations to converge, so set itmax quite high.

Original code by Roger Powell with some style modifications by TP.

Parameters

xy_err (np.ndarray, optional) – 3 x n array-like with elements sx, sy, r_xy (i.e. analytical errors on x and y, and their correlation coefficient). Used to ensure fit error is not less than average analytical error following approach of Powell et al. (2002).

Notes

Do not call this function directly, instead call robust_model_2.

pysoplot.regression.lad(x, y)

Fit least absolute deviation model of Sadovski (1974).

Notes

Based on code by Roger Powell.

References

Sadovski, A.N., 1974. Algorithm AS 74: L1-norm Fit of a Straight Line. Journal of the Royal Statistical Society. Series C (Applied Statistics) 23, 244–248. https://doi.org/10.2307/2347013

pysoplot.regression.lsq(x, y)

Fit ordinary least-squares model

Notes

Based on code by Roger Powell.

pysoplot.regression.model_2(x, y)

Fit a model 2 regression line. The slope is the geometric mean of ordinary least squares of y on x and the reciprocal of the ordinary least squares of x on y (Powell et al., 2020).

Equivalent to Isoplot Model 2 fit which is based on the routine of MacSaveney in Faure (1977) and uses the main York routine with weightings set to: wx = 0., wy = 1 / b^2, p_xy = 0, to achieve the same result iteratively.

Notes

Use the york function for now with model set to “2” as this function does not yet compute covtheta.

pysoplot.regression.model_3(x, sx, y, sy, r_xy, sy_excess0, theta0, mswd_tol=0.0001, itmax=100, york_itmax=50, york_atol=1e-08, york_rtol=1e-08)

Fit a model 3 regression line that is equivalent to Isoplot model 3 Ludwig (2012). Weights each point according to analytical errors, plus an extra component of Gaussian distributed scatter in y (applied equally to each data point). For each iteration this excess error in y is inflated and a new York fit produced, until MSWD converges to 1.

Parameters
  • x (np.ndarray) – x values (as 1-dimensional array)

  • sx (np.ndarray) – analytical uncertainty on x at \(1\sigma\) abs.

  • y (np.ndarray) – y values

  • sy (np.ndaray) – analytical uncertainty on y at \(1\sigma\) abs.

  • r_xy (np.ndarray) – x-y correlation coefficient

Notes

In Isoplot, this is only used for classical isochron ages

When applying this algorithm,there should be a good justification for the assumption of Guassian distributed excess scatter.

References

Ludwig, K.R., 2012. Isoplot/Ex Version 3.75: A Geochronological Toolkit for Microsoft Excel, Special Publication 4. Berkeley Geochronology Center.

pysoplot.regression.robust_fit(x, sx, y, sy, r_xy, model='ra', plot=False, diagram=None, xlim=(None, None), ylim=(None, None), axis_labels=(None, None), norm_isotope='204Pb', dp_labels=None)

Fit a robust linear regression to 2-dimensional data and optionally create a plot of the fit.

Parameters
  • x (np.ndarray) – x values (as 1-dimensional array)

  • sx (np.ndarray) – analytical uncertainty on x at \(1\sigma\) abs.

  • y (np.ndarray) – y values

  • sy (np.ndaray) – analytical uncertainty on y at \(1\sigma\) abs.

  • r_xy (np.ndarray) – x-y correlation coefficient

  • model (str, optional) – Regression model to fit to data.

Notes

model should be one of

  • ra fit ‘best’ robust model depending on whether or no spine width is less than slim

  • rs spine fit of Powell et al. (2020)

  • r2 robust model 2, a robust version of the Isoplot model 2

  • rx spine fit with expanded errors, for use if s is a little bit over slim (experimental feature only)

Data should be input as 1-dimensional ndarrays.

References

Powell, R., Green, E.C.R., Marillo Sialer, E., Woodhead, J., 2020. Robust isochron calculation. Geochronology 2, 325–342. https://doi.org/10.5194/gchron-2-325-2020

pysoplot.regression.robust_model_2(x, y, xy_err=None, h=1.4, disp=True)

Fit a robust model 2 linear regression to 2-dimensional data.

Analytical errors discarded and takes the geometric mean slope of the spine y on x fit, and the reciprocal of the spine x on y fit, using data scatter in place of analytical weights. Similar to the Isoplot model 2 approach but with robust properties.

Parameters
  • x (np.ndarray) – x values (as 1-dimensional array)

  • y (np.ndarray) – y values

  • xy_err (np.ndarray, optional) – 3 by n array with elements sx, sy, r_xy (i.e. analytical errors on x and y, and their correlation coefficient)

Notes

If xy_err is provided, nmad of the residuals will be checked against the median analytical uncertainty, and if larger, this value will be used to weight data points instead. Following Powell et al. (2002), this is to guard against a situation in which the scatter on the data is smaller than that expected with the analytical uncertainties.

Code by Roger Powell with style modifications by TP.

References

Powell, R., Hergt, J., Woodhead, J., 2002. Improving isochron calculations with robust statistics and the bootstrap. Chemical Geology 191–204.

pysoplot.regression.siegel(x, y)

Median of pairwise median slopes algorithm of Siegel (1982).

Based on code by Roger Powell.

References

Siegel, A. F.: Robust regression Using repeated medians, Biometrika, 69, 242–244, 1982.

pysoplot.regression.slim(n)

Upper bound of 95% confidence interval on s (spine width) for Spine linear regression algorithm. Derived from simulation of Gaussian distributed datasets. See Powell et al., (2020).

References

Powell, R., Green, E.C.R., Marillo Sialer, E., Woodhead, J., 2020. Robust isochron calculation. Geochronology 2, 325–342. https://doi.org/10.5194/gchron-2-325-2020

pysoplot.regression.spine(x, sx, y, sy, rxy, h=1.4)

Iteratively re-weighted Huber line-fitting algorithm of Powell et al. (2020).

Parameters
  • x (np.ndarray) – x values (as 1-dimensional array)

  • sx (np.ndarray) – analytical uncertainty on x at \(1\sigma\) abs.

  • y (np.ndarray) – y values

  • sy (np.ndaray) – analytical uncertainty on y at \(1\sigma\) abs.

  • rxy (np.ndarray) – x-y correlation coefficient

Notes

Updated to use normalised deltheta as convergence criteria for improved performance where slope and y-int are of very different order of magnitude.

Code by Roger Powell with style modifications by TP.

References

Powell, R., Green, E.C.R., Marillo Sialer, E., Woodhead, J., 2020. Robust isochron calculation. Geochronology 2, 325–342. https://doi.org/10.5194/gchron-2-325-2020

pysoplot.regression.york(x, sx, y, sy, r_xy, sy_excess=None, model='1', itmax=50, rtol=1e-08, atol=1e-08, theta0=None)

Fit total weighted least squares regression using the algorithm of York (2004). Analytical errors on regression parameters are equivalent to the Maximum Likelihood approach of Titterington and Halliday (1979).

Can also fit a version of the Isoplot model 2 and model 3 (but see note) by adjusting th weightings. Model 2 code is based on McSaveney in Faure (1977). Model 3 code emulates Isoplot (Ludwig, 2012).

Parameters
  • x (np.ndarray, 1-D) – x values

  • sx (np.ndarray, 1-D) – analytical uncertainty on x at \(1\sigma\) abs.

  • y (np.ndarray, 1-D) – y values

  • sy (np.ndaray, 1-D) – analytical uncertainty on y at \(1\sigma\) abs.

  • r_xy (np.ndarray, 1-D) – x-y correlation coefficient

  • model ({'1', '2', '3'}, optional) – model type to fit

Notes

Model 3 fits involve an iterative approach that typically requires calling this function several times. To perform a model 3 fit, call pysoplot.regression.model_3() instead.

References

Faure, G., 1977. Appendix 1: Fitting of isochrons for dating by the Rb-Sr method, in: Principles of Isotope Geology. John Wiley and Sons, pp. 1–17.

Ludwig, K.R., 2012. Isoplot/Ex Version 3.75: A Geochronological Toolkit for Microsoft Excel, Special Publication 4. Berkeley Geochronology Center.

Titterington, D.M., Halliday, A.N., 1979. On the fitting of parallel isochrons and the method of maximum likelihood. Chemical Geology 26, 183–195.

York, D., Evensen, N.M., Martinez, M.L., De Basabe Delgado, J., 2004. Unified equations for the slope, intercept, and standard errors of the best straight line. American Journal of Physics 72, 367–375. https://doi.org/10.1119/1.1632486

pysoplot.stats module

Basic stats functions.

pysoplot.stats.mswd_conf_limits(df, p=0.95, two_tailed=False)

Returns confidence limits on MSWD for given df.

pysoplot.stats.nmad(x)

Median absolute deviation about the median (MAD) normalised such that statistic will be equal to the standard deviation for a standard normal random variable.

pysoplot.stats.pr_fit(df, mswd)

Compute probability of fit following Ludwig (2012).

References

Ludwig, K.R., 2012. Isoplot/Ex Version 3.75: A Geochronological Toolkit for Microsoft Excel, Special Publication 4. Berkeley Geochronology Center.

pysoplot.stats.t_critical(df, alpha=0.05)

Critical Student’s t value for df degrees of freedom.

pysoplot.stats.two_sample_p(x, ox, y, oy)

Return p value for test that two measurements with Gaussian distributed uncertainties and known sigma are the same. I.e. is x - y compatible with 0 given uncertainties?

pysoplot.transform module

Transform data points, regression fits, etc.

pysoplot.transform.dp_errors(dp, in_error_type, append_corr=True, row_wise=True, dim=2, tol=1e-10)

Convert data point uncertainties to 1 \(\sigma\) absolute.

Parameters
  • in_error_type (str) – Error type and sigma level, use: {abs/per/rel}{1s/2s}

  • append_corr (bool, optional) – Assume error correlations are zero by appending a column of zeros to the end of n x 4 data point array.

  • row_wise (bool, optional) – True if each row is a data point and each column is a variable. False if vice versa.

  • dim (int) – 1 for univariate data (e.g. Pb*/U data), 2 for multivariate (2-D) data.

pysoplot.transform.transform_centroid(xbar, ybar, transform_to='wc')

Transform x-bar and y-bar for classical regression fit from Terra-Wasserburg to Wetheril or vice versa.

pysoplot.transform.transform_covtheta(theta0, covtheta0, transform_to='wc')

Transform regression fit covtheta from Tera-Wasserburg coordinates to Wetheril (conventional discordia) coordinates or vice versa. See, e.g., Ludwig (2000).

Parameters
  • theta0 (array-like, 1-D) – Linear regression y-intercept and slope parameters.

  • covtheta0 (np.ndarray, 2 x 2) – Covariance matrix of regression fit parameters.

  • transform_to ({'wc', 'tw'}, optional) – Diagram coordinates to output.

References

Ludwig, K.R., 2000. Decay constant errors in U–Pb concordia-intercept ages. Chemical Geology 166, 315–318. https://doi.org/10.1016/S0009-2541(99)00219-3

pysoplot.transform.transform_dp(x0, ox0, y0, oy0, r_xy0, to='wc')

Transform concordia diagram data points from Tera-Wasserburg to Wetheril concordia or vice versa.

Notes

E.g., see Ludwig (1998) and Noda (2017).

References

Ludwig, K.R., 1998. On the treatment of concordant uranium-lead ages. Geochimica et Cosmochimica Acta 62, 665–676. https://doi.org/10.1016/S0016-7037(98)00059-3

Noda, A., 2017. A new tool for calculation and visualization of U. Bulletin of the Geological Survey of Japan 1–10.

pysoplot.transform.transform_fit(fit, transform_to='wc')

Transform regression theta and covtheta from Tera-Wasserburg coordinates to Wetheril coordinates (or vice versa) in one go.

Parameters
  • fit (dict) – Regression fit parameters.

  • transform_to ({'wc', 'tw'}, optional) – Diagram coordinates to output.

pysoplot.transform.transform_theta(theta, transform_to='wc')

Transform theta from Tera-Wasserburg (tw) coordinates to Wetheril (conventional concordia, wc) coordinates or vice versa.

Parameters
  • theta (array-like, 1-D) – Linear regression y-intercept and slope values.

  • transform_to ({'wc', 'tw'}, optional) – Diagram coordinates to output.

pysoplot.upb module

Functions and routines for U-Pb geochronology.

Notes

See pysoplot.dqpb for equivalent functions that account for disequilibrium in the uranium-series decay chains.

pysoplot.upb.concint_age(fit, method='L1980', diagram='tw', dc_errors=False)

Compute concordia-intercept age and uncertainty using various algorithms.

Parameters
  • fit (dict) – Regression fit parameters.

  • method ({'Powell', 'L1980', 'L2000'}, optional) – Algorithm used to compute age and age uncertainties.

Returns

results – Age results.

Return type

dict

Notes

  • The ‘Powell’ method focuses on lower intercept age only (< ~1 Ga), but works with all fit types. Age uncertainties are symmetric.

  • The ‘L1980’ method only works with classical fits. Age uncertainties are asymmetric.

  • The ‘L2000’ method works with all fit types and optionally accounts for decay constant errors, but requires 2 intercept age solutions.

pysoplot.upb.concint_age_min(diagram='tw')

Concordia-intercept age minimisation functions for Monte Carlo simulation.

pysoplot.upb.concint_ludwig(theta, diagram='tw', t0=10.0, maxiter=40)

Compute concordia-intercept age using routine in the appendix of Ludwig (1980).

pysoplot.upb.concint_powell(theta, covtheta=None, uncert=False, maxiter=30, diagram='tw')

Compute Tera-Wasserburg concordia intercept age and uncertainty focussing on lower intercept only using the method of Powell et al. (2020). Converges rapidly, but will not work for intercept ages greater than ~100 Ma. Does not account for decay constant errors.

pysoplot.upb.concint_uncert_ludwig1980(t, theta, theta_95ci, xbar, diagram='wc', maxiter=40)

Compute concordia-intercept age uncertainties using the approach of Ludwig (1980). The algorithm can account for asymmetric age uncertainties, but not decay constant errors.

Notes

This algorithm requires x-bar to be specified so it is really only suitable for use with classical regression lines.

pysoplot.upb.concint_uncert_ludwig2000(t1, t2, theta, covtheta, t_mult, dc_errors=True)

Compute lower and upper concordia intercept age and uncertainties in one go based on equations in Ludwig (2000). Can account for decay constant errors. Assumes age uncertainties are symmetric.

Equations require data points to be in Wetheril concordia form. A transformation should first be performed if data points are in Tera-Wasserburg form.

Notes

Ludwig (2000) uses ‘m’ for regression line slope and ‘b’ for regression line y-int, whereas this function uses ‘b’ for regression line slope and ‘a’ for y-intercept.

pysoplot.upb.isochron_age(fit, age_type='iso-206Pb', dc_errors=False, norm_isotope='204Pb')

Classical U-Pb isochron age and uncertainty.

Parameters
  • fit (dict) – Regression fit parameters.

  • age_type ({'iso-206Pb', 'iso-207Pb'}, optional) – Isochron type.

Returns

results – Age results.

Return type

dict

pysoplot.upb.mc_concint(t, fit, trials=50000, diagram='tw', dc_errors=False, U_errors=False, intercept_plot=False, hist=False, xlim=(None, None), ylim=(None, None), env=False, age_ellipses=False, marker_max=None, marker_ages=(), auto_marker_ages=True, remove_overlaps=False, intercept_points=True, intercept_ellipse=False, negative_ages=True, age_prefix='Ma')

Compute Monte Carlo age uncertainties for equilibrium concordia intercept age.

Parameters
  • t (float) – Calculated age (Ma).

  • fit (dict) – Linear regression fit parameters.

  • trials (int) – Number of Monte Carlo trials.

pysoplot.upb.mc_pbu()

Not yet coded.

pysoplot.upb.pbu_age(x, sx=None, age_type='206Pb*', dc_errors=False)

Single analysis Pb/U age.

Notes

Uncertainties in a suite of single-analysis Pb/U ages should be propagated by quadratic addition after taking the weighted mean (e.g., Horstwood, 2016).

pysoplot.upb.pbu_ages(dp, age_type='206Pb*', cov=False, alpha=None, wav=False)

Pb/U ages and uncertainty. !!! Not yet fully coded !!!

pysoplot.useries module

Uranium-series functions and routines.

pysoplot.useries.Th230_age()
pysoplot.useries.Th230_age_uncert()
pysoplot.useries.Th230_isochron()
pysoplot.useries.ar08(t, a234_238, a230_238_i, lam238, lam234, lam230, init=True)

Calculate present [230Th/238U] as a function of present ratio and time.

Parameters

init (bool) – True if a234_238 is as an initial activity ratio.

Notes

Secular equilibrium equations are given by, e.g., Cheng et al. (2000) and Hellstrom (2006).

Non-secular equilibrium equation is derived from Bateman (1910) and does not assume negligible decay of 238U (e.g., Ivanovich and Harmon (1992)). This is an experimental feature.

References

Cheng, H., Adkins, J., Edwards, R.L., Boyle, E.A., 2000. U-Th dating of deep-sea corals. Geochimica et Cosmochimica Acta 64, 2401–2416. https://doi.org/10.1016/S0016-7037(99)00422-6

Hellstrom, J., 2006. U–Th dating of speleothems with high initial 230Th using stratigraphical constraint. Quaternary Geochronology 1, 289–295. https://doi.org/10.1016/j.quageo.2007.01.004

pysoplot.useries.ar08i(t, a234_238, a230_238, lam238, lam234, lam230, init=True)

Calculate initial [230Th/238U] as a function of present ratio and time.

Parameters

init (bool) – True if a234_238 is as an initial activity ratio.

Notes

Secular equilibrium equations are given by, e.g., Cheng et al., (2000) and Hellstrom (2006).

Non-secular equilibrium equation is derived from Bateman (1910) and does not assume negligible decay of 238U (e.g., Ivanovich and Harmon (1992)). This is an experimental feature.

References

Cheng, H., Adkins, J., Edwards, R.L., Boyle, E.A., 2000. U-Th dating of deep-sea corals. Geochimica et Cosmochimica Acta 64, 2401–2416. https://doi.org/10.1016/S0016-7037(99)00422-6

Hellstrom, J., 2006. U–Th dating of speleothems with high initial 230Th using stratigraphical constraint. Quaternary Geochronology 1, 289–295. https://doi.org/10.1016/j.quageo.2007.01.004

pysoplot.useries.ar48(t, a234_238_i, lam238, lam234)

Calculate initial [234U/238U] activity ratio as a function of initial ratio and age (Ma).

Notes

Non-secular equilibrium equation is derived from Bateman (1910) and does not assume negligible decay of 238U (e.g., Ivanovich and Harmon (1992)). This is an experimental feature.

References

Ivanovich, M. and Harmon, R. S.: Uranium-Series Disequilibrium: Applications to Earth, Marine, and Environmental Sciences., Clarendon Press, United Kingdom, second edn., 1992.

pysoplot.useries.ar48i(t, a234_238, lam238, lam234)

Calculate initial [234U/238U] activity ratio as a function of present ratio and age (Ma).

Notes

Non-secular equilibrium equation is derived from Bateman (1910) and does not assume negligible decay of 238U (e.g., Ivanovich and Harmon (1992)). This is an experimental feature.

References

Ivanovich, M. and Harmon, R. S.: Uranium-Series Disequilibrium: Applications to Earth, Marine, and Environmental Sciences., Clarendon Press, United Kingdom, second edn., 1992.

pysoplot.useries.init_ratio_solutions(t, A, init, Lam)

Compute initial activity ratio solutions from present-day values and U-Pb age solution. In principle these values are computed iteratively along with the age solution, but practically it is more convenient to compute them separately

pysoplot.wendt_carl module

Disequlibrium Pb/U functions based on Wendt and Carl (1985).

pysoplot.wendt_carl.f(t, A, DC, init=(True, True))

206Pb/236U atomic ratio as a function of time and actvitiy ratios using equation from [Wendt1985].

References

Wendt1985

Wendt, I., Carl, C., 1985. U/Pb dating of discordant 0.1 Ma old secondary U minerals. Earth and Planetary Science Letters 73, 278–284.

pysoplot.wendt_carl.g(t, A15i, DC)

207Pb/235U atomic ratio as a function of time and actvitiy ratios using equation from [Wendt1985].

References

Wendt1985

Wendt, I., Carl, C., 1985. U/Pb dating of discordant 0.1 Ma old secondary U minerals. Earth and Planetary Science Letters 73, 278–284.

pysoplot.wtd_average module

Weighted average algorithms for 1- and 2-dimensional data

pysoplot.wtd_average.classical_wav(x, sx=None, V=None, method='ca')

Compute a classical 1-dimensional weighted average accounting for assigned uncertainties (and optionally uncertainty correlations).

Partly emulates the behaviour of Isoplot Ludwig (2012). If one-sided MSWD confidence limit is above lower threshold, uncertainty on weighted average is expanded according to data scatter (i.e., by sqrt(mswd)).

Parameters
  • sx (np.ndarray, optional) – Analytical uncertainties at the 1 sigma level.

  • V (np.ndarray, optional) – Uncertainty covariance matrix.

  • method ({'ca'}) – Weighted average method to use (only one available currently)

Notes

Does not yet include external error component if MSWD confidence limit is above an upper threshold (as in the Isoplot MLE approach), although this feature may be added in future.

References

Ludwig, K.R., 2012. Isoplot/Ex Version 3.75: A Geochronological Toolkit for Microsoft Excel, Special Publication 4. Berkeley Geochronology Center.

pysoplot.wtd_average.robust_wav(x, sx=None, V=None, method='ra')

Compute a robust 1-dimensional weighted average accounting for assigned uncertainties (and optionally uncertainty correlations).

Parameters
  • x (np.ndarray) – Data points to average (as 1-d array).

  • sx (np.ndarray, optional) – Analytical uncertainties at the 1 sigma level (as 1-d array).

  • V (np.ndarray, optional) – Uncertainty covariance matrix.

  • method ({'ra'}) – Weighted average method to use (only one available currently)

Notes

Only implements spine robust weighted average at present.

pysoplot.wtd_average.slim_wav(n)

Returns Upper 95% confidence limit on spine width (s) for weighted averages. Values are derived via simulation of Gaussian distributed datasets.

pysoplot.wtd_average.spine_wav(x, sx, xb0=None, maxiter=50, h=1.4)

Compute a 1-dimensional robust uncertainty weighted average using the spine algorithm, without accounting for error covariance.

pysoplot.wtd_average.spine_wav_cor(x, V, xb0=None, maxiter=50, h=1.4, atol=1e-08, rtol=1e-08)

Compute a spine robust uncertainty weighted average accounting for uncertainty correlations amongst data points. Equivalent to a 1-dimensional version of the spine linear regression algorithm of Powell et al. (2020). Note, this reduces to classical statistics uncertainty weighted average for “well-behaved” datasets.

Parameters
  • x (np.ndarray) – Data points to be averaged (1-dimensional array).

  • V (np.ndarray) – covariance matrix (2-dimensional array).

References

Powell, R., Green, E.C.R., Marillo Sialer, E., Woodhead, J., 2020. Robust isochron calculation. Geochronology 2, 325–342. https://doi.org/10.5194/gchron-2-325-2020

pysoplot.wtd_average.wav(x, sx)

Compute a 1-dimensional uncertainty weighted mean without accounting for uncertainty covariances.

pysoplot.wtd_average.wav_cor(x, V)

Compute a 1-dimensional uncertainty weighted mean, accounting for uncertainty correlations amongst individual data points.

Based on equations given in, e.g., Powell1 and Holland (1988], Lyons et al. (1988), and McLean et al. (2011).

Parameters
  • x (np.ndarray) – Data points to be averaged (should be a 1-dimensional array).

  • V (np.ndarray) – covariance matrix (should be a 2-dimensional array).

Notes

See cautionary note in Lyons et al. (1988):

“One point to beware of in practice is the situation in which the individual weights become numerically very large.” … this happens when [errors are very close to each other and highly correlated]. If we have slightly mis-estimated the elements of the error matrix, or if our measurements are slightly biassed, the effect of the large weights with different signs can be to drive our solution far away from the correct value.”

References

Lyons, L., Gibaut, D., Clifford, P., 1988. How to combine correlated estimates of a single physical quantity. Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment 270, 110–117.

McLean, N M, J F Bowring, and S A Bowring, 2011, An Algorithm for U-Pb Isotope Dilution Data Reduction and Uncertainty Propagation Geochemistry, Geophysics, Geosystems 12, no. 6. https://doi.org/10.1029/2010GC003478.

Powell, R., Holland, T.J.B., 1988. An internally consistent dataset with uncertainties and correlations: 3. Applications to geobarometry, worked examples and a computer program. J Metamorph Geol 6, 173–204. https://doi.org/10.1111/j.1525-1314.1988.tb00415.x

pysoplot.wtd_average.wavx()

Classical weighted average with excess scatter parameterised as a uniform Gaussian source of error applied equally to all datapoints.

Module contents

A Python library for geochronology.