Declusters a time series using a storm window approach
Decluster_SW.RdFind peaks with a moving window. The code is based on the IDEVENT function provided by Sebastian Solari.
Value
List comprising vectors containing the original time series Detrended, independent (declustered) events Declustered and the elements of the original series containing the declustered events EventID.
Examples
#Declustering the O-sWL at site S22 using a 3-day window.
v<-Decluster_SW(Data=S22.Detrend.df[,c(1:2)],Window_Width=7)
#> Warning: no non-missing arguments to max; returning -Inf
#> Warning: no non-missing arguments to max; returning -Inf
#> Warning: no non-missing arguments to max; returning -Inf
#> Warning: no non-missing arguments to max; returning -Inf
#> Warning: no non-missing arguments to max; returning -Inf
plot(as.Date(S22.Detrend.df$Date),S22.Detrend.df$Rainfall,pch=16)
points(as.Date(S22.Detrend.df$Date)[v$EventID],v$Event,col=2,pch=16)