Learn R Programming

SpatialVx (version 0.1-2)

convthresh: Convolution threshold feature identification

Description

Identify features within a field via thresholding a convolution-smoothed version of the field.

Usage

convthresh(object, smoothfun = "disk2dsmooth", smoothpar = 1, smoothfunargs = NULL, thresh = 1e-08, idfun = "disjointer", zero.down = FALSE, ...)
salIDfun(object, fac = 0.06666667, q = 0.95, wash.out = NULL, thresh = NULL, idfun = "disjointer", ...)
disjointer(x, method = "C")

Arguments

object
list object of class "FeatureSuitePrep" as returned by FeatureSuitePrep. Not used by disjointer (there for compatibility).
x
binary matrix identifying event points.
smoothfun
character naming a convolution smoothing function that takes argument x (the field to be smoothed, not the same as the argument to disjointer) and a smoothing parameter as the first two arguments. Other arguments are allowed, an
smoothpar
single numeric giving the smoothing parameter for smoothfun.
smoothfunargs
list object with named additional arguments to smoothfun.
fac
numeric giving a factor by which to multiply the R quantile in determining the threshold from the fields. Default is to multiply by ~ 1/15 as in Wernli et al (2008, 2009). This is not used if thresh is supplied.
thresh
numeric vector of length one or two giving the threshold over which (and including, i.e., >=) events are defined. If different thresholds are used for the forecast and verification fields, then the first element is the threshold for the forecast, and the
q
If thresh is NULL, then this is the quantile used to deterimne the thresholds for the two fields.
idfun
character naming the function used to identify (and label) individual features in the convolved and thresholded field. Must take argument x, which is the convolved and thresholded (binary) field.
wash.out
(optional) numeric giving a lower threshold over which the quantile for determining the threshold should be found. If NULL, this is not performed. Only used if thresh is NULL.
zero.down
logical, should negative values and relatively very small values be set to zero after smoothing the fields? For thresholds larger than such values, this argument is moot. zapsmall is used to set the very small positive values to zero.
method
character giving the connected components algorithm to be used in function connected from spatstat.
...
additional arguments to idfun.

Value

  • convthresh and salIDfun return a list object with comopnents:
  • X.feats,Y.featsThe identified features for the verification and forecast fields as returned by the idfun function.
  • X.labeled,Y.labeledmatrices of same dimension as the forecast and verification fields giving the images of the convolved and thresholded verification and forecast fields, but with each individually identified object labeled 1 to the number of objects in each field.

Details

The convolution threshold technique is a simple way of identifying features (referred to as objects in image analysis circles where features are the attributes thereof) within a field. First, the field is smoothed using a convolution smoother, and then it is set to a binary image where everything above a given threshold is set to one. Individual features are identified through any choice of function given by idfun. The default is to use a connected components algorithm using the spatstat function connected.

This is the method used by Davis et al. (2006a,b).

References

Davis CA, BG Brown, and RG Bullock, 2006a. Object-based verification of precipitation forecasts, Part I: Methodology and application to mesoscale rain areas. Mon. Wea. Rev., 134, 1772--1784.

Davis CA, BG Brown, and RG Bullock, 2006b. Object-based verification of precipitation forecasts, Part II: Application to convective rain systems. Mon. Wea. Rev., 134, 1785--1795.

Wernli, H., M. Paulat, M. Hagen, and C. Frei, 2008. SAL--A novel quality measure for the verification of quantitative precipitation forecasts. Mon. Wea. Rev., 136, 4470--4487.

Wernli, H., C. Hofmann, and M. Zimmer, 2009. Spatial forecast verification methods intercomparison project: Application of the SAL technique. Wea. Forecasting, 24, 1472--1484, DOI: 10.1175/2009WAF2222271.1

See Also

connected, as.im, tess, tiles, owin, FeatureSuite, FeatureSuitePrep

Examples

Run this code
x <- y <- matrix(0, 10, 12)
x[2:3,c(3:6, 8:10)] <- 1
y[c(4:7, 9:10),c(7:9, 11:12)] <- 1

hold <- FeatureSuitePrep("y", "x")
look <- convthresh( hold, smoothpar=0.5)
length( look$X.feats) # two objects in x.
length( look$Y.feats) # four ovjects in y.
plot( look$X.feats)
plot( look$Y.feats)

data(pert000)
data(pert004)
hold <- FeatureSuitePrep("pert004", "pert000")
look <- convthresh( hold, smoothpar=3.5)
length(look$X.feats)
length(look$Y.feats)
image.plot(look$sIx)
image.plot(look$sIy)

Run the code above in your browser using DataLab