GithubHelp home page GithubHelp logo

geco-bern / get_vcmax_data Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pepaaran/get_vcmax_data

0.0 1.0 0.0 1.32 MB

Workflow to obtain the leaf traits data and corresponding climate forcing to calibrate the P-model in rsofun

License: GNU Affero General Public License v3.0

R 100.00%

get_vcmax_data's Introduction

Get Vcmax25 data to run P-model

This repository contains the code used to retrieve the Vcmax25 data used for validation of the P-model as implemented in rsofun. Furthermore, it creates the respective forcing data to run the P-model, either from the WorldClim dataset (resulting dataset is incomplete to run the P-model) or from WATCH-WFDEI + others (see this vignette for details). The final products are two rsofun nested dataframes, the drivers and validation Vcmax25 data.

The following code creates the objects p_model_drivers_vcmax25 and p_model_validation_vcmax25 from the raw data:

# Load libraries
library(dplyr); library(tidyr);
library(tibble); library(raster);
if(!require(devtools)){install.packages("devtools")}
devtools::install_github("pepaaran/ingestr")
library(ingestr)

# Load functions
source("R/read_vcmax25.R")
source("R/create_siteinfo.R")
source("R/aggregate_growingseasonmean.R")
source("R/format_forcing.R")
source("R/format_validation.R")
source("R/get_vcmax_data_rsofun.R")

# Get Vcmax25 data + average year forcing
get_vcmax_data_rsofun(
  source = "watch-wfdei"
) # Use default data archive file paths

# The outputs are saved in the `data` directory

# Incomplete: Get Vcmax25 data + WorldClim drivers into rsofun format
# using the data archive structure on the GECO workstations
get_vcmax_data_rsofun(
  source = "worldclim",
  file_vcmax = "data-raw/GlobResp database_Atkin et al 2015_New Phytologist.csv",
  path_worldclim = "/data/archive/worldclim_fick_2017/data"
)

The WorldClim data can be obtained from https://worldclim.org/data/worldclim21.html and the GlobResp leaf traits data from Atkin et al. 2015 via the TRY database. Other data sources are described in the GECO data archive repository.

The ingestr package is used extract forcing data for the leaf trait sites and the data aggregation follows the instructions in the Run the P-model for point simulations vignette. The data formatting functions are inspired by the FluxDataKit package. This vignette goes through the workflow implemented in the functions used above, step by step.

Structure

The structure of the repository is as follows:

The R folder

The R folder contains all R functions used to read, aggregate and format data. The function get_vcmax_data_rsofun() is a wrapper of all other functions and can be used to run the entire workflow, from the raw data path to the final objects p_model_drivers_vcmax25 and p_model_validation_vcmax25.

The data-raw folder

The data-raw folder may be used to store the data files downloaded from the web. In the GECO lab, the WorldClim data are available in our data archive (documented here. The data from Atkin et al. 2015 are stored in data-raw but not pushed to this repository (this folder is in the .gitignore).

The data folder

The data folder contains the output from the data processing. The objects p_model_drivers_vcmax25 and p_model_validation_vcmax25 are stored here. Optionally, the intermediate objects created while ingesting the data are saved into intermediate_data.RData and can be used for analysis.

The renv folder

This folder contains the files used by renv to manage the R packages used in this repository. The renv.lock file contains information of the packages currently used in the project and their version.

The analysis folder

It contains R markdown files that explore the Vcmax25 data from GlobResp.

get_vcmax_data's People

Contributors

pepaaran avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.