Skip to main content

A Python implementation of BAYSPLINE

Project description

https://travis-ci.org/brews/baysplinepy.svg?branch=master

An open source Python package for alkenone UK’37 calibration.

baysplinepy is based on the original BAYSPLINE software for MATLAB (https://github.com/jesstierney/BAYSPLINE). BAYSPLINE is a Bayesian calibration for the alkenone paleothermometer, as published in Tierney & Tingley (2018).

NOTE that this package is under active development. Code and documentation may not be complete and may change in the near future.

Example

First, load packages and an example dataset:

import numpy as np
import bayspline as bsl

example_file = bsl.get_example_data('tierney2016-p178-15p.csv')
d = np.genfromtxt(example_file, delimiter=',', names=True)

This dataset (from Tierney et al. 2015) has three columns giving core depth (cm), sediment age (calendar years BP), and UK’37.

We can predict sea-surface temperatures (SST) from UK’37 with bsl.predict_sst():

prediction = bsl.predict_sst(d['uk37'], prior_std=10)

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 bsl.predictplot() or bsl.densityplot().

Alternatively, we can make inferences about UK’37 from SST with bsl.predict_uk():

sst = np.arange(1, 25)
prediction = bsl.predict_uk(sst)

Installation

Install baysplinepy in conda with:

$ conda install baysplinepy -c sbmalev

To install with pip, run:

$ pip install baysplinepy

Unfortunately, baysplinepy is not compatible with Python 2.

Support and development

License

baysplinepy 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

baysplinepy-0.0.2.tar.gz (88.7 kB view details)

Uploaded Source

Built Distribution

baysplinepy-0.0.2-py3-none-any.whl (100.6 kB view details)

Uploaded Python 3

File details

Details for the file baysplinepy-0.0.2.tar.gz.

File metadata

  • Download URL: baysplinepy-0.0.2.tar.gz
  • Upload date:
  • Size: 88.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for baysplinepy-0.0.2.tar.gz
Algorithm Hash digest
SHA256 1a56f30060ab0c2a303778ec92b2d4ba5caffa81c9d7fa8b2e7b27cd7b21d022
MD5 9068919dea2ddfcb7412cf18d944d590
BLAKE2b-256 31cb4eed365d7988b96e16860fd66e6e63c06176dc6228f758f8a2648031aa3f

See more details on using hashes here.

File details

Details for the file baysplinepy-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: baysplinepy-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 100.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for baysplinepy-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 eb9a38a674c45a90c2559f926a46fb97bd85e5d44d4b985d197eaaa8df5070f5
MD5 f63317ec7076ebc547a750372c1694f6
BLAKE2b-256 d9160e9c783ab7329464f68a374f9ef5fa25f66067f64981bb116343c1350a2c

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