[ncl-talk] running sequence of 0s and 1s

Peter Gibson peter.gibson at unsw.edu.au
Tue Mar 7 20:17:07 MST 2017


Hello,

Is there a function to calculate the running length of 0/1s in a sequence in NCL?

for example if I had a vector     v : 0 0 0 1 1 0 1 1 1 1 1 0 1 1 1 0 ...
the running sequence would be   : 0 0 0 0 1 0 0 1 2 3 4 0 0 1 2 0 ...

I see the function dim_numrun counts the number of unique sequence lengths which is similar but not exactly what I am after ....


Thanks,

Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170308/3a774858/attachment.html 


More information about the ncl-talk mailing list