Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- readCalibrationMethod :: String -> Either String CalibrationMethod
- parseCalibrationMethod :: Parser CalibrationMethod
- renderCalDatePretty :: Bool -> (NamedCalExpr, CalPDF, CalC14) -> String
- renderNamedCalExpr :: NamedCalExpr -> String
- renderExprID :: String -> String
- renderCalExpr :: CalExpr -> String
- renderTimeWindowBP :: TimeWindowBP -> String
- renderTimeWindowBCAD :: TimeWindowBCAD -> String
- parseTimeWindowBP :: Parser TimeWindowBP
- parseTimeWindowBCAD :: Parser TimeWindowBCAD
- addFun :: Parser CalExpr
- addOperator :: Parser CalExpr
- mulFun :: Parser CalExpr
- mulOperator :: Parser CalExpr
- parens :: Parser CalExpr
- factor :: Parser CalExpr
- term :: Parser CalExpr
- expr :: Parser CalExpr
- namedExpr :: Parser NamedCalExpr
- readNamedCalExprs :: String -> Either String [NamedCalExpr]
- readOneNamedCalExpr :: String -> Either String NamedCalExpr
- readNamedCalExprsFromFile :: FilePath -> IO [NamedCalExpr]
- renderUncalC14WithoutName :: UncalC14 -> String
- renderUncalC14 :: UncalC14 -> String
- readUncalC14FromFile :: FilePath -> IO [UncalC14]
- readUncalC14 :: String -> Either String [UncalC14]
- parseUncalC14 :: Parser UncalC14
- writeCalC14s :: FilePath -> [CalC14] -> IO ()
- writeCalC14 :: FilePath -> CalC14 -> IO ()
- appendCalC14 :: FilePath -> CalC14 -> IO ()
- renderCalC14ForFile :: CalC14 -> String
- renderCalC14s :: [CalC14] -> String
- renderCalC14 :: CalC14 -> String
- renderCalRangeSummary :: CalRangeSummary -> String
- renderYearBP :: YearBP -> String
- renderYearBCAD :: YearBCAD -> String
- renderHDRsForFile :: [HDR] -> [(String, String)]
- renderHDRForFile :: HDR -> (String, String)
- renderHDRs :: [HDR] -> String
- renderHDR :: HDR -> String
- writeCalCurveMatrix :: FilePath -> CalCurveMatrix -> IO ()
- renderCalCurveMatrix :: CalCurveMatrix -> String
- writeCalPDFs :: FilePath -> [CalPDF] -> IO ()
- writeCalPDF :: FilePath -> CalPDF -> IO ()
- appendCalPDF :: FilePath -> CalPDF -> IO ()
- renderCalPDFs :: [CalPDF] -> String
- renderCalPDF :: CalPDF -> String
- data PlotSymbol
- renderCLIPlotCalPDF :: Bool -> Int -> Int -> CalPDF -> CalC14 -> String
- writeCalCurve :: FilePath -> CalCurveBCAD -> IO ()
- renderCalCurve :: CalCurveBCAD -> String
- readCalCurveFromFile :: FilePath -> IO CalCurveBP
- readCalCurve :: String -> CalCurveBP
- parseCalCurve :: Parser [(YearBP, YearBP, YearRange)]
- parseCalCurveLine :: Parser (YearBP, YearBP, YearRange)
- comments :: Parser String
- writeRandomAgeSamples :: FilePath -> [RandomAgeSample] -> IO ()
- writeRandomAgeSample :: FilePath -> RandomAgeSample -> IO ()
- appendRandomAgeSample :: FilePath -> RandomAgeSample -> IO ()
- renderRandomAgeSamples :: [RandomAgeSample] -> String
- renderRandomAgeSample :: RandomAgeSample -> String
Parsing, rendering and writing functions
This module contains a number of functions to manage data input and output plumbing for different datatypes
:: Bool | Should the CLI plot be restricted to (boring) ASCII symbols? |
-> (NamedCalExpr, CalPDF, CalC14) | |
-> String |
Combine CalExpr
, CalPDF
and CalC14
to render pretty command line output
like this:
CalEXPR: [Ex2] (S1:5000±30BP + S2:5100±100BP) Calibrated: 4150BC >> 3941BC > 3814BC < 3660BC << 3651BC 1-sigma: 3941-3864BC, 3810-3707BC, 3667-3660BC 2-sigma: 4150-4148BC, 4048-3651BC ▁ ▒▁ ▁▁ ▁▁▁ ▁▒▒▁▒▒ ▁▁▒▒▒ ▒▒▒▒▒▒ ▁▁▒▒▒▒▒▁▁▁▁▒▒▒▒▒▒▁ ▁ ▁▁▁▁▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▁▒▁ ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▁▁▁▁▁▁▁▁ -4330 ┄──┬─────┬─────┬─────┬──────┬─────┬─────┬─────┬─────┄ -3530 > > ^ < ────── ──────── ── ─ ──────────────────────────
renderExprID :: String -> String Source #
renderCalExpr :: CalExpr -> String Source #
readNamedCalExprs :: String -> Either String [NamedCalExpr] Source #
renderUncalC14 :: UncalC14 -> String Source #
readUncalC14FromFile :: FilePath -> IO [UncalC14] Source #
Read uncalibrated radiocarbon dates from a file. The file should feature one radiocarbon date per line in the form "<sample name>,<mean age BP>,<one sigma standard deviation>", where <sample name> is optional. A valid file could look like this:
Sample1,5000,30 6000,50 Sample3,4000,25
writeCalC14s :: FilePath -> [CalC14] -> IO () Source #
Write CalC14
s to the file system. The output file is a long .tsv file with the following structure:
id hdrSigmaLevel hdrStartYearBCAD hdrStopYearBCAD Sample1 1 -3797 -3709 Sample1 1 -3894 -3880 Sample1 2 -3680 -3655 Sample1 2 -3810 -3700 Sample1 2 -3941 -3864 Sample2 1 -1142 -1130 Sample2 1 -1173 -1161 Sample2 1 -1293 -1194 Sample2 1 -1368 -1356 Sample2 2 -1061 -1059 Sample2 2 -1323 -1112 Sample2 2 -1393 -1334
renderCalC14ForFile :: CalC14 -> String Source #
renderCalC14s :: [CalC14] -> String Source #
renderCalC14 :: CalC14 -> String Source #
renderYearBP :: YearBP -> String Source #
renderYearBCAD :: YearBCAD -> String Source #
renderHDRs :: [HDR] -> String Source #
writeCalCurveMatrix :: FilePath -> CalCurveMatrix -> IO () Source #
writeCalPDFs :: FilePath -> [CalPDF] -> IO () Source #
Write CalPDF
s to the file system. The output file is a long .tsv file with the following structure:
id yearBCAD density ... Sample1 -1391 2.8917924e-4 Sample1 -1390 3.3285577e-4 Sample1 -1389 3.5674628e-4 Sample1 -1388 3.750703e-4 ... Sample2 -3678 1.8128564e-3 Sample2 -3677 1.9512239e-3 Sample2 -3676 2.0227064e-3 Sample2 -3675 2.095691e-3 ...
renderCalPDFs :: [CalPDF] -> String Source #
renderCalPDF :: CalPDF -> String Source #
writeCalCurve :: FilePath -> CalCurveBCAD -> IO () Source #
renderCalCurve :: CalCurveBCAD -> String Source #
readCalCurve :: String -> CalCurveBP Source #
writeRandomAgeSamples :: FilePath -> [RandomAgeSample] -> IO () Source #
Write RandomAgeSamples
s to the file system. The output file is a long .tsv file with the following structure:
id yearBCAD ... Sample1 -1221 Sample1 -1211 Sample1 -1230 Sample1 -1225 ... Sample2 -3763 Sample2 -3788 Sample2 -3767 Sample2 -3774 ...
writeRandomAgeSample :: FilePath -> RandomAgeSample -> IO () Source #
appendRandomAgeSample :: FilePath -> RandomAgeSample -> IO () Source #