爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 5890|回复: 1

[作图] 日降水资料的处理出错,是资料的问题还是处理的问题

[复制链接]
发表于 2018-9-29 17:17:49 | 显示全部楼层 |阅读模式

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

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

x
本人ncl小白,目前刚接触,老师让做一个滤波我就从NCEP Operational Analysis上面下载了日降水的资料 逐年下载的,但是我处理之后怎么都出不来图,grads阅读之后的代码显示
  1. ga-> sdfopen pr_wtr.1980.nc
  2. Scanning self-describing file:  pr_wtr.1980.nc
  3. SDF file pr_wtr.1980.nc is open as file 1
  4. LON set to 0 360
  5. LAT set to -90 90
  6. LEV set to 0 0
  7. Time values set: 1980:1:1:0 1980:1:1:0
  8. E set to 1 1
  9. ga-> q ctlinfo
  10. dset pr_wtr.1980.nc
  11. title Once daily NMC precipitable water data (1980)
  12. undef -9.99e+33
  13. dtype netcdf
  14. xdef 144 linear 0 2.5
  15. ydef 73 linear -90 2.5
  16. zdef 1 linear 0 1
  17. tdef 366 linear 00Z01JAN1980 1440mn
  18. vars 2
  19. pr_wtr=>pr_wtr  0  t,y,x  Precitable Water
  20. head=>head  0  t  Missing
  21. endvars
复制代码
我自己的滤波作图程序:
  1. fils=systemfunc("ls pr_wtr.*.nc")
  2. f = addfiles(fils, "r")
  3. time=f[:]->head
  4. x = f[:]->pr_wtr(:,:,:) ;
  5. ihp = 2 ; band pass
  6. sigma = 1.0 ; Lanczos sigma

  7. nWgt = 201 ; loose 100 each end ()
  8. fca = 1./30. ; start freq
  9. fcb = 1./10. ; last freq
  10. wgt = filwgts_lanczos (nWgt, ihp, fca, fcb, sigma )
  11. printVarSummary(wgt)
  12. xBPF = wgt_runave_leftdim( x, wgt, 0 ) ; 10~30 day
  13. copy_VarMeta(x, xBPF)
  14. printVarSummary(xBPF)

  15. date = cd_calendar(time&time,-2)
  16. yrfrac  = yyyymmdd_to_yyyyfrac (date, 0)
  17. delete(yrfrac@long_name)
  18. delete(time@long_name)
  19. pStrt = 19800101 ; 20 years:
  20. pLast = 19991231
  21. iStrt = ind(date.eq.pStrt) ; user specified dates
  22. iLast = ind(date.eq.pLast)
  23. delete(date)

  24. wks = gsn_open_wks ("png","filters_precipitation")
  25. gsn_define_colormap(wks, "GMT_gray")
  26. res                      = True
  27. res@gsnAddCyclic         = True   
  28. res@cnFillOn             = True
  29. res@cnLineLabelsOn       = False   
  30. res@lbLabelBarOn         = True
  31. res@lbLabelBarOn         = False             ; turn off individual cb's

  32. res@mpMinLatF            = -90.            ; range to zoom in on
  33. res@mpMaxLatF            = 90.
  34. res@mpMinLonF            = 0.
  35. res@mpMaxLonF            = 360.
  36. res@mpCenterLonF         = 180.

  37. plot = gsn_csm_contour_map(wks,xBPF(120,:,:),res)


  38. end
复制代码
最上面的load没有加,我觉得没有必要,另外,ncl运行不报错,就是出不了图,我现在比较困惑的是数据的问题还是我自己代码的问题,求大神解答
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2018-9-29 17:26:07 | 显示全部楼层
  1. Variable: x
  2. Type: short
  3. Total Size: 1690084800 bytes
  4.             845042400 values
  5. Number of Dimensions: 3
  6. Dimensions and sizes:        [time | 7305] x [latitude | 241] x [longitude | 480]
  7. Coordinates:
  8.             time: [701256..876552]
  9.             latitude: [90..-90]
  10.             longitude: [ 0..359.25]
  11. Number Of Attributes: 6
  12.   scale_factor :        0.002021210590883124
  13.   add_offset :        256.4960291896264
  14.   _FillValue :        -32767
  15.   missing_value :        -32767
  16.   units :        K
  17.   long_name :        2 metre temperature

  18. Variable: wgt
  19. Type: float
  20. Total Size: 804 bytes
  21.             201 values
  22. Number of Dimensions: 1
  23. Dimensions and sizes:        [201]
  24. Coordinates:
  25. Number Of Attributes: 2
  26.   resp :        <ARRAY of 405 elements>
  27.   freq :        <ARRAY of 405 elements>

  28. Variable: xBPF
  29. Type: float
  30. Total Size: 3380169600 bytes
  31.             845042400 values
  32. Number of Dimensions: 3
  33. Dimensions and sizes:        [time | 7305] x [latitude | 241] x [longitude | 480]
  34. Coordinates:
  35.             time: [701256..876552]
  36.             latitude: [90..-90]
  37.             longitude: [ 0..359.25]
  38. Number Of Attributes: 9
  39.   missing_value :        -32767
  40.   missing_value_original :        -32767
  41.   _FillValue :        -32767
  42.   _FillValue_original :        -32767
  43.   long_name :        2 metre temperature
  44.   units :        K
  45.   add_offset :        256.4960291896264
  46.   scale_factor :        0.002021210590883124
  47.   wgt_runave_op_ncl :        wgt_runave_n
复制代码


加一下我运行后输出的数据
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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