爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 16663|回复: 11

对fnl资料的疑惑

[复制链接]

新浪微博达人勋

发表于 2014-5-8 10:53:02 | 显示全部楼层 |阅读模式
数据资料
我看过提问的智慧: 看过

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

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

x
查看fnl资料的信息,发现很多变量不止一个值,有好几个值,比如hgt就有HGT_3_SFC,HGT_3_0DEG ,HGT_3_MWSL ,HGT_3_TRO ,HGT_3_ISBL,HGT_3_PVL,HGT_3_HTFL。。。。。我看这些变量除了 level_indicator 其他都一样
还有V,W,U,RH也是,请问这些有什么区别?还是随便选哪个都行?
要是我想画一张包含HGT,U,V,的图,这些变量可以随便从其中选吗,还是必须选一种类型的,比如都选HGT_3_ISBL,TMP_3_ISBL,U_GRD_3_ISBL,R_H_3_ISBL?
第一次用fnl资料画图,很是迷茫,请大家指点一下,多谢
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2014-5-8 11:14:14 | 显示全部楼层
比较标准的nc文件里面都含有大量属性信息,因此发现不清楚的变量首先要在头文件里面寻求帮助。比如你提到的HGT_3_PVL,头文件中显示level维是lv_PVL2,那么继续搜索会发现有个变量就叫lv_PVL2,从属性信息就能看出是什么意思了。
float HGT_3_PVL ( lv_PVL2, lat_3, lon_3 )
integer lv_PVL2 ( lv_PVL2 )
         units :        10^-6Km^2/kgs
         long_name :        potential vorticity (pv) level


HGT_3_ISBL,TMP_3_ISBL,U_GRD_3_ISBL,R_H_3_ISBL里面都包含ISBL,都是等压面的。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2014-5-8 11:33:53 | 显示全部楼层
longlivehj 发表于 2014-5-8 11:14
比较标准的nc文件里面都含有大量属性信息,因此发现不清楚的变量首先要在头文件里面寻求帮助。比如你提到的 ...

明白了!,谢谢hj大神~
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2014-5-8 16:57:50 | 显示全部楼层
longlivehj 发表于 2014-5-8 11:14
比较标准的nc文件里面都含有大量属性信息,因此发现不清楚的变量首先要在头文件里面寻求帮助。比如你提到的 ...

hj,大神,能不能帮我看个脚本,改了一下午都有错,实在是不知道怎么改了:
还有很多警告:

warning:Footer is not a valid resource in hj_contour at this time
warning:ContourParameters is not a valid resource in hj_contour at this time
warning:Footer is not a valid resource in hj_vector at this time
warning:FieldTitle is not a valid resource in hj_vector at this time
warning:NumVectors is not a valid resource in hj_vector at this time
warning:Footer is not a valid resource in hj_contour at this time
warning:ContourParameters is not a valid resource in hj_contour at this time
warning:MapV40DHUpdateDrawList: invalid boundary specification string: "china:states"
fatal:ContourPlotDraw: coordinates are out of range for drawing over a map: standard line or line label rendering method will not work;
consider setting the resource trGridType to "TriangularMesh" if coordinates contain missing values

脚本如下:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"



begin

  fi  = addfile("/home/Huanglei/data/fnl_20100724_00_00_c.grb","r")
  
; print(fi) ;
  hgt =fi->HGT_3_ISBL({500},:,:)
  u  =fi->U_GRD_3_ISBL({500},:,:)
  v  =fi->V_GRD_3_ISBL({500},:,:)
printVarSummary(hgt)
printVarSummary(u)
printVarSummary(v)
  wks = gsn_open_wks("pdf","hj")
  res = True
  res@Footer = False
  mpres = True
  mpres@mpGeophysicalLineColor      = "Black"
  mpres@mpNationalLineColor         = "Black"
  mpres@mpOutlineSpecifiers = ("China:states")
  mpres@mpGridLineColor             = "Black"
  mpres@mpLimbLineColor             = "Black"
  mpres@mpPerimLineColor            = "Black"
  mpres@mpGeophysicalLineThicknessF = 2.0
  mpres@mpGridLineThicknessF        = 2.0
  mpres@mpLimbLineThicknessF        = 2.0
  mpres@mpNationalLineThicknessF    = 2.0

  ;res@gsnSpreadColors = True ; 6.1.0
  mpres@mpMinLatF = 15
  mpres@mpMaxLatF = 40
  mpres@mpMinLonF = 100
  mpres@mpMaxLonF = 125
; The specific pressure levels that we want the data interpolated to.

      spd     = (u*u + v*v)^(0.5) ; m/sec
      spd@description = "Wind Speed"
      spd@units = "m/s"
      u = u*1.94386     ; kts
      v = v*1.94386     ; kts
      u@units = "kts"
      v@units = "kts"


      ; Plotting options for Wind Speed               
        opts = res                          
        opts@cnLineColor = "MediumSeaGreen"
        opts@ContourParameters = (/ 10. /)
        opts@cnInfoLabelOrthogonalPosF = 0.07  ; offset second label information
        opts@gsnContourLineThicknessesScale = 3.0
        contour_spd = gsn_csm_contour(wks,spd,opts)
        delete(opts)


      ; Plotting options for Wind Vectors                 
        opts = res         
        opts@FieldTitle = "Wind"   ; overwrite Field Title
        opts@NumVectors = 47       ; wind barb density
        vector = gsn_csm_vector(wks,u,v,opts)
        delete(opts)


      ; Plotting options for Geopotential Heigh
        opts_z = res                          
        opts_z@cnLineColor = "Blue"
        opts_z@gsnContourLineThicknessesScale = 3.0
        opts_z@ContourParameters = (/ 60.0 /)
        contour_height = gsn_csm_contour(wks, hgt,opts_z)
        delete(opts_z)


        mpid = gsn_csm_map(wks,mpres)
                overlay( mpid,contour_height)
                overlay( mpid,contour_spd)
        overlay(mpid,vector)  
              
        draw(mpid)            
        frame(wks)                 


