Skip to main content

Radiocarbon Date Calibration and Analysis

PyPI PyPI - Downloads

This package provides tools for calibrating radiocarbon dates, calculating Summed Probability Distributions (SPDs), and performing statistical tests on SPDs using simulated data (Timpson et al. 2014). Functionality is similar to that provided by the R package rcarbon (Crema et al. 2016, 2017).

Features

  • Radiocarbon Date Calibration: Calibrate individual or multiple radiocarbon dates using calibration curves (e.g., IntCal20, ShCal20).
  • Summed Probability Distributions (SPDs): Calculate SPDs for a collection of radiocarbon dates.
  • Simulated SPDs: Generate simulated SPDs to test hypotheses or assess the significance of observed SPDs.
  • Statistical Testing: Compare observed SPDs with simulated SPDs to identify significant deviations.
  • Visualization: Plot calibrated dates, SPDs, and confidence intervals.

Installation

To install the package, you can use the following command:

pip install radiocarbon

Usage

Calibrating Radiocarbon Dates

from radiocarbon import Date, Dates

# Create a single radiocarbon date
date = Date(c14age=3000, c14sd=30, curve="intcal20").calibrate()

# Calibrate multiple dates
dates = Dates(c14ages=[3000, 3200, 3100], c14sds=[30, 25, 35], curves=["intcal20", "intcal20", "shcal20"]).calibrate()

# Plot a single calibrated date
date.plot()

Supposing you have a CSV file with radiocarbon dates, you can read the file and calibrate the dates as follows:

import pandas as pd
from radiocarbon import Dates

# Read dates from a CSV file
df = pd.read_csv("dates.csv")

# Create a Dates object from the DataFrame
dates = Dates(df["c14age"], df["c14sd"], df["curve"]).calibrate()

Calculating Summed Probability Distributions (SPDs)

from radiocarbon import SPD

# Create an SPD from a collection of dates
spd = SPD(dates).sum()

# Plot the SPD
spd.plot()

Simulating SPDs and Testing

from radiocarbon import SPDTest

# Test an observed SPD against simulations
spd_test = SPDTest(spd, date_range=(3000, 3500)).run_test(n_iter=1000, model="uniform")
spd_test.plot()

Metadata

Release files for radiocarbon 0.3.1

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

Source distribution (sdist)

Source distribution for radiocarbon 0.3.1
File Size Uploaded Provenance Actions
radiocarbon-0.3.1.tar.gz 339.6 kB Without provenance Details for radiocarbon-0.3.1.tar.gz

Built distribution (wheel)

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

Total release size: 675.8 kB

Release files / radiocarbon-0.3.1.tar.gz

Download URL radiocarbon-0.3.1.tar.gz
Size 339.6 kB
Tags Source
SHA-256 checksum
How to use checksums
170e7055d0fcbe578433e5892cfd8d4b8585d15401bb3c8c27e80629c1f55666
BLAKE2b-256 checksum
How to use checksums
6a88878715a98f871447be78a49e57609ca9d9e2f9a48b15c23953d5cb78458e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release files / radiocarbon-0.3.1-py3-none-any.whl

Download URL radiocarbon-0.3.1-py3-none-any.whl
Size 336.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eecd30b394bed7131ba8994c79c36c4e1b629103ae58b901054d68424e635e53
BLAKE2b-256 checksum
How to use checksums
4d6192f1b641d38ab06c21bdc6d8dd2284b2832ef5a64ce863fd17bd234774c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Security for radiocarbon 0.3.1

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