pentad time series
N Jyothi
njyothi at CDAC.IN
Sat Jun 17 02:11:32 EDT 2006
Thank you Arindam and Mary Jo for your suggestions. I think representing
the 5 days by the z-dimension is a neat and compact solution.
Regards - Jyothi
That's a nice trick. I'll have to remember that. - Mary Jo
On Fri, Jun 16, 2006, Arindam Chakraborty <arch at IO.MET.FSU.EDU> said:
> hi Joythi,
> Since you have a free dimension (levels, z) in your control
> file, you can do it easily. The idea is to rewrite the control file in
> such a way that those 5 days of a pentad is represented by the the
> z-dimension and all the 73 pentad time points is represented by the
> t-dimension. This is possible because by default z varies faster than
> t in grads. So, those two lines of your .ctl file should be:
>
> zdef 5 linear 1 1 * actually 5-days of a pentad
> tdef 73 linear 1jan1998 5dy * or whichever year that represents
>
> Now you can average over the z dimension to get pentad mean and rest
> is straightforward.
>
> ...
> 'set lat 0 30'
> 'set x 1'
> 'set t 1 73'
> 'd ave(ave(var,lon=80,lon=100),z=1,z=5)'
> ...
>
>
>
> ----------------------------
> ARINDAM CHAKRABORTY
> Department of Meteorology
> Florida State University
> Tallahassee, FL-32306, USA
> Tel: +001-850-6443524 (Off)
> +001-850-5758550 (Res)
> Fax: +001-850-6449642
> ____________________________
>
> On Fri, 16 Jun 2006, N Jyothi wrote:
>
>> Hello everyone
>> I have a data file, varying in longitude, latitude and time,
>> with which I need to plot a latitude-time cross-section as:
>>
>> (1) first average the data between 80 to 100 degree longitude
>> (2) then create a pentad time series data of the 365 days and plot from 0
>> to 30 degree latitude (in the final dataset, the time will vary from 1 to
>> 73 (365/5)).
>>
>> I was trying in the following manner, but it is getting wrong all the
way.
>> The dimension X varies from 1 to 512, Y from 1 to 256 and time from 1 to
>> 365.
>>
>> 'open data.ctl'
>> t=3
>> 'set y 129 172'
>> while(t<=10)
>> 'define longave=(ave(precip,x=120,x=150))'
>> 'd tloop(ave(longave,t-2,t+2))'
>> 'set t 't+5
>> endwhile
>> ................
>>
>> The above does not provide any solution, as I need to have a variable in
>> which the first time value will be average of first five time values
>> (t=1,t=5), next time value will be average of the next five time values
>> (t=6 to t=10) and final time value, which should be around 73, should
have
>> time averaged data from t=361 to t=365).
>>
>> I will be grateful for any help with this.
>>
>> Regards - Jyothi
>>
N Jyothi
CAS/SECG
Center for Development of Advanced Computing (C-DAC)
Pune, India
More information about the gradsusr
mailing list