;
end

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

新浪微博达人勋

发表于 2014-5-8 18:15:52 | 显示全部楼层
黄小仙儿 发表于 2014-5-8 16:57
hj,大神,能不能帮我看个脚本,改了一下午都有错,实在是不知道怎么改了:
还有很多警告:

warning:MapV40DHUpdateDrawList: invalid boundary specification string: "china:states"
没有选择合适的地图版本,加入:
    mpres@mpDataBaseVersion = "Ncarg4_1"
    mpres@mpDataSetName = "Earth..4"

其它的warning基本都是因为你用了专门针对wrf的绘图函数的属性,它们都有对应的标准属性,你理解之后可以找的到。

另外,如果要overlay,那么要把gsnDraw和gsnFrame先关掉才行。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2014-5-8 19:38:57 | 显示全部楼层
longlivehj 发表于 2014-5-8 18:15
warning:MapV40DHUpdateDrawList: invalid boundary specification string: "china:states"
没有选择合 ...

恩,好的。那这个fatal是什么原因呢?
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2014-5-8 20:00:52 | 显示全部楼层
黄小仙儿 发表于 2014-5-8 19:38
恩,好的。那这个fatal是什么原因呢?

数据范围不一致的原因
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2014-5-8 20:02:31 | 显示全部楼层
本帖最后由 longlivehj 于 2014-5-8 20:03 编辑

我改了一下,你运行试试。比较乱,见谅!


load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"



begin

  fi  = addfile("/home/Huanglei/data/fnl_20100724_00_00_c.grb","r")
  
; print(fi) ;
  hgt =fi->HGT_3_ISBL({500},{15:40},{100:125})
  u  =fi->U_GRD_3_ISBL({500},{15:40},{100:125})
  v  =fi->V_GRD_3_ISBL({500},{15:40},{100:125})
printVarSummary(hgt)
printVarSummary(u)
printVarSummary(v)
  wks = gsn_open_wks("pdf","hj")
res = True
  res@gsnDraw = False
  res@gsnFrame = False
  mpres = True
  mpres@gsnDraw = False
  mpres@gsnFrame = False
  mpres@mpGeophysicalLineColor      = "Black"
  mpres@mpNationalLineColor         = "Black"
    mpres@mpDataBaseVersion = "Ncarg4_1"
    mpres@mpDataSetName = "Earth..4"
  mpres@mpOutlineSpecifiers = (/"China:states"/)
  mpres@mpGridLineColor             = "Black"
  mpres@mpLimbLineColor             = "Black"
  mpres@mpPerimLineColor            = "Black"
  mpres@mpGeophysicalLineThicknessF = 2.0
  mpres@mpGridLineThicknessF        = 2.0
  mpres@mpLimbLineThicknessF        = 2.0
  mpres@mpNationalLineThicknessF    = 2.0

  ;res@gsnSpreadColors = True ; 6.1.0
  mpres@mpMinLatF = 15
  mpres@mpMaxLatF = 40
  mpres@mpMinLonF = 100
  mpres@mpMaxLonF = 125
; The specific pressure levels that we want the data interpolated to.

      spd     = (u*u + v*v)^(0.5) ; m/sec
      spd@description = "Wind Speed"
      spd@units = "m/s"
      u = u*1.94386     ; kts
      v = v*1.94386     ; kts
      u@units = "kts"
      v@units = "kts"

    copy_VarCoords(u, spd)


      ; Plotting options for Wind Speed               
        opts = res                          
        opts@cnLineColor = "MediumSeaGreen"
        ;opts@ContourParameters = (/ 10. /)
        ;opts@cnInfoLabelOrthogonalPosF = 0.07  ; offset second label information
        opts@gsnContourLineThicknessesScale = 3.0
        contour_spd = gsn_csm_contour(wks,spd,opts)
        delete(opts)


      ; Plotting options for Wind Vectors                 
        opts = res         
        ;opts@cnInfoLabelString = "Wind"   ; overwrite Field Title
        ;opts@NumVectors = 47       ; wind barb density
        vector = gsn_csm_vector(wks,u,v,opts)
        delete(opts)


      ; Plotting options for Geopotential Heigh
        opts_z = res                          
        opts_z@cnLineColor = "Blue"
        opts_z@gsnContourLineThicknessesScale = 3.0
        ;opts_z@ContourParameters = (/ 60.0 /)
        contour_height = gsn_csm_contour(wks, hgt,opts_z)
        delete(opts_z)


        mpid = gsn_csm_map(wks,mpres)
                overlay( mpid,contour_height)
                overlay( mpid,contour_spd)
        overlay(mpid,vector)  
              
        draw(mpid)            
        frame(wks)                 


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

新浪微博达人勋

 楼主| 发表于 2014-5-11 15:42:46 | 显示全部楼层
longlivehj 发表于 2014-5-8 20:02
我改了一下,你运行试试。比较乱,见谅!

恩,知道了。谢谢hj,查了下官网,ContourParameters = (/ 10. /)可以用cnLevelSpacingF来实现。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2014-5-12 09:45:57 | 显示全部楼层
longlivehj 发表于 2014-5-8 20:02
我改了一下,你运行试试。比较乱,见谅!

hj大神,能不能再请教你个问题,怎么平滑画出来的等值线,我画出来的巨丑,弯弯扭扭的,我查了下用:hgt = smth9(hgt, 0.50, -0.25, False),但是好像没多大改进
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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