average with multiple stations

simoes simoes at ITEP.BR
Thu Jun 9 10:53:16 EDT 2005


Hi Charles and all, i'm writing a script to open many GrADS ctl files and get
the min and the max time of all set of stations data (in the example below,
min = 1963 and max = 1992). After that, i set sequentially the time from min
to max and calculate the average for each time. My difficulty is discovery
automatically which stations have information for a determined time and
avoid "request beyond file limits". Thank you very much again,

--
simoes


---------- Original Message -----------
From: Charles Seman <Charles.Seman at NOAA.GOV>
To: GRADSUSR at LIST.CINECA.IT
Sent: Wed, 8 Jun 2005 18:02:02 -0400
Subject: Re: average with multiple stations

> Hi Simoes,
>
> If you have GrADS ctl files, try the following (I'm not sure that the
> following will work, so please use with caution... note, by using
> "define" the time becomes a "wildcard" so that different time series
> can be averaged in an "ensemble" mode:
> http://grads.iges.org/grads/gadoc/variable.html#new):
>
> 'set dfile (station #2 GrADS file)'
> 'set t 1963'
> 'define s2avg63 = ave(...)'
>
> 'set dfile (station #3 GrADS file)'
> 'set t 1963'
> 'define s3avg63 = ave(...)'
>
> 'set dfile (station #5 GrADS file)'
> 'set t 1963'
> 'define s5avg63 = ave(...)'
>
> 'set dfile (station #6 GrADS file)'
> 'set t 1963'
> 'define s6avg63 = ave(...)'
>
> 'set dfile (station #7 GrADS file)'
> 'set t 1963'
> 'define s7avg63 = ave(...)'
>
> 'define avg1963 = (s2avg63 + s3avg63 + s5avg63 + s6avg63 + s7avg63)/5'
>
> and so on...
>
> I hope this helps,
> Chuck
>
> simoes wrote:
>
> >hi all, i have seven stations with following time series:
> >
> >#1 - 20 years - 1966 to 1985
> >#2 - 27 years - 1963 to 1989
> >#3 - 27 years - 1963 to 1989
> >#4 - 24 years - 1968 to 1991
> >#5 - 27 years - 1963 to 1989
> >#6 - 20 years - 1963 to 1982
> >#7 - 30 years - 1963 to 1992
> >
> >i have one value observed per year (station #1, 20 values; station #2, 27
> >values...). i like to do a simple average with the available values for
each
> >year. examples:
> >
> >t = 1963
> >average1963 = (#2-63 + #3-63 + #5-63 + #6-63 + #7-63) / 4
> >
> >t = 1991
> >average1991 = (#4-91 + #7-91) / 2
> >
> >please, someone helps me?
> >
> >thanks,
> >
> >--
> >simoes
> >
> >
>
> --
>
> ********************************************************************
>  Charles Seman                                charles.seman at noaa.gov
>  U.S. Department of Commerce / NOAA / OAR
>  Geophysical Fluid Dynamics Laboratory         voice: (609) 452-6547
>  201 Forrestal Road                              fax: (609) 987-5063
>  Princeton, NJ  08540-6649            http://www.gfdl.noaa.gov/~cjs/
> ********************************************************************
>
> "The contents of this message are mine personally and do not reflect
> any position of the Government or NOAA."
------- End of Original Message -------



More information about the gradsusr mailing list