sidfex.remaptime.obs2fcst: Remap SIDFEx Observations to Forecasts in Time

sidfex.remaptime.obs2fcstR Documentation

Remap SIDFEx Observations to Forecasts in Time

Description

Remap SIDFEx observations temporally to forecast times, with linear or nearest-neighbour interpolation.

Usage

sidfex.remaptime.obs2fcst(obs=NULL,fcst,method="linear",extrapolate=FALSE,return.remapinfo=FALSE,data.path=NULL,verbose=TRUE)

Arguments

obs

a list with SIDFEx observations as returned by sidfex.read.obs, or NULL (default). In the latter case, sidfex.read.obs is used to read the required observations.

fcst

a list with SIDFEx forecasts as returned by sidfex.read.fcst.

method

a character specifying which method to use for interpolation (and extrapolation). Valid methods are 'linear' (default) and 'nearestneighbour'.

extrapolate

a logical value specifying whether or not to extrapolate observations to times outside of the observational time range. Default is FALSE.

return.remapinfo

a logical value specifying whether or not to include information on the time remapping (indices and weights of respective earlier and later neighbour points, plus the vector obs.DaysLeadTime) in the return value. Mainly for debugging; default is FALSE.

data.path

NULL or a character specifying the directory of the forecast data. If NULL, it is attempted to source a file named .SIDFEx in the home directory where a character variable data.path.fcst needs to be defined.

verbose

a logical value specifying whether to produce warnings, in particular when new time axes reach outside original time axes. Default is TRUE.

Value

A list with two entries, the first of which named 'remaptime.obs2fcst' returns the arguments provided for 'method' and 'extrapolate'. The second entry named 'res.list' is a list with one entry for each forecast provided in 'fcst$res.list', with observed coordinates and, if provided, values (BP, Ts, TA, ...) interpolated to forecast times.

Note

This function is used to evaluate SIDFEx forecasts, e.g., in sidfex.plot.speedangle.

Would be good to add parameters interpolate.maxdist and extrapolate.maxdist to determine how far (in time) interpolation and extrapolation are done, so that, if the time difference is larger, the resulting data points will be NA.

Author(s)

Helge Goessling

See Also

sidfex.read.fcst, sidfex.read.obs, sidfex.plot.speedangle


helgegoessling/SIDFEx documentation built on March 15, 2024, 2:26 p.m.