请选择 进入手机版 | 继续访问电脑版
爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 6062|回复: 2

[其他] 【求助】为什么我照着论坛上的弄站点插值,结果全是缺测值

[复制链接]

新浪微博达人勋

发表于 2021-11-29 16:59:14 | 显示全部楼层 |阅读模式

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

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

x
; These files are loaded by default in NCL V6.2.0 and newer
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
filepath = "/cygdrive/L/DJBY/rain/207010314-0320.TXT";207010314-0320.TXT
lines = asciiread(filepath,-1,"string") ;以字符串形式读取参数文件入数组argu
lat = stringtofloat(str_get_field(lines(6:),1," "))
lon = stringtofloat(str_get_field(lines(6:),2," "))
pwv = stringtofloat(str_get_field(lines(6:),3," "))
rain = stringtofloat(str_get_field(lines(6:),4," "))
;print(rain)
; This second file is not so tricky.  The 2D lat/lon data is sorted with
; lat values first, and then lon values.
olon = new(66,"float");
olat = new(40,"float");
data = new((/40,66/),"float")
do i=0,65
  olon(i) =72+i
end do
do l=0,39
  olat(l) = 17+l
end do
olon!0          = "lon"
olon@long_name  = "lon"
olon@units      = "degrees_east"
olon&lon        = olon
olat!0          = "lat"
olat@long_name  = "lat"
olat@units      = "degrees_north"
olat&lat        = olat
rain@_FillValue =999999.
rscan = (/10,5,3/)   ;连续的有效半径大小,最大为10,依次递减
data = obj_anal_ic_deprecated(lon,lat,rain,olon,olat,rscan, False)  ;Creanm插值
;print(data)
  wks_type = "png"  

  wks = gsn_open_wks(wks_type,"/cygdrive/L/DJBY/rain/")     ; Open a workstation and.
  gsn_define_colormap(wks,"WhiteBlueGreenYellowRed")      ; define a different colormap.

res=True
;res@gsnDraw=False
;res@gsnFrame=False
;res@gsnMaximize=True
res@gsnAddCyclic  = False      ;由于我们的数据不是循环地球一周的,因此必须把这个置否
res@gsnLeftString=""                      ;去掉左上角标记
res@gsnRightString=""
res@tmYLLabelFontHeightF=0.01
res@tmXBLabelFontHeightF=0.01
;res@vpWidthF=0.34
;res@vpHeightF=0.25
res@tmXTOn=False
res@tmYROn=False
res@mpDataSetName           = "Earth..4"
res@mpDataBaseVersion       = "MediumRes"
res@mpOutlineOn             = True
res@mpOutlineSpecifiers   = (/"China:states","Taiwan"/)
res@mpMinLatF             =  21          ; Asia limits
res@mpMaxLatF             =  30
res@mpMinLonF             =  97
res@mpMaxLonF             = 107
;使用两行代码来加粗边界线。
res@mpGeophysicalLineThicknessF= 2.      ; double the thickness of geophysical boundaries
res@mpNationalLineThicknessF= 2.         ; double the thickness of national boundaries
;默认的底图投影方式是等经纬度投影,画出来的中国地图比较扁,我们常看到的中国地图,投影方式是兰伯特投影,因此需要对投影方式进行修改
res@mpProjection = "LambertConformal"   ;兰伯特投影
res@mpLambertMeridianF = 110.0
res@mpLimitMode = "LatLon"
res@mpLambertParallel1F = .001      ;Default: .001 ;可以自己改一改,看看投影有什么不同,挺有趣的
res@mpLambertParallel2F = 89.999    ;Default: 89.999

;最后将填充区域设定在中国行政区域图之内,如果使用默认效果,等值线会对整个矩形区域填充颜色,因此需要去掉中国边境范围外的填充颜色
res@mpAreaMaskingOn = True   ;使能填充覆盖
res@mpMaskAreaSpecifiers = (/"China:states","Taiwan"/)   ;China:states
res@mpOceanFillColor = 0     ;用白色填充海洋  0是colormap的索引值
res@mpInlandWaterFillColor = 0  ;用白色填充内陆湖水
;使能等值线填充,不显示各填充颜色之间的黑色等值线,不显示等值线上标示的数值,在绘制其他要素前先绘制等值线,对源的设置如下:
res@cnFillOn      = True
res@cnLinesOn     = False          ;等值线不显示
res@cnLineLabelsOn = False
res@cnFillDrawOrder = "PreDraw"         ; draw contours first   

;使用特定的Level值和配色方案对等值区间进行设置

res@cnLevelSelectionMode = "ExplicitLevels"       ; set explicit contour levels
res@cnLevels    = (/0.,10.,25.,50.,100.,250./) ; set levels

;在最后生成图片前,先要对整个view进行调整

res@vpXF = 0     ;左边距
res@vpYF = 0.95      ;上边距
res@vpWidthF  = 1.0              ; height and width of plot
res@vpHeightF = 0.8



plot=gsn_csm_contour_map(wks,data,res)
draw(plot)  
frame(wks)  
end

搜狗截图20211129165951.jpg
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2021-12-7 22:23:27 来自手机 | 显示全部楼层
你这个站点数据格式是怎样的
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2021-12-7 22:25:39 | 显示全部楼层
ZP盛夏光年 发表于 2021-12-7 22:23
你这个站点数据格式是怎样的

diamond 3 2017年01月03日08时-03日14时累积降水(区域站)
21 10 15 17 -1
     0
     1     25
     0
     1     2899
841523    98.8964     23.9950     1021.0      27.90
847782    99.9686     22.4511     1400.0      27.70
848788    98.8472     23.4906     504.0       27.20
847860    100.6411    22.9675     1389.0      26.30
849287    100.8047    24.7794     1578.0      24.10
848873    98.9408     24.0289     1193.0      23.20
847786    99.6842     22.2153     1372.0      22.10
841369    100.3519    23.9622     822.0       21.60
848836    98.9106     23.4956     660.0       21.30
848796    98.8811     23.5539     1340.0      20.90
848840    99.3300     23.2375     1645.8      20.90
847878    100.5042    23.9392     1526.0      20.50
848716    99.4417     24.1944     830.0       20.50
848874    99.0783     24.0292     1096.0      20.10
847858    100.6811    23.0133     1176.0      19.80
847729    100.4861    22.7025     1510.0      19.40
841500    99.2483     23.0939     1930.7      18.40
847867    100.6083    22.6981     1335.0      18.10
848723    99.7031     24.2025     1934.0      18.00
847822    99.6531     22.3689     1048.4      17.70
56944     99.2569     23.1622     1278.3      17.70
848654    100.4633    24.2078     1602.0      17.40
841405    99.3389     24.2008     1430.0      17.00

搜狗截图20211207222608.jpg
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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