[Thread Prev][Thread Next][Index]

Re: [ferret_users] event statistics -- length of contiguous "spell"



Dear steve and Hein,

Thanks for quickly sharing your thoughts.

I have not really gone though all the details you suggestioned but I am glad to report that I have found a solution (in fact 2 different solutions).

First a clearification - What I mean by the spells was: active and break spell has been defined as days when rainfall is above or below a certain threshold provided it last for atleast 3 consequtive days. Previous taking help from the ferret forum I was able implement the criteria such that the result timeseries has value = 1 for active spell (also for break spell but in seperate variable) and missing for other period. That has worked fine as I was then only interested in the total duration of such spell and other composite analysis using those. So my original data and variables looks like following:

yes? sh d
     currently SET data sets:
    1> ../results/12kmRuns/IMD_active_break_JJASonly.90_05.nc  (default)
 name     title                             I         J         K         L         M         N
 ATV_JA   ATV                              ...       ...       ...       1:5844    ...       ...
       (X=66.3E:98.8E, Y=6.3N:38.8N)
 BRK_JA   BRK                              ...       ...       ...       1:5844    ...       ...
       (X=66.3E:98.8E, Y=6.3N:38.8N)

yes? list atv_ja[l=@ngd],brk_ja[l=@ngd]
(deleted lines)
         ATV_JA  BRK_JA
I / *:     108.0  125.0

Solution 1)
Hein email's yesterday indicating it would be difficult to implement (what I have request for) in ferret prompted me to seek other options which lead to 1st solution in which I avoided the proble mby creating new files for active (and break) period wherein values > 1 during active period and zero for the rest. Next I used:
let ID_atv=atv[l=@evnt:1]
to "tag" the events where successive odd id's corresponds to succesive active spells (& succesive even id's corresponds to succesive gaps between the spells).

Now from that I can easly find duration of each spell. (I then imported those spell lengh in spreadsheet to compute mean, median, max of the spell duration etc, but it should be possible to do it in ferret itself with little more play)

Solution 2)
But quickly going through steve's mail a while ago I though it might be posible to use similar trick:
so what I did is - I filled the missing values in the original data (above) with zero. Then defined the event as before with slight twist:
let id1=var1[l=@evnt:0.999]        ! here any value between 0 and 1 would work
which gave desired result!

i.e.
let VAR1 = IF ATV_JA THEN ATV_JA ELSE 0
let ID_GOOD = VAR1[L=@EVNT:0.999]
let ID_BAD = ATV_JA[L=@EVNT:1]        ! just for illustration, this doesn't work, using value between 0 & 1 also doesn't give desired result
    
list/l=181:245 atv_ja,id_bad,var1,id_good
(deleted lines)
                     ATV_JA  ID_BAD  VAR1  ID_GOOD
30-JUN-1990 00 / 181:   ....   0.00  0.000   0.000
01-JUL-1990 00 / 182:   ....   0.00  0.000   0.000
02-JUL-1990 00 / 183:  1.000   1.00  1.000   1.000
03-JUL-1990 00 / 184:  1.000   2.00  1.000   1.000
04-JUL-1990 00 / 185:  1.000   3.00  1.000   1.000
05-JUL-1990 00 / 186:  1.000   4.00  1.000   1.000
06-JUL-1990 00 / 187:   ....   4.00  0.000   2.000
07-JUL-1990 00 / 188:   ....   4.00  0.000   2.000
(deleted lines)
19-AUG-1990 00 / 231:   ....   4.00  0.000   2.000
20-AUG-1990 00 / 232:   ....   4.00  0.000   2.000
21-AUG-1990 00 / 233:   ....   4.00  0.000   2.000
22-AUG-1990 00 / 234:  1.000   5.00  1.000   3.000
23-AUG-1990 00 / 235:  1.000   6.00  1.000   3.000
24-AUG-1990 00 / 236:  1.000   7.00  1.000   3.000
25-AUG-1990 00 / 237:  1.000   8.00  1.000   3.000
26-AUG-1990 00 / 238:   ....   8.00  0.000   4.000
27-AUG-1990 00 / 239:   ....   8.00  0.000   4.000
28-AUG-1990 00 / 240:   ....   8.00  0.000   4.000
29-AUG-1990 00 / 241:  1.000   9.00  1.000   5.000
30-AUG-1990 00 / 242:  1.000  10.00  1.000   5.000
31-AUG-1990 00 / 243:  1.000  11.00  1.000   5.000
01-SEP-1990 00 / 244:   ....  11.00  0.000   6.000
02-SEP-1990 00 / 245:   ....  11.00  0.000   6.000

I would like to thank your both for sharing your ideas that help me come up with these solutions.

Best regards,

Jagadish

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

Privacy Policy | Disclaimer | Accessibility Statement