Skip to main content

Experimental Bayesian planktic foraminifera calibration, for Python.

Project description

bayfox

Travis-CI Build Status

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) 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 sediment cores in the modern period, though the prior standard deviation is twice the spread in the modern record. Let's use δ18O of modern seawater (‰; VSMOW) near the site (LeGrande and Schmidt 2006). 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 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 bfox.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')

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', 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

License

bayfox is available under the Open Source GPLv3 (https://www.gnu.org/licenses).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bayfox-0.0.1a3.tar.gz (4.0 MB view details)

Uploaded Source

Built Distribution

bayfox-0.0.1a3-py3-none-any.whl (4.0 MB view details)

Uploaded Python 3

File details

Details for the file bayfox-0.0.1a3.tar.gz.

File metadata

  • Download URL: bayfox-0.0.1a3.tar.gz
  • Upload date:
  • Size: 4.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for bayfox-0.0.1a3.tar.gz
Algorithm Hash digest
SHA256 332ab85251f18884617641e58dbb743dd4d5fd32373aef3d7dfd998724e4650c
MD5 73955761c5379600a0e7059af395a01f
BLAKE2b-256 4f8142124a330a1d1726db00aa05988d2d61cc3f1d242a01e853b12d5f54bc51

See more details on using hashes here.

File details

Details for the file bayfox-0.0.1a3-py3-none-any.whl.

File metadata

  • Download URL: bayfox-0.0.1a3-py3-none-any.whl
  • Upload date:
  • Size: 4.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for bayfox-0.0.1a3-py3-none-any.whl
Algorithm Hash digest
SHA256 0179e4b46eca8ac81193e9f4a2a8043cc8716360c8069c18b8a1398422d5c80a
MD5 fe6733bebc01146988d73281266a4e51
BLAKE2b-256 9cec63a661dd13b513938fc7e1e84705ca56a459753e9af62f0aa3c8972ed6b2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page