This function extracts events from a three-dimensional (2D spatial x 1D time) data stream.

get_clusters_3d(dat, thres = 0.95, epsilon = 3, miniPts = 15)

Arguments

dat

The data matrix

thres

The cut-off quantile. Default is set to 0.95. Values greater than the quantile will be clustered. The rest is not clustered.

epsilon

The eps parameter in dbscan function in the package dbscan

miniPts

The minPts parameter in dbscan function in the package dbscan

Value

A list with following components

clusters

The cluster assignment according to DBSCAN output.

data

The data of this cluster assignment.

Examples

set.seed(1)
arr <- array(rnorm(12000),dim=c(40,25,30))
arr[25:33,12:20, 20:23] <- 10
# getting events
out <- get_clusters_3d(arr, thres=0.985)
# plots
oldpar <- par(mfrow=c(1,3))
plot(out$data[,c(1,2)], xlab="x", ylab="y", col=as.factor(out$clusters$cluster))
plot(out$data[,c(1,3)], xlab="x", ylab="z",col=as.factor(out$clusters$cluster))
plot(out$data[,c(2,3)], xlab="y", ylab="z",col=as.factor(out$clusters$cluster))

par(oldpar)