rfweights: Derive weights from a fine-scale precipitation climatology

Description Usage Arguments Value Author(s) References Examples

View source: R/rfweights.R

Description

Weights for downscaling are computed interpolating a fine-scale climatology to the target grid and dividing it by an averaged version of itself. A suitable climatology could be represented for example by a fine-scale precipitation climatology from a high-resolution regional climate model (see e.g. Terzago et al. (2018) doi: 10.5194/nhess-18-2825-2018), a local high-resolution gridded climatology from observations, or a reconstruction such as those which can be downloaded from the WORLDCLIM or CHELSA websites. The latter data could be converted to NetCDF format using for example the GDAL tools.

Usage

1
rfweights(z, lon, lat, lonc, latc, nf, fsmooth = TRUE)

Arguments

z

matrix with a spatial field of fine-scale precipitation climatology.

lon

vector of longitudes of the high-resolution climatology

lat

vector of latitudes of the high-resolution climatology

lonc

vector of longitudes of the coarse field to downscale

latc

vector of latitudes of the coarse field to downscale

nf

refinement factor for downscaling (the coarse resolution is increased by this factor). The number of longitudes and latitudes is expected to be equal.

fsmooth

logical to compute weights against a smooth average. If false box averaging is used.

Value

The matrix of weights with dimensions c(lonc*nf, latc*nf)

Author(s)

Jost von Hardenberg, j.vonhardenberg@isac.cnr.it

References

Terzago, S. et al. (2018). NHESS 18(11), 2825<e2><80><93>2840 doi: 10.5194/nhess-18-2825-2018.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Make synthetic fine-scale precipitation climatology
z <- exp(metagauss(initmetagauss(1.7, 64)))
# Specify lon and lat of the input
lon <- seq(10,17.875,0.125)
lat <- seq(40,47.875,0.125)
# Specify lon and lat of the coarse field and the downscaling factor
lonc <- seq(12,15.5,0.5)
latc <- seq(42,45.5,0.5)
nf <- 4
ww <- rfweights(z, lon, lat, lonc, latc, nf) 

rainfarmr documentation built on May 1, 2019, 8:02 p.m.