Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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 (white) sediment core in the modern period, though prior standard deviation is twiced18osw is twice the spread we see in the modern record. δ18O for seawater (‰; VSMOW) during the modern record (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_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

License

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

Metadata

Release files for bayfox 0.0.1a2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bayfox 0.0.1a2
File Size Uploaded Provenance Actions
bayfox-0.0.1a2.tar.gz 4.5 MB Without provenance Details for bayfox-0.0.1a2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bayfox 0.0.1a2
File Interpreter ABI Platform Actions
bayfox-0.0.1a2-py3-none-any.whl Python 3 none any Details for bayfox-0.0.1a2-py3-none-any.whl

Total release size: 9.1 MB

Release files / bayfox-0.0.1a2.tar.gz

Download URL bayfox-0.0.1a2.tar.gz
Size 4.5 MB
Tags Source
SHA-256 checksum
How to use checksums
1cd57abfadd438e8c567fcca75863898be12df8c794eed0816167c4d2a777167
BLAKE2b-256 checksum
How to use checksums
f8dbbf7286cef3bac7dbf13aa6a8723c538d41f3db677dc66ff3928812297496
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / bayfox-0.0.1a2-py3-none-any.whl

Download URL bayfox-0.0.1a2-py3-none-any.whl
Size 4.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
a372f8e3de5b35bf5403c61a775d3065bb47880dd1c9f9abf24c0974c7a11e07
BLAKE2b-256 checksum
How to use checksums
f4061d293e3ecbc6a95566ab7171d087da46d85514cbc955a13bebe40baa5de0
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for bayfox 0.0.1a2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page