A package for calibrating radiocarbon dates, calculating summed probability distributions, and testing their significance against a null hypothesis.
Project description
Radiocarbon Date Calibration and Analysis
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.from_df(df, "c14age", "c14sd", "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()
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file radiocarbon-0.5.0.tar.gz.
File metadata
- Download URL: radiocarbon-0.5.0.tar.gz
- Upload date:
- Size: 340.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
076e3f70e30f173278554284d2cc62cdd90de289814a8719b52deeefdcb17efe
|
|
| MD5 |
52e57b03a4af4813f322811d376c5e38
|
|
| BLAKE2b-256 |
1a43d8eb62b51e80a99af312e6f410264aba132baa838d50adf8df889d874f51
|
File details
Details for the file radiocarbon-0.5.0-py3-none-any.whl.
File metadata
- Download URL: radiocarbon-0.5.0-py3-none-any.whl
- Upload date:
- Size: 337.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c30f2536c893d26e3d243380464d4adbd6f7f26507f318c7b96016ceacfcabe
|
|
| MD5 |
a2be7f812c1fe56f9e0cd9c24e3bdd2d
|
|
| BLAKE2b-256 |
d32a1382b17598320e492976b293abc7eae93172b8a13623e2975fd2f3e6facd
|