This publication provides the codes produced for the article "Temporally dynamic carbon dioxide and
methane emission factors for rewetted peatlands. Nature Communications Earth and Environment" by Aram Kalhori, Christian Wille, Pia Gottschalk, Zhan Li, Josh Hashemi, Karl Kemper, and Torsten Sachs (https://doi.org/10.1038/s43247-024-01226-9). In the article, the authors estimate the cumulative GHG emissions of a rewetted peatland in Germany using the long-term ecosystem flux measurements. They observe a source-to-sink transition of annual carbon dioxide (CO2) fluxes and decreasing trend of methane (CH4) emissions.
This software is written in R and MATLAB. Running the codes ([R files and .m files](Code)) and loading the data files ([CSV files and .mat files](Data)) requires the pre-installation of [R and RStudio] (https://posit.co/downloads/) and ([MATLAB]. The RStudio 2022.07.2 Build 576 version has been used for the R scripts. The land cover classification work was performed in QGIS, v.3.16.11-Hannover. Data were analyzed in both MATLAB and R and plots created with R (R Core Development Team 2020) in RStudio®.
The following external packages are required to be incorporated into the codes in order to run the provided codes:
"zyp" package; "missForest" package;"REddyProc" package and explained in detail in the README.
Files: Codes/Kalhori2023_SenSlopes_fig2.r
"zyp" package, Maintainer David Bronaugh <bronaugh@uvic.ca>
Depends R (>= 2.4.0), Kendall
License: LGPL-2.1
https://CRAN.R-project.org/package=zyp
Files: Codes/Kalhori2023_gapfillingMF_validation_figSI1.r
"missForest" package, Maintainer Daniel J. Stekhoven <stekhoven@stat.math.ethz.ch>
Depends randomForest,foreach,itertools
License: GPL (>= 2)
https://www.r-project.org, https://github.com/stekhoven/missForest
Files: Codes/Kalhori2023_NEEpartitioning.r
"REddyProc" package, Maintainer Thomas Wutzler <twutz@bgc-jena.mpg.de>
Depends R (>= 3.0.0), methods
Imports Rcpp, dplyr, purrr, rlang, readr, tibble, magrittr, solartime, bigleaf (>= 0.7)
License: GPL (>= 2)
https://cran.r-project.org/web/packages/REddyProc/index.html
Data are provided as .shp, CSV or text files. The MATLAB scripts for footprint calculation and the R scripts used for gapfilling (missForest) and flux partitioning (REddyProc) are also included.The full description of the data and methods is provided in the manuscript.
The data provided here is an exemplary dataset for the flux site Zarnekow from one year (2018). The complete dataset that is needed to run the codes for all the years can be obtained from the European Fluxes Database Cluster under site ID DE-Zrk (Sachs et al., 2016) or provided upon request. This repository is intended to provide the necessary MATLAB and R code to reproduce the results by Kalhori et al. (2024).
The data are provided as zip folder containing (1) a csv file with associated definition of variables and units (file: 2023-004_Kalhori-et-al_README_2018_units.txt), (2) a shapefile (file: 2023-004_Kalhori-et-al_2018_LAiV_DOP.shp) and (3) a Geotiff (file: 2023-004_Kalhori-et-al_2018_LAiV_DOP.tiff).
In addition, we provide a second zip folder containing the data that produced the figures of the related article (Kalhori et al., 2024, https://doi.org/10.1038/s43247-024-01226-9).