- 积分
- 33
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-2-14
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 ·.飘稦▂_ 于 2015-2-25 19:19 编辑
谢谢7l talkd~
使用overlay函数就可以了
类似的例子参考官网 http://www.ncl.ucar.edu/Applications/Scripts/conOncon_1.ncl
要进行模式资料与实况站点资料的对比,模式资料是间隔15分钟(模式输出是5分钟,但是画出来看了一下5min与15min的图形差不多),实况资料是间隔是1小时,平时是使用RIP画图的,但是RIP不能画时间序列图,需要借助于NCL(参考的是WRF官网中RIP的教程),因为接触NCL也没有几天,由于时间精度不同,怎么都没有办法画出图片。
现在的想法是,把实况资料中没有的时次,填上-99.99(设置为缺省值),但是NCL好像是由于实况资料缺省值太多,就不画了..
求问大神们应该怎么办?
PS:如果模式资料改为1小时间隔,有些过程就对不上..所以希望还是使用模式15min间隔资料与实况1hr间隔资料在一张图上进行对比
文件如下
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
;***********************************************
begin
;***********************************************
files = systemfunc("cut -c18-22 station.txt")
location = systemfunc("cut -c24-35 station.txt")
;station 是存放8个站点信息的文件 files是站点号 location是经纬度
do i=0,7
;slp(0,:)存放模式输出的slp资料,slp(1,:)存放实况slp资料
slp = new((/2,65/),float)
;time存放模式时间,将世界时转为当地时
time = stringtofloat( systemfunc("cut -c21-22,38-40 slp_"+files(i)+".tser") ) + 8
slp(0,:) = stringtofloat( systemfunc("cut -c54-68 slp_"+files(i)+".tser" ) )
;time1读取实况资料时间,暂存在time1中。slp1读取实况资料slp,暂时存在slp1
time1 = stringtofloat( systemfunc("cut -f1 "+files(i)+".txt" ) )
slp1 = stringtofloat( systemfunc("cut -f4 "+files(i)+".txt" ) )
;把实况资料调整成跟模式输出时间精度一致,没有资料的时刻设置成-99.99
;模式输出有65个时次,实况有12个时次
a=0
do j=0,64
if ( a .gt. 11)then
a=11
end if
e = time(j)-time1(a)
if ( (abs(e) .lt. 0.1) .and. ( a .lt. 12) ) then
slp(1,j) = slp1(a)
a=a+1
else
slp(1,j)=-99.99
end if
end do
slp@_FillValue = -99.99
;绘图
wks_slp = gsn_open_wks("png","slp_"+files(i))
res_slp = True
res_slp@tmXTOn = False
res_slp@xyLineThicknesses = 2.0
res_slp@xyLineColor = (/"blue","red"/)
;res_slp@xyDashPatterns = (/0,1/)
res_slp@trXMinF = 12 ; set minimum X-axis value
res_slp@trXMaxF = 23 ; set maximum X-axis value
res_slp@tiYAxisString = "slp"
res_slp@tiXAxisString = "Time"
res_slp@tiMainString = files(i)+" "+location(i)
plot = gsn_csm_xy(wks_slp,time,slp,res_slp)
end do
end
最后只能得到每个站点的 模式slp曲线,没有实况的曲线
(把slp@_FillValue = -99.99取消掉,可以得到“实况”红色的曲线..但是不能用啊..)
|
|