Maximum of the consecutive events

From: <debasish_at_nyahnyahspammersnyahnyah>
Date: Wed Jan 13 2010 - 07:36:47 MST

Hello,

I may post similar problem before. In present problem, I would like to
calculate average of the maximum value of consecutive events instead
of number of consecutive events.

I mentioned a example below:

example
I have a time series of few values with missing value=-999

x=(/1,-999,-999,-999,3,4,5,6,7,1,3,-999,-999,-999,4,5,7,8,-999,-999,-999,-999,4,4,5,7,-999,-999,-999,2,1,10,-999,-999,-999,2,6,4,7,3,6,-999,-999,-999/)

Step1: I need to convert x to another time series x1 where only 3 to 6
consecutive value appears and rest of them will be missing (x1 will
same dimension of x)

x1=(/-999,-999,-999,-999,-999,-999,-999,-999,-999,-999,-999,-999,-999,-999,4,5,7,8,-999,-999,-999,-999,4,4,5,7,-999,-999,-999,2,1,10,-999,-999,-999,2,6,4,7,3,6,-999,-999,-999/)

Step2: I need to calculate the maximum of each event with 3 to 6
consecutive value from x1
There is four events with 3 to 6 consecutive in x1
4,5,7,8
4,4,5,7
2,1,10
2,6,4,7,3,6
so maximum values of these four events 8, 7, 10, 6

Step3: I need to calculate the average (8+7+10+6)/4

Any help for solving above mentioned steps in NCL will be appreciated.

Thanks

Debasish

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jan 13 07:36:52 2010

This archive was generated by hypermail 2.1.8 : Fri Jan 15 2010 - 13:51:45 MST