currycarbon-0.1.1.0: A package for simple, fast radiocarbon calibration
Safe HaskellNone
LanguageHaskell2010

Currycarbon.Calibration.Calibration

Synopsis

Calibration functions

getRelevantCalCurveSegment :: UncalC14 -> CalCurveBP -> CalCurveBP Source #

Take an uncalibrated date and a raw calibration curve and return the relevant segment of the calibration curve

prepareCalCurveSegment :: Bool -> CalCurveBP -> CalCurveBCAD Source #

Modify a calibration curve (segment) with multiple optional steps, including interpolation and transforming dates to BC/AD format

makeCalCurveMatrix :: UncalPDF -> CalCurveBCAD -> CalCurveMatrix Source #

Construct a matrix representation of a calibration curve for a given date

uncalToPDF :: UncalC14 -> UncalPDF Source #

Transform an uncalibrated date to an uncalibrated probability density table

calibrateDates Source #

Arguments

:: CalibrateDatesConf

Configuration options to consider

-> CalCurveBP

A calibration curve

-> [UncalC14]

A list of uncalibrated radiocarbon dates

-> [Either CurrycarbonException CalPDF]

The function returns a list for each input date, with either an exception if the calibration failed for some reason, or a CalPDF

Calibrates a list of dates with the provided calibration curve

refineCalDates :: [CalPDF] -> [CalC14] Source #

Transforms the raw, calibrated probability density table to a meaningful representation of a calibrated radiocarbon date

>>> :{
  let years = VU.fromList [-3000,-2900,-2800,-2700,-2600]
      densities = VU.fromList [0.1,0.2,0.3,0.2,0.1]
  in refineCalDates [CalPDF {_calPDFid = "", _calPDFCals = years, _calPDFDens = densities}]
:}
[CalC14 {_calC14id = "", _calC14HDROneSigma = [HDR {_hdrstart = -2800, _hdrstop = -2900}], _calC14HDRTwoSigma = [HDR {_hdrstart = -2600, _hdrstop = -3000}]}]

data CalibrateDatesConf Source #

A data type to cover the configuration options of the calibrateDates function

Constructors

CalibrateDatesConf 

Fields

defaultCalConf :: CalibrateDatesConf Source #

A default configuration that should yield almost identical calibration results to the Bchron R package

>>> defaultCalConf
CalibrateDatesConf {_calConfMethod = Bchron {distribution = StudentTDist {ndf = 100.0}}, _calConfAllowOutside = False, _calConfInterpolateCalCurve = True}