# ticktack

A lightweight, open-source carbon box modelling library, adapted for modelling tree ring radiocarbon time series.

## Overview

Radiocarbon measurements from tree rings allow us to recover measurements of cosmic radiation from the distant past, and exquisitely calibrate carbon dating of archaeological sites. But in order to infer cosmic production rates from raw ΔC14 data, we need to model the entire global carbon cycle, from the production of radiocarbon in the stratosphere and troposphere to its uptake by the oceans and biosphere. Many such competing models exist, in which the Earth system is partitioned into 'boxes' with reservoirs of C12, C14, and coefficients of flow between them.

ticktack is the first open-source package for radiocarbon box modelling, allowing you to specify your own model or load a model with the same parameters as several leading closed-source models. Built in Python on Google Jax, it solves the carbon box ordinary differential equations using the Runge-Kutta method, on arbitrarily fine time grids and with arbitrary production rates. This forwards model is connected via a simple API to Bayesian inference using MCMC: currently we support only emcee, but implementations are in progress of HMC and nested sampling.

## Installation

The easiest way to install is from PyPI: just use

pip install ticktack

To install from source: clone this git repo, enter the directory, and run

python setup.py install