Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
gisma committed Sep 5, 2024
1 parent c3b49fd commit b3524e9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions mc_session/mc3.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,12 @@ Please download the data from the repository or take the USB-stick
# load packages (if not installed please install)
install.packages("remotes")
pkg_list = c("raster","terra","sp","sf","dplyr","lwgeom","readxl","highfrequency","tidyverse","rprojroot","tibble","imputeTS","xts","data.table","mapview","stars","gstat")
pkg_list = c("raster","terra","sp","sf","dplyr","lwgeom","readxl","highfrequency","tidyverse","rprojroot","tibble","imputeTS","xts","data.table","mapview","stars","gstat","tmap")
remotes::install_cran(pkg_list)
lapply(pkg_list, require, character.only = TRUE)
# create a string containing the current working directory
wd=paste0(find_rstudio_root_file(),"/data_2023/")
wd=paste0(find_rstudio_root_file(),"/data_2024/")
# define time period to aggregate temp dat
time_period = 1
Expand Down Expand Up @@ -332,6 +332,7 @@ fn_area =paste0(wd,"plot.shp")
cleandata = paste0(wd,"climdata.RDS")
```


```{r read_clean_data, message=FALSE, warning=FALSE}
# 1 ---- read data ----
# read_sf("data/de_nuts1.gpkg") |> st_transform(crs) -> de
Expand Down Expand Up @@ -508,7 +509,7 @@ tmap_arrange(tm_interpNN, tm_interpIDW, tm_idw_gstat,tm_vor,tm_krige)
# for all time slots
for (var in vars[7:8]){
for (var in vars[15:18]){
# autofit variogramm for kriging
vm.auto = automap::autofitVariogram(formula = as.formula(paste("altitude", "~ 1")),
input_data = m)
Expand All @@ -520,7 +521,7 @@ for (var in vars[7:8]){
vm.auto$var_model)
plot(k)
# save to geotiff
stars::write_stars(k,paste0(wd,var,"v_interpol.tif"),overwrite=TRUE)
#stars::write_stars(k,paste0(wd,var,"v_interpol.tif"),overwrite=TRUE)
}
Expand Down

0 comments on commit b3524e9

Please sign in to comment.