爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 5083|回复: 4

求教大神 怎么在GrADS里给北半球投影图加上经度?

[复制链接]

新浪微博达人勋

发表于 2014-6-5 14:46:14 | 显示全部楼层 |阅读模式
GrADS
系统平台:
问题截图: -
问题概况: 我已经画出了北半球的投影图了,想再加上经度,我按照grads课本上的方法,一直不成功。
我看过提问的智慧: 看过
自己思考时长(天): 2

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
gs文件
'reinit'
'open d:\SH\a.ctl'
'enable print d:\SH\eof-hgt10.gmf'
'set mproj nps'
'set frame circle'
'd a'
'q w2xy 90 -3'
x1=subwrd(result,3);y1=subwrd(result,6)
'set string 2 c 5 0'
'draw string 'x1''y1' 90E'
'q w2xy 180 -3'
x2=subwrd(result,3);y2=subwrd(result,6)
'set string 2 1 5 0'
'draw string 'x2''y2' 180E'
'q w2xy 270 -3'
x3=subwrd(result,3);y3=subwrd(result,6)
'set string 2 c 5 0'
'draw string 'x3''y3' 90W'
'q w2xy 360 -3'
x4=subwrd(result,3);y4=subwrd(result,6)
'set string 2 r 5 0'
'draw string 'x4''y4' 180W'
'print'
'disable print'
;
生成的图形上还是没有经度




QQ截图20140605143937.png
QQ截图20140605144216.png
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2014-6-5 16:01:11 | 显示全部楼层
论坛里面有一个GS的,你可以先看看,我一时也找不到了。。。。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2014-6-5 16:05:45 | 显示全部楼层
这是一个GS,
*********************************
*This script drawing the coordinatess of the mproj-nps/sps
*by CD 2014.01.10
*********************************
***judge the mproj whether is nps/sps
'q gxinfo'
ll=sublin(result,6)
ww=subwrd(ll,3)
if(ww!=3&ww!=4)
   say 'set mproj error and change it to nps/sps'   
   return
endif
   
'q dims'
line1=sublin(result,2)
line2=sublin(result,3)
wd11=subwrd(line1,6)
if(ww=3)
   wd22=subwrd(line2,6)
else
   wd22=subwrd(line2,8)   
endif
*******************************************
*caculate the string width
  'q string s'
  strwith=subwrd(result,4)
i=1
while(i<=12)
   wd1=wd11+30*(i-1)
   
   
*************************************************************   
**************************************************************
***for nps
if(ww=3)
if(i<=7)
     ra=(90-30*(i-1))/180*3.1415926
   else
      ra=(30*(i-1)-270)/180*3.1415926
endif
if(i<7&i>1)
  xoffset=1.5*strwith*math_cos(ra)+2*strwith
  yoffset=1.5*strwith*math_sin(ra)
endif
if(i=7|i=1)
  xoffset=1.5*strwith*math_cos(ra)
  yoffset=1.5*strwith*math_sin(ra)
endif
if(i>7&i<12)
  xoffset=1.5*strwith*math_cos(ra)+2*strwith
  yoffset=1.5*strwith*math_sin(ra)   
endif
**************************************************************
****for sps
else
if(i<=7)
     ra=(30*(i-1)-90)/180*3.1415926
   else
      ra=(270-30*(i-1))/180*3.1415926
endif
if(i<7&i>1)
  xoffset=1.5*strwith*math_cos(ra)+2*strwith
  yoffset=1.5*strwith*math_sin(ra)
endif
if(i=7|i=1)
  xoffset=1.5*strwith*math_cos(ra)
  yoffset=1.5*strwith*math_sin(ra)
endif
if(i>7&i<12)
  xoffset=1.5*strwith*math_cos(ra)+2*strwith
  yoffset=1.5*strwith*math_sin(ra)   
endif
endif
'q w2xy 'wd1' 'wd22''
if(i<7&i>1)
    ii=subwrd(result,3)-xoffset
    jj=subwrd(result,6)+yoffset
else
    ii=subwrd(result,3)+xoffset
    jj=subwrd(result,6)+yoffset  
endif

'set string 1 c '
*draw  the coordinate string
if(wd1<0&wd1>-180)
   wd=(-1)*wd1
'draw string 'ii' 'jj' 'wd'`1W'
endif
*******************************************************
if(wd1<-180&wd1>-360)
    wd=wd1+360
'draw string 'ii' 'jj' 'wd'`1E'
endif
****************************************************
if(wd1>180&wd1<360)
    wd=360-wd1
'draw string 'ii' 'jj' 'wd'`1W'
endif
*****************************************************
if(wd1>0&wd1<180)
    wd=wd1
'draw string 'ii' 'jj' 'wd'`1E'
endif
*****************************************************
if(wd1=-180|wd1=180)
    wd=180
'draw string 'ii' 'jj' 'wd''
endif
******************************************************
if(wd1=0|wd1=-360|wd1=360)
    wd=0
'draw string 'ii' 'jj' 'wd''   
endif
i=i+1
endwhile

***************************************

是以前下载的。。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2014-6-6 20:25:56 | 显示全部楼层
小傅之追梦 发表于 2014-6-5 16:05
这是一个GS,
*********************************
*This script drawing the coordinatess of the mproj- ...

谢谢
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2014-6-15 15:23:21 | 显示全部楼层
错误提示说的很明白,你的draw命令出错了,不熟悉简写还是写全吧,多一个空格少一个空格都不行的
'draw string 'x1' 'y1' 90E'
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表