Experimental Bayesian planktic foraminifera calibration, for Python.
Project description
# bayfox
[![Travis-CI Build Status](https://travis-ci.org/brews/bayfox.svg?branch=master)](https://travis-ci.org/brews/bayfox)
Experimental Bayesian planktic foraminifera calibration, for Python.
Please note that this package is currently under development. It will eat your pet hamster.
## Quick example
First, load key packages and an example dataset:
import numpy as np import bayfox as bfox
example_file = bfox.get_example_data(‘VM21-30.csv’) d = np.genfromtxt(example_file, delimiter=’,’, names=True, missing_values=’NA’)
This data (from [Koutavas and Joanides 2012](https://doi.org/10.1029/2012PA002378)) has three columns giving, down-core depth, sediment age (calendar years BP) and δ18O for G. ruber (white) (‰; VPDB). The core site is in the Eastern Equatorial Pacific.
We can make a prediction of sea-surface temperature (SST) with predict_seatemp():
prediction = bfox.predict_seatemp(d[‘d18O_ruber’], d18osw=0.239, prior_mean=24.9, prior_std=7.81)
The values we’re using for priors are roughly based on the range of SSTs we’ve seen for G. ruber (white) sediment core in the modern period, though prior standard deviation is twice`d18osw` is twice the spread we see in the modern record. δ18O for seawater (‰; VSMOW) during the modern record ([LeGrande and Schmidt 2006](https://doi.org/10.1029/2006GL026011)). We’ll assume it’s constant – for simplicity. We’re also not correcting these proxies for changes in global ice volume, so these numbers will be off. Ideally we’d make this correction to δ18Oc series before the prediction. See the [erebusfall package](https://github.com/brews/erebusfall) for simple ice-volume correction in Python.
To see actual numbers from the prediction, directly parse prediction.ensemble or use prediction.percentile() to get the 5%, 50% and 95% percentiles. You can also plot your prediction with dfox.predictplot(prediction).
This uses the pooled Bayesian calibration model, which is calibrated on annual SSTs. We can consider foram-specific variability with:
- prediction = bfox.predict_seatemp(d[‘d18O_ruber’], d18osw=0.239, prior_mean=24.9, prior_std=7.81,
foram=’G_ruber_white’)
which uses our hierarchical model calibrated on annual SSTs. We can also estimate foram-specific seasonal effects with:
- prediction = bfox.predict_seatemp(d[‘d18O_ruber’], d18osw=0.239, prior_mean=24.9, prior_std=7.81,
foram=’G_ruber_white’, seasonal_seatemp=True)
This uses our hierarchical model calibrated on seasonal SSTs. Be sure to specify the foraminifera if you use this option.
You can also predict δ18O for planktic calcite using similar options, using the predict_d18oc() function.
## Installation
To install bayfox with pip, run:
pip install bayfox
To install bayfox with conda, run:
conda install -c sbmalev bayfox
bayfox is not compatible with Python 2.
## Support and development
Please feel free to report bugs and issues or view the source code on GitHub (https://github.com/brews/bayfox).
## License
bayfox is available under the Open Source GPLv3 (https://www.gnu.org/licenses).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file bayfox-0.0.1a1.tar.gz
.
File metadata
- Download URL: bayfox-0.0.1a1.tar.gz
- Upload date:
- Size: 4.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a368548c3227d9a95158b417dfb3ac36e4de29ff9f5b0e7d7653750ce1b85264 |
|
MD5 | 48acbbc76d222c194f33fdb6968141d2 |
|
BLAKE2b-256 | 6f5e655b01742e5b9bbf41a8f16ff5aecb3cd173cf4283c7d9cc551d25eb0a4a |
File details
Details for the file bayfox-0.0.1a1-py3-none-any.whl
.
File metadata
- Download URL: bayfox-0.0.1a1-py3-none-any.whl
- Upload date:
- Size: 4.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15827e18c3fe649d5d512018c72f00c2c2d7cd13de3c1835eb5670730bcb09b8 |
|
MD5 | d928582684504aab6037b777561f9f06 |
|
BLAKE2b-256 | 6ae1c3836a9133c7460dbd5337279089a70c7e31bc1a9a1c290ddbbfd910a723 |