trying to extract a seasonal subset of data

Mary Jo Nath Mary-Jo.Nath at NOAA.GOV
Tue Aug 15 15:42:27 EDT 2006


Katherin,

If you want to write  a time series of Dec 1950, Jan 1951, Feb 1951, Dec
1951, Jan 1952, ..., Feb 2000 ,
then the following should work:

'open anom.ctl'
'set gxout fwrite'
* xmax =  number of longitude points set in anom.ctl for XDEF  (grads
defaults to 'set x 1 'xmax+1, for wrap-around)
'set x 1 'xmax
* This writes December 1950, January 1951, February 1951, December 1951,
January 1952,..., February 2000
'set fwrite djf.data'
imap = 12
pmap = 14
while (imap <= 600)
'set t ' imap' 'pmap
'd anom'
imap = imap + 12
pmap = pmap + 12
endwhile
'disable fwrite'


HOWEVER...
If you intend to compute and write the DJF mean time series, then the
following should work:

'open anom.ctl'
'set gxout fwrite'

* xmax =  number of longitude points set in anom.ctl for XDEF (grads
defaults to 'set x 1 'xmax+1, for wrap-around)
'set x 1 'xmax
'set t 1'

* This computes and writes the DJF seasonal mean from Dec1950/Feb1951 -
Dec1999/Feb2000

'set fwrite djf.data'
imap = 12
pmap = 14
while (imap <= 600)
'd ave(anom,t='imap',t='pmap')'
imap = imap + 12
pmap = pmap + 12
endwhile

'disable fwrite'

Mary Jo

Katherin Kullgren wrote:
> Hi,
>
> I am trying to extract seasonal subsets of data from my dataset.
> I  want DJF MAM JJA SON
>
> So this is what I tried
>
> 'open anom.ctl'
> 'set gxout fwrite'
>
> * This creates the DJF season from Dec1950/Feb1951 - Dec1999/Feb2000
>
> 'set fwrite djf.data'
> imap = 12
> pmap = 14
> while (imap <= 600)
> 'set t ' imap pmap
> 'd anom'
> imap = imap + 12
> pmap = pmap + 14
> endwhile
>
> 'disable fwrite'
>
> This does not work. I am not sure the correct way  define the increments that I want.
> I  want to have
> set t 12 14
> set t 24 26
>  ..........
> set t 603 605
>
> I keep getting the error
>
> Data Request Warning:  Request beyond file limits
> Data Request Warning:  Request beyond file limits
> Data Request Warning:  Request beyond file limits
> Data Request Warning:  Request beyond file limits
> Data Request Warning:  Request beyond file limits
> Data Request Warning:  Request beyond file limits
> Data Request Warning:  Request beyond file limits
> and so on
>
> If someone could suggest a way that this would work.  I would appreciate it.
> BTW- its monthly gridded data.
>
> Thanks
> Katherin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20060815/4f555daf/attachment.html 


More information about the gradsusr mailing list