interpolate_DWD: interpolate_DWD

View source: R/interpolate_DWD.R

interpolate_DWDR Documentation

interpolate_DWD

Description

This is a function to interpolate the DWD data downloaded. The meteorological variables are point values and coordinates converted to a grid based on raster.

Usage

interpolate_DWD(
  var_DWD,
  stations_DWD,
  res_utm,
  radius_km,
  crop_extent,
  vgm_model = c("Exp", "Mat", "Gau", "Sph")
)

Arguments

var_DWD

a numeric vector with the DWD values per station and timestamp

stations_DWD

the coordination of the DWD station

res_utm

resolution of the final raster

radius_km

the distance used in the get_dwd data to select the stations

crop_extent

the extent of the area to crop

vgm_model

the variagram theoretical model, default "Sph"

Value

stack raster with the climatological variable interpolated in space and time

Examples

# air temperature

krg_Ta <- lapply(1:n, FUN = function(i) Interp_DWD(var_DWD = as.numeric(Air_temp[[1]][i,-1]),
            stations_DWD = Air_temp[[2]],
            res = st_grid,
            crop_extent = raster::extent(Berlin_border_utm)));

krg_Ta[[1]];
plot(krg_Ta[[1]]);


AlbyDR/rSCOPE documentation built on Dec. 19, 2024, 7:29 p.m.