pentad time series

Mary Jo Nath Mary-Jo.Nath at NOAA.GOV
Fri Jun 16 11:11:32 EDT 2006


Jyothi,

The only way I can see to do this is in two steps.  If you want to use
GrADS for all the calculations,  you can do the
longtidude average and the pentad average, and write the result to a
file using "set gxout fwrite", open a
new descriptor file ( *.ctl file) for this pentad data,  then plot.
Something like this :

1) Create a new pentad.ctl file for the new "pentad" file which includes:
dset ^pentad
.
. your UNDEF and TITLE here
.
xdef 1 linear 1
ydef  44 linear ....    /*  fill in whatever values of Y corresponds to your Y=129 and the interval (or list the coordinates and use "ydef 44 levels ")
tdef 73 linear 03jan1951 5dys
vars 1
precip 0 99 pentad precip
endvars


Then run the script:
2)
'open data.ctl'
'set x 1'
'set y 129 172'
* FWRITE allows you to write out the result to a binary file which can be "open"-ed
'set fwrite pentad'
'set gxout fwrite'
t=3
'set t 't
while(t<=365)
'define longave=(ave(precip,x=120,x=150))'
'd ave(longave,t-2,t+2)'
'set t 't+5
endwhile
'disable fwrite'

* close the original data file and open newly created pentad data and plot
'close 1'
'open pentad.ctl'
'set gxout shaded'
'set t 1 73'
'set x 1'
'set lat 0 30'
'd precip'

Mary Jo

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
>



More information about the gradsusr mailing list