-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsensitivity.Rmd
71 lines (51 loc) · 1.52 KB
/
sensitivity.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
title: "MCT sensitivity analyses"
author: "Beni Stocker"
date: "2/15/2021"
output: html_document
---
```{r setup}
library(tidyverse)
library(segmented)
source("R/calc_cwd_lue0_v2.R")
source("R/calc_cwd_lue0_byilon.R")
source("R/calc_cwd_et0_byilon.R")
# source("R/selgmented.R")
# source("R/pscore.test.R")
```
## Change point detection
Perform change point detection in SIF ~ CWD regression.
```{r}
## get data for one longitude slice, based on SIF
calc_cwd_lue0_byilon(5000, drop_data = FALSE, dirn = "~/mct/data/df_cwd_lue0_2")
load("~/mct/data/df_cwd_lue0_2/df_cwd_lue0_5000.RData")
## get data for one longitude slice, based on EF
calc_cwd_et0_byilon(5000, drop_data = FALSE, dirn = "~/mct/data/df_cwd_et0_2/")
load("~/mct/data/df_cwd_et0_2/df_cwd_et0_5000.RData")
```
Look at one cell.
```{r}
# df$lat %>% sort()
# caused problem: 18.175
df_data <- df %>%
filter(lat == 37.175) %>%
select(data) %>%
unnest(data)
df_inst <- df %>%
filter(lat == 37.175) %>%
select(data_inst) %>%
unnest(data_inst)
# # out <- calc_cwd_lue0(df_data, df_inst, nam_lue = "SIF", do_plot = TRUE)
# out <- calc_cwd_lue0(df_data, df_inst, nam_lue = "et", do_plot = TRUE)
# out$gg
#
# # out <- calc_cwd_lue0(df_data, df_inst, nam_lue = "nSIF", do_plot = TRUE)
# out <- calc_cwd_lue0(df_data, df_inst, nam_lue = "fet", do_plot = TRUE)
# out$gg
```
Steps above are now implemented as
```{r}
out <- calc_cwd_lue0(df = df_data, inst = df_inst, nam_lue = "fet", do_plot = TRUE, verbose = TRUE)
out$gg + ylim(0,0.6)
out$cwd_lue0
```