Hi Thomas, You can do this by a combination of using the event mask transform @EVN and projecting onto a second dimension. Here's an example let orig = IF MOD(L[L=1:100],7) NE 0 THEN L[l=1:100] +0*L[L=1:100] ! Create an event mask let orig_miss = MISSING(ORIG,-999) let evn = orig_miss[L=@EVN:-999] let orig_miss_0 = MISSING(ORIG,0) ! We need to fill in zeros for running sums. let num_events=`evn[l=@max]+1` ! 15 let evnk = IF K EQ evn+1 THEN orig_miss_0 ELSE 0 !project shade/k=1:`num_events` evnk let mask_after = IF K GE EVN+1 THEN EVNK ! Do not want to contaminate sums but we want zero before the sum starts shade/k=1:`num_events` mask_after let sum_on_2d = mask_after[L=@RSUM] shade/k=1:`num_events` sum_on_2d let sum_on_1d=ifv orig then sum_on_2d[k=1:`num_events`@sum] ! Collect and mask missing places. First value in each segment should be L plot sum_on_1d It's a bit convoluted and there may be a nicer way to do this. Cheers, Russ On 04/09/17 16:38, Frölicher Thomas wrote:
|