[Thread Prev][Thread Next][Index]

Re: [ferret_users] running sum with restart after a missing value

Hi Thomas,

I would like to calculate a running sum over multiple time step, which however restarts after a missing value.

That behavior seems to me to be inconsistent; that is, @SUM skips missing values and gives a sum of valid values, whereas @RSUM stops when it finds a missing value.
Is there a simple solutions in ferret?

If you just want to skip the missing values in your running sum, you want to assign zeros to them. This is a contrived, simple example:

    let var = TSEQUENCE({1,2,-1.0e34,4,5,6})
    let var2 = ifv var then var else 0
    plot/line/symbol var2[t=@RSUM], var[t=@RSUM]

Hope this helps.


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement