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

Dennis Shea shea at ucar.edu
Tue Mar 7 20:59:19 MST 2017


Sorry, no. Pretty specialized function ...

: 0 0 0 1 1 0 1 1 1 1 1 0 1 1 1 0 ...  input: 1st 1 is a flag
: 0 0 0 0 1 0 0 1 2 3 4 0 0 1 2 0

On Tue, Mar 7, 2017 at 8:17 PM, Peter Gibson <peter.gibson at unsw.edu.au>
wrote:

> 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
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170307/81605b32/attachment.html 


More information about the ncl-talk mailing list