Learn R Programming

SpatialVx (version 0.1-2)

saller: Functions to analyze features in a field (image)

Description

Functions to analyze features in a field (image) in conjunction, e.g., with the FeatureSuite function.

Usage

saller(x, object, y = NULL, matches = NULL, d = NULL)

Arguments

x
For saller x is a list object returned by convthresh or other feature identification function that returns a list with components X.feats, Y.feats (themselves lists with owin class objects d
object
A list object of class "FeatureSuitePrep" as returned by FeatureSuitePrep providing information about the original fields.
y
(optional) if not NULL, it is used instead of x, and otherwise has the same stucture thereof. When used with FeatureSuite, one might want to merge objects in one or both fields before calling the analysis function. If so,
matches
Not used by saller function. If matching of features between fields is required, this will be a two-column matrix describing which features from the forecast (first column) match to those of the verificaiton field (second column).
d
(optional) the SAL (saller) method requires division by the longest distance between two border points. If NULL, this is taken to be simply the length of the longest side.

Value

  • saller returns a list with components:
  • Anumeric giving the amplitude component.
  • Lnumeric giving the lcoation component.
  • Snumeric giving the structure component.

Details

saller: Computes S, A, and L of the SAL method introduced by Wernli et al. (2008).

References

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, doi: 10.1175/2008MWR2415.1.

See Also

FeatureSuite, centroid.owin, connected, tiles, tess, deltamm

Examples

Run this code
grid<- list( x= seq( 0,5,,100), y= seq(0,5,,100))
obj <- stationary.image.cov( grid=grid, V=cbind(c(0.25,0.15),c(0.45,0.75)), setup=TRUE)
look<- sim.rf(obj)
look2 <- sim.rf(obj)
look[look<0] <- 0
look2[look2<0] <- 0
q <- mean( c(c(look[look>0]),c(look2[look2>0])), na.rm=TRUE)

hold <- FeatureSuitePrep("look2", "look")
hold2 <- convthresh(hold, smoothpar=5, thresh=q)

if(!is.null(hold2$X.feats) & !is.null(hold2$Y.feats)) {
   N <- max(c(length(hold2$X.feats), length(hold2$Y.feats)), na.rm=TRUE)
   par(mfrow=c(1,2))
   image.plot(hold2$X.labeled, col=c("grey", rainbow(N)), zlim=c(0,N))
   image.plot(hold2$Y.labeled, col=c("grey", rainbow(N)), zlim=c(0,N))

   saller(hold2, hold)   
} # else try a lower threshold.

data(pert000)
data(pert004)
hold <- FeatureSuitePrep("pert004", "pert000")
look <- convthresh( hold, smoothpar=10.5)
par( mfrow=c(1,2))
zl <- range(c(c(look$X.labeled),c(look$Y.labeled)),finite=TRUE)
image.plot(look$X.labeled, zlim=zl)
image.plot(look$Y.labeled, zlim=zl)

look2 <- deltamm( look, verbose=TRUE)
image.plot(look2$X.labeled)
image.plot(look2$Y.labeled)

Run the code above in your browser using DataLab