RBBGCMuso/docs/CIRM/README.md
2022-04-07 14:24:23 +02:00

1.5 KiB

This is a si

Preparations

Loading the RBBGCMuso package and the necessary functions

library(RBBGCMuso)
source("make_individual_trees.R") # The DT creation and update algorithms
source("glue.R") # GLUE optimizer algorithms

The file containing the path to the observation files (Martonvasar_maize.obs), and the parameter intervals (Martonj)

Reading the observations

The mean yield had to be adjust. see in art.

measureFile <- "Martonvasar_maize.obs"
measurements <- read.csv2(measureFile, stringsAsFactors=FALSE)
measurements$mean <- measurements$mean / 10000 * 0.85
measurements$sd <- measurements$sd / 10000 * 0.85

Define conditioning functions

constraints.json

{
    "constraints": [

        {
            "Expression": "SELECT(harvest_index, max)|median",
            "Min": 0.45,
            "Max": 0.55
        },
        {
            "Expression": "SELECT(proj_lai, max)|quantile(.,0.5)",
            "Min": 2.7,
            "Max": 5
        },
        {
            "Expression": "SELECT(rootdepth5, max)|quantile(.,0.5)",
            "Min": 1.40,
            "Max": 1.80
        },			
        {
            "Expression": "SELECT(flower_date, max)|quantile(.,0.5)",
            "Min": 180,
            "Max": 190 
        }
    ],

    "treshold": 80
}
constraints <- jsonlite::read_json("constraints.json",simplifyVector=TRUE)

Cal file:


Martonvasar_maize.obs
Martonvasar_maize.set
site
Martonvasar_maize;211