Skip to content

Commit

Permalink
_
Browse files Browse the repository at this point in the history
  • Loading branch information
anna-boser committed Oct 26, 2021
1 parent e8c2c14 commit ada6f04
Show file tree
Hide file tree
Showing 10 changed files with 532 additions and 110 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file added .RDataTmp
Binary file not shown.
2 changes: 1 addition & 1 deletion .Rproj.user/3CD7143E/pcs/source-pane.pper
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"activeTab": 4,
"activeTab": 3,
"activeTabSourceWindow0": 0
}
2 changes: 1 addition & 1 deletion .Rproj.user/3CD7143E/sources/prop/1A32ABC9
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"source_window_id": "",
"Source": "Source",
"cursorPosition": "55,179",
"scrollLine": "22"
"scrollLine": "0"
}
2 changes: 1 addition & 1 deletion .Rproj.user/3CD7143E/sources/prop/36806DA6
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"source_window_id": "",
"Source": "Source",
"cursorPosition": "166,79",
"scrollLine": "151",
"scrollLine": "91",
"last_setup_crc32": ""
}
4 changes: 2 additions & 2 deletions .Rproj.user/3CD7143E/sources/prop/AF575C34
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"source_window_id": "",
"Source": "Source",
"cursorPosition": "616,74",
"scrollLine": "609",
"last_setup_crc32": "C7376491e0dce081",
"scrollLine": "0",
"last_setup_crc32": "",
"docOutlineVisible": "0"
}
Binary file modified risk_maps/.DS_Store
Binary file not shown.
86 changes: 43 additions & 43 deletions risk_maps/results/risk_map_figures.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -232,49 +232,6 @@ four_panel("air_temperature", limits = c(11,41))
<!-- four_panel("transmission_rates", limits = c(0,20)) -->
<!-- ``` -->

Maps of errors integrated
```{r}
get_error <- function(temp_raster, risk_function){
max_error_by_pixel <- function(temperature){
if (is.na(temperature)){
return(NA)
} else {
lower_bound <- temperature - (STANDARD_ERROR/(65-1))*1.96
upper_bound <- temperature + (STANDARD_ERROR/(65-1))*1.96
max <- optimize(risk_function, interval=c(lower_bound, upper_bound), maximum=TRUE)$objective
min <- optimize(risk_function, interval=c(lower_bound, upper_bound), maximum=FALSE)$objective
return(max - min)
}
}
values <- raster::values(temp_raster)
errors <- sapply(values, max_error_by_pixel)
values(temp_raster) <- errors
return(temp_raster)
}
plot(get_error(air_temp_raster, bite),
col = pal(50),
# xlim=c(0,55),
# ylim=c(-10,50),
# zlim=limits,
xlab="Longitude",
ylab = "Latitude")
title(TeX("Biting rate uncertainty ($day^{-1}$)"))
plot(get_error(air_temp_raster, transmit),
col = pal(50),
# xlim=c(0,55),
# ylim=c(-10,50),
# zlim=limits,
xlab="Longitude",
ylab = "Latitude")
title(TeX("Transmission probability uncertainty (%)"))
```


### Figure S3 - maps of errors
```{r erroes, echo = FALSE}
Expand Down Expand Up @@ -374,6 +331,49 @@ four_panel <- function(risk_function, limits){
}
```

Maps of errors integrated
```{r}
get_error <- function(temp_raster, risk_function){
max_error_by_pixel <- function(temperature){
if (is.na(temperature)){
return(NA)
} else {
lower_bound <- temperature - (STANDARD_ERROR/(65-1))*1.96
upper_bound <- temperature + (STANDARD_ERROR/(65-1))*1.96
max <- optimize(risk_function, interval=c(lower_bound, upper_bound), maximum=TRUE)$objective
min <- optimize(risk_function, interval=c(lower_bound, upper_bound), maximum=FALSE)$objective
return(max - min)
}
}
values <- raster::values(temp_raster)
errors <- sapply(values, max_error_by_pixel)
values(temp_raster) <- errors
return(temp_raster)
}
plot(get_error(air_temp_raster, bite),
col = pal(50),
# xlim=c(0,55),
# ylim=c(-10,50),
# zlim=limits,
xlab="Longitude",
ylab = "Latitude")
title(TeX("Biting rate uncertainty ($day^{-1}$)"))
plot(get_error(air_temp_raster, transmit),
col = pal(50),
# xlim=c(0,55),
# ylim=c(-10,50),
# zlim=limits,
xlab="Longitude",
ylab = "Latitude")
title(TeX("Transmission probability uncertainty (%)"))
```

#### Biting rates errors
```{r b_maps_e, echo = FALSE}
bite <- function(T){
Expand Down
546 changes: 484 additions & 62 deletions risk_maps/results/risk_map_figures.html

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ada6f04

Please sign in to comment.