mHM_extrapolMat: Simple extrapolation of 1D-arrays in invalid/border...

Description Usage Arguments Details Value Author(s) See Also Examples

Description

mHM_extrapolMat extrapolates matrix values in invalid and border locations, e.g. originating from meteorological input fields for mHM (netCDF format).

Usage

1

Arguments

data

matrix.

ext

radius within grid cells are extended, starting from valid values.

Details

Runing mHM the first time for some netCDF products (e.g. Spain02, E-OBS) the warning no meteorological input available for whole simulation domain will be printed. This function extrapolates grids in invalid locations within a radius given by the ext argument. Extrapolation is performed by a mean value of the surrounding cells of the invalid location.

Value

matrix.

Author(s)

Johannes Brenner johannes.brenner@ufz.de

See Also

mHM_extrapolNetCDF

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# read netcdf file minimum air temperature
pkg_path <- path.package("mHMr")
tmin_netcdf <- file.path(pkg_path, "data", "tmin.nc")
tmin_op <-  RNetCDF::open.nc(tmin_netcdf)
tmin <- RNetCDF::var.get.nc(tmin_op,"tmin")
image(tmin[,,1], zlim = c(2.5,4.5))

tmin1 <- mHM_extrapolMat(tmin[,,1], ext=1)
image(tmin1, zlim = c(2.5,4.5))

tmin2 <- mHM_extrapolMat(tmin[,,1], ext=2)
image(tmin2, zlim = c(2.5,4.5))

JBrenn/mHMr documentation built on May 7, 2019, 7:39 a.m.