adjustQPE: Adjust hourly QPE.

Description Usage Arguments

View source: R/adjustQPE.R

Description

Adjust hourly QPE using AWS data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
adjustQPE(
  start_time,
  end_time,
  aws_data,
  qpe_data,
  qpe_adjust,
  pars_adjust = list(method = "Additive"),
  padxy = c(2, 2),
  fun_sp_aggr = "median",
  min_aws = 5,
  min_val = 0.1,
  time_zone = "Africa/Kigali",
  ncInfo = list(ilon = 1, ilat = 2, varid = "precip")
)

Arguments

start_time, end_time

The start and end time same time zone as time_zone, format "YYYY-mm-dd HH:MM"

aws_data

aws data obtained from awsGetHourlyPrecip
A named list of coordinates (list name "coords"), dates (list name "date") and the data (list name "data")

  • coordinates: a data.frame with column names "id", "longitude" and "latitude"

  • dates: a vector of dates in the format "YYYYmmddHH" in local time

  • data: a matrix with row number equals to the length of dates and column number equals to the length of coordinates

Ex: list(coords = data.frame(id , longitude, latitude), date = vector, data = matrix(nrow = length(date), ncol = nrow(coords)))

qpe_data

named list, directory containing the input netCDF files and the format of the netCDT file names
Ex: list(dir = "directory/full/path", format = "precip_%s%s%s%s.nc")

qpe_adjust

named list, directory to save the adjusted QPE and the format of the netCDT file names
Ex: list(dir = "directory/full/path", format = "precip_adj_%s%s%s%s.nc")

pars_adjust

named list of the method to be used (list name "method") and other parameters for the adjustment and interpolation (list name "pars").
The available methods are "Additive", "Multiplicative", "Mixed", "MeanFieldBias" or "KED".

  • "Additive": adjustment using an additive error model.
    Default list(method = "Additive").
    pars can be omitted or list of arguments
    to be passed to the function krige of the package gstat
    Ex: list(method = "Additive", pars = list(nmin = 3, nmax = 8))

  • "Multiplicative": adjustment using a multiplicative error model.
    pars can be omitted or list of arguments
    to be passed to the function krige of the package gstat
    Ex: list(method = "Multiplicative", pars = list(nmin = 3, nmax = 8))

  • "Mixed": adjustment using a mixed (additive and multiplicative) error model.
    pars can be omitted or list of arguments
    to be passed to the function krige of the package gstat
    Ex: list(method = "Mixed", pars = list(nmin = 3, nmax = 8))

  • "MeanFieldBias": adjustment using one correction factor for the entire domain (Mean Field Bias correction).
    If pars is omitted the default is list(method = "linear", minslope = 0.1, minr = 0.5, maxp = 0.01)
    pars has the following items:
    "method": the method used to compute the mean bias fields. Options are "linear", "mean", "median"
    When using method = "linear" three additional parameters are needed.
    "minslope": minimum allowable slope
    "minr": minimum allowable correlation
    "maxp": maximim allowable p-value
    Ex: list(method = "MeanFieldBias", pars = list(method = "median"))

  • "KED": adjustment using a Kriging with external drift.
    pars can be omitted or contains a vector candidates of variogram to be fitted to the data, list(models = c("Sph", "Exp", "Gau"))
    Ex: list(method = "KED", pars = list(models = c("Sph", "Exp", "Gau"), nmin = 3, nmax = 8))

padxy

vector of length 2 representing the number of pixels to be extracted, then aggregated, to get the value of the target pixel.

  • first element: number of pixels to the left and to the right

  • second element: number of pixels above and and below

fun_sp_aggr

character, function to be used to aggregate the values of the matched pixels from padxy.
Ex: "mean" or "median". Default "median".

min_aws

minimum number of AWS. If the number of AWS with non missing values is less than min_aws, no adjustment will be performed.

min_val

minimum value. Only the value greater or equal to min_val will be used.
For the Additive and KED can be 0, otherwise it must be greater than 0

time_zone

the time zone of start_time, end_time, the input and output QPE.
Options: "Africa/Kigali" or "UTC". Default "Africa/Kigali"

ncInfo

named list, order of the longitude and latitude dimension in the input netCDF data and the name of the variable.
Default list(ilon = 1, ilat = 2, varid = "precip")


rijaf-iri/mtorwdata documentation built on March 9, 2021, 6:36 a.m.