diff --git a/Project.toml b/Project.toml index ecf19ab..5ef319d 100644 --- a/Project.toml +++ b/Project.toml @@ -60,7 +60,7 @@ LoggingExtras = "1" Missings = "1" NetCDF = "0.12" Proj = "1" -Rasters = "0.12,0.13" +Rasters = "0.12,0.13, 0.14" RecurrenceAnalysis = "2" Statistics = "1.10" TestItems = "1.0.0" diff --git a/src/rqatrend.jl b/src/rqatrend.jl index ad1b68e..8978a17 100644 --- a/src/rqatrend.jl +++ b/src/rqatrend.jl @@ -65,8 +65,9 @@ function rqatrend_impl(data; thresh=2, border=10, theiler=1, metric=CheckedEucli y_mean = 0.0 xy_mean = 0.0 for x in xs - n += 1.0 y = tau_rr(data, x; thresh, metric) + isnan(y) && continue + n += 1.0 y_mean = smooth(y_mean, y, inv(n)) xy_mean = smooth(xy_mean, x*y, inv(n)) end @@ -120,6 +121,7 @@ function tau_rr(y, d; thresh=2, metric=CheckedEuclidean()) nominator += evaluate(metric, y[i], y[i+d]) <= thresh denominator += 1 end + @show denominator return nominator/denominator end end