sadcorrect: correct structure errors

Description Usage Arguments Details Value Examples

View source: R/sadcorrect.R

Description

use the inverse 'dtcwt' to correct errors in scale, anisotropy and direction

Usage

1
2
sadcorrect(x, xmin = 0.1, log = TRUE, rsm = 0, Nx = NULL,
  Ny = NULL, J = NULL, boundaries = "pad", direction = TRUE)

Arguments

x

a list of equally sized matrices, the first element is assumed to be the observation

xmin

values smaller than xmin are set to zero

log

logical, do you want to log-transfrom the data? (recommended for precipitation)

rsm

number of pixels which are linearly smoothed at the edge

Nx

size to which the data is extended in x-direction, has to be a whole power of 2

Ny

size to which the data is extended in y-direction, has to be a whole power of 2

J

largest scale considered

boundaries

how to handle the boundary conditions, either "pad", "mirror" or "periodic"

direction

if TRUE, scale and direction are corrected, otherwise only scale

Details

The algorithm performs the following steps:

  1. remove values below xmin

  2. if log=TRUE log-transform all fields

  3. set all fields to zero mean, unit variance

  4. apply dtcwt to all fields

  5. loop over forecasts and scales. If direction=TRUE loop over the six directions. Multiply forecast energy at each location by the ratio of total observed energy to total forecast energy at that scale (and possibly direction)

  6. apply idtcwt to all forecasts

  7. reset means and variance of the forecasts to their original values

  8. if log=TRUE invert the log-transform

  9. return the list of corrected fields

Value

an object of class sadforecast

Examples

1
2
3
4
data(rrain)
ra   <- as.sadforecast( list( rrain[2,1,,], rrain[3,1,,], rrain[3,2,,], rrain[3,3,,] ) )
ra_c <- sadcorrect( ra, rsm=10 )
plot(ra_c)

sad documentation built on Nov. 8, 2020, 4:25 p.m.

Related to sadcorrect in sad...