Skip to contents

First function to use on discrete time-series. Returns a vector giving the position of every zero crossing within the time-series.

Usage

find_zeros(time, var, zero.lim = 5e-04, timeSplit = 10, return_n1n2 = FALSE)

Arguments

time

numeric Vector of times from the time-series (x-axis).

var

numeric Vector of observations from the time-series (y-axis).

zero.lim

numeric Limit for multiplication, only values higher than zero.lim are kept (removes noise and prevents recording zeroes when time-series is flat.).

timeSplit

numeric Increase time-series frequency (value at t = 0 are copied from t = 1 to t = 9, etc.). 10 usually garantees accuracy.

return_n1n2

logical If TRUE, also return the value of the multiplication.

Value

An integer vector or a data frame with two variables.

Details

For every time point, the numerical derivative is calculated using diff() and each sequential time point of the numerical derivative is multiplied. When the result is negative, the time-series crosses zero.

References

Durand M, Matule B, Burgess AJ, Robson TM. 2021. Sunfleck properties from time series of fluctuating light. Agricultural and Forest Meteorology 308-309, 108554. doi:10.1016/j.agrformet.2021.108554