
The BAYSPAR TEX86 calibration, in Python¶
Warning
This project is under heavy development.
baysparpy is an Open Source Python package for TEX86 calibration.
The package is based on the original BAYSPAR (BAYesian SPAtially-varying Regression) software for MATLAB.
Documentation¶
Quick Overview¶
BAYSPAR (BAYesian SPAtially-varying Regression) is a Bayesian calibration model for the TEX86 temperature proxy.
There are two calibrations — one for sea-surface temperatures (SSTs) and one for subsurface (0-200 m) temperatures (subT) — and two methods to infer or predict past temperatures. The “standard” version of the model draws calibration parameters from the model gridpoint nearest to the core site to predict temperatures. The “Deep-Time” or “analog” version searches the calibration dataset for coretop TEX86 values similar to those in the time series (within a user-set search tolerance) and uses the parameters from those analog locations to predict SSTs. The SST data in the calibration model are the statistical mean data from the World Ocean Atlas 2009.
For further details, refer to the original publication in Geochimica et Cosmochimica Acta, and the updated calibration publication in Scientific Data.
The original BAYSPAR MATLAB code is also available online.
What’s New¶
v0.0.2¶
Enhancements¶
Prediction.location
refactored toPrediction.latlon
(Issue #8).- Removed unused
Draws.alpha_samples_field
andDraws.beta_samples_field
to cut down package size. Also, we dropped the maximum MCMC parameter ensemble size to 10,000 to further reduce size (Issue #1). - Many
assert
errors replaced with full errors (Issue #7). - Improved
pip
andconda
install instructions (Issue #6).
v0.0.1¶
- This is the first release of baysparpy.
Examples¶
To start things off, import a few basic
tools, including bayspar
:
In [1]: import numpy as np
In [2]: import matplotlib.pyplot as plt
In [3]: import bayspar as bsr
There are a few options when it comes to prediction with bayspar
.
Below, we use example data - included with the package - to walk through each
type of prediction.
Standard prediction¶
We can access the example data with get_example_data()
and use the
returned stream with pandas.read_csv()
or numpy.genfromtxt()
:
In [4]: example_file = bsr.get_example_data('castaneda2010.csv')
In [5]: d = np.genfromtxt(example_file, delimiter=',', names=True)
This dataset (from Castañeda et al. 2010) has two columns giving sediment age (calendar years BP) and TEX86.
In [6]: d['age'][:5]
Out[6]: array([142., 284., 375., 466., 558.])
In [7]: d['tex86'][:5]