[gradsusr] how to get average of a country

fairyes at zju.edu.cn fairyes at zju.edu.cn
Sun Apr 14 02:03:05 EDT 2013


Dear Kishore,

Thank you for your remind. I'm sorry for my unclearly expression. 

I want to get the timeseries of average pdsi value about china, next is the gs file I once used which was not precisely about china:
'sdfopen d:/grads/mada/data.cdf'
'set lon 73.66'
'set lat 4'
'set lev 0 0'
'set e 1 1'
'set t 114 121'
'define mpdsi=tloop(aave(pdsi,lon=73.66,lon=135.08,lat=4,lat=53.52))'
'set xlopts 1 5 0.25'
'set ylopts 1 5 0.15'
'set gxout line'
'set cthick 7'
'set grads off'
'd mpdsi'
'draw title MADA,IVI2 event_1416'
'printim d:/grads/mada/event_1416.png white x1600 y1200'
;


then after saw the method, I tried it to make my timeseries precisely about china, as the pdsi data are in a 2.5°regular grid, I set the xsize and ysize in meteoinfo to both 2.5, and then get the maskout_china dat file and ctl file from meteoinfo, after that, as the ctl file of pdsi data are built-in,and after I use sdopen comman to open the data.cdf, it shows the 'time values set: 1300:6:23:18 ', and I have known its time period are from 1300 to 2005, so I changed the next part in maskout_china ctl file: TDEF 706 LINEAR 18:00Z23JUN1300 1yr.

Then I change my gs file as below:

'sdfopen d:/grads/mada/data.cdf'
'open d:/grads/mada/maskout_china.ctl'
'set lon 73.66'
'set lat 4'
'set lev 0 0'
'set e 1 1'
'set t 114 121'
'define mpdsi=tloop(aave(pdsi,maskout(pdsi,mask)))'
'set xlopts 1 5 0.25'
'set ylopts 1 5 0.15'
'set gxout line'
'set cthick 7'
'set grads off'
'd mpdsi'
'draw title MADA,IVI2 event_1416'
'printim d:/grads/mada/event_1416_precise.png white x1600 y1200'
;

when I run the above gs file, opengrads showed:                                                    error from aave: too many or two few args                                                             5 arguments expected                                                                           operation error: error from aave function                                                      operation error: error from tloop function                                                         error occured at column 1                                                                         define error: invalid expression                                                                   syntax error: invalid operand                                                                     'mpdsi' not a variable or function name                                                           error occured at column 1                                                                          display error: invalid expression                                                             expression = mpdsi

Maybe I just didn't know how to use the maskout_china dat and ctl file correctly in my gs file, or the modification of maskout_china ctl file I made have some errors? I don't know why it shows so many errors in the next while it can be done in the above one. Any guidance or tip? Thank you very much!

Looking forward to your reply! Best regards!

Zhihong

 

 


--


 Zhihong Zhuo,Postgraduate Student

 College of Environmental and Resource Sciences, Zhejiang University

Address: 866 Yuhangtan Road, Hangzhou, China

Email: fairyes at zju.edu.cn

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130414/0622e56a/attachment-0003.html 


More information about the gradsusr mailing list