[gradsusr] collect-gr2stn-coll2gr working with time slice

Daniel Mercado Betín damebet at gmail.com
Mon Mar 3 13:25:14 EST 2014


Hi Grads users forum.

I am trying to save a collect (using the collect command) as a grid (in red
color below), because I need to apply the average function (ave) to its
variable. I have tried using the coll2gr function to convert to grid, but
this function doesn't support time slice.

'sdfopen xxxx.nc'

'set grads off'

'set t 1 last'
'set x 1'
'set y 1'

lon1 = -80
lon2 = -30
lat1 = -5
lat2 = 0
lon = lon1

'collect 1 free'

while (lon <= lon2)
  lat = lat1 + (lat2-lat1)*(lon-lon1) / (lon2-lon1)
  'collect 1 gr2stn(precip,'lon','lat')'
  lon = lon + 1
endwhile

vec = 'collect 1'  (I need this as a grid, and then I could apply the ave
function with the generated variable of the grid)

'define prom1=ave('vec', t='721', t='1332', 12)'

Can you help me, please?

Thank you

-- 
Daniel Mercado Betín
Environmental Engineering
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20140303/e2a9d530/attachment.html 


More information about the gradsusr mailing list