• shareshare
  • link
  • cite
  • add
auto_awesome_motion View all 4 versions
Research software . Software . 2019

MATLAB scripts to produce OxCal chronologies for SISAL database (scripts V1)

Amirnezhad-Mozhdehi, Sahar; Comas-Bru, Laia;
Open Access
Published: 20 Dec 2019
Publisher: Zenodo

These MATLAB scripts are developed for creating OxCal (Bronk Ramsey 2009) age models for a large number of speleothems from SISAL database. These scripts are created using MATLAB 2019 and are designed to work with current version of OxCal (4.3). These scripts have been tested with SISALv2 (UoR link (, Comas-Bru et al 2020 (under review, In order to assure traceability, any presentation, report, or publication that uses the automated OxCal scripts should cite ZENODO, UoR LINK and Database paper. These scripts are licensed by the rights-holder(s) under a Creative Commons Attribution 4.0 International Licence: A short description of all steps and the scripts and functions involved in each step are given below. For more detailed instructions and examples please read the Introduction, Notes, Instructions and naming conventions sections at the beginning of each MATLAB code (*.m file). For questions please contact STEP 1) creating the input files for OxCal using script "SISAL_1_OxCal_Input_Generator_v1.m" This script queries the SISAL database, removes records that are not suitable for creating age models and cleans the data. Then it translates the chronological data from SISAL database format into the Chronological Query Language (CQL2) notation of OxCal and writes them into an OxCal input file which is named by the entity ID (EID) from SISAL database (EID.oxcal). STEP 2) running the OxCal program for all the oxcal input files that were created in the previous step using "SISAL_2_OxCal_cmdline_batch_executor_v1.m" This script makes a list of all the *.oxcal files in the given directory and runs the OxCalWin.exe (available for download from for all of them. This step results in 4 other files for each entity: -EID.log which contains a text version of the output -EID.txt - which contains a tab delimited tabular output -EID.js - which is the ECMA-Script encoded version of the output used by the OxCal output viewer and the code in step 3 -ensembles_EID.csv - which is the age ensemble for that entity STEP 3) extracting the age depth model and quality metrics from V.js file using script "SISAL_3_OxCal_Output_Extractor_v1.m" and function "grep.m" (available for download from This script extracts all the necessary data and metadata of the age depth model from all the *.js files and tabulates and reports them. It also interpolates the age depth model for the isotope depths for each entity from SISAL database to produce the proxy chronologies. This script can also produce age depth plots and isotope timeseries plots for each entity for comparison of SISAL OxCal chronologies with the original chronologies. STEP 4) extracting and post-processing the ensemble files ensembles_EID.csv using script "SISAL_4_OxCal_ensemble_interpolator_v1.m" and function "ensembleseader0.m" This step is only necessary for extraction of ensembles. This script reads the ensemble file for each entity, trims it to keep only the last 2000 iterations, corrects the age reference from CE/BCE back to BP (where present is 1950 CE) and then interpolates the age depth model for the isotope depths.

{"references": ["Comas-Bru, L., Rehfeld, K., Roesch, C., Amirnezhad-Mozhdehi, S., Harrison, S. P., Atsawawaranunt, K., Ahmad, S. M., Ait Brahim, Y., Baker, A., Bosomworth, M., Breitenbach, S. F. M., Burstyn, Y., Columbu, A., Deininger, M., Dem\u00e9ny, A., Dixon, B., Fohlmeister, J., Hatvani, I. G., Hu, J., Kaushal, N., Kern, Z., Labuhn, I., Lechleitner, F. A., Lorrey, A., Martrat, B., Novello, V. F., Oster, J., P\u00e9rez-Mej\u00edas, C., Scholz, D., Scroxton, N., Sinha, N., Ward, B. M., Warken, S., Zhang, H., and the SISAL members: SISALv2: A comprehensive speleothem isotope database with multiple age-depth models, Earth Syst. Sci. Data Discuss.,, in review, 2020.", "Atsawawaranunt, K., Comas-Bru, L., Amirnezhad Mozhdehi, S., Deininger, M., Harrison, S. P., Baker, A., Boyd, M., Kaushal, N., Ahmad, S. M., Ait Brahim, Y., Arienzo, M., Bajo, P., Braun, K., Burstyn, Y., Chawchai, S., Duan, W., Hatvani, I. G., Hu, J., Kern, Z., Labuhn, I., Lachniet, M., Lechleitner, F. A., Lorrey, A., P\u00e9rez-Mej\u00edas, C., Pickering, R., Scroxton, N., and SISAL Working Group Members: The SISAL database: a global resource to document oxygen and carbon isotope records from speleothems, Earth Syst. Sci. Data, 10, 1687\u20131713,, 2018.", "Bronk Ramsey, C. (2009). Bayesian analysis of radiocarbon dates. Radiocarbon, 51(1), 337-360.", "Bronk Ramsey, C. (2008). Deposition models for chronological records. Quaternary Science Reviews, 27(1-2), 42-60.", "Bronk Ramsey, C., & Lee, S. (2013). Recent and Planned Developments of the Program OxCal. Radiocarbon, 55(2-3), 720-730."]}

SISAL (Speleothem Isotopes Synthesis and Analysis) is a working group of the Past Global Changes (PAGES) programme. We thank PAGES for their support for this activity. Additional financial support for development of these scripts have been provided by Geological Survey Ireland Short Call grant number 2017-SC-056 and the ERC-funded project GC2.0 (Global Change 2.0: Unlocking the past for a clearer future, grant no. 694481).


SISAL, OxCal, age-depth model, palaeoclimatology, speleothems