Piecewise timeseries and averaging functions

raghu raghu at NCMRWF.GOV.IN
Tue Sep 5 23:55:01 EDT 2006


lmean.gs (attached) does the job for you.
This was posted by some one few years ago.

--
Open WebMail Project (http://openwebmail.org)


---------- Original Message -----------
From: Owen Doherty <odoherty at IC.SUNYSB.EDU>
To: GRADSUSR at LIST.CINECA.IT
Sent: Tue, 5 Sep 2006 23:40:42 -0400
Subject: Piecewise timeseries and averaging functions

> Dear GrADS Users,
>
> I have a relatively straightforward question to which I cannot find
> an answer for in the user list archive.
>
> I am attempting to create some composite average images from
> reanalysis.  The dataset I am using is monthly averages over a
> period of years.  I am interesting in the average of individual
> months from the larger dataset, these months are not related to each
> other and are seemingly random (t=17,33,57,94, etc...).
>
> I thought something similar (but with correct GrADS syntax) to the
> following could work:
> set t 17
> define newvar.1=v
> set t 33
> define newvar.2=v
> ...
> set t n
> define newvar.n=v
>
> Combined with something like this, to produce the average:
> ave(newvar.t,t=1,t=n)
>
> However the correct GrADS syntax to accomplish the above eludes me.
>
> A less elegant approach would be to sum up the individual months and
> divide by the number of months, but this could cause significant errors
> if missing data was included.
>
> I was wondering if anyone has written a script that accomplishes this
> task, or if someone could lend some light on a more appropriate
> syntax or approach.  I recall doing something similar to this when I
> was an undergraduate, so I am confident a solution can be found.
>
> Regards and thanks,
>
> Owen
>
> --
>
> Owen Doherty
> Institute for Terrestrial and Planetary Atmospheres
> Marine Sciences Research Center
> Stony Brook University
> Stony Brook, NY 11794
> 631-632-3185 (office)
------- End of Original Message -------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: lmean.gs
Type: application/octet-stream
Size: 1422 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20060906/22d6de6b/attachment.obj 


More information about the gradsusr mailing list