爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 6904|回复: 6

nc文件的u.v变量是四维的,怎么画图啊,我这总有警告,求指点

[复制链接]

新浪微博达人勋

发表于 2014-4-15 16:59:42 | 显示全部楼层 |阅读模式
NCL
系统平台: fedora 20
问题截图: -
问题概况: 画图时报警告
But NCL will try its best to figure out the file format.

(0) check_for_y_lat_coord: Warning: Data either does not contain a valid latitude coordinate array or doesn't contain one at all.
(0) A valid latitude coordinate array should have a 'units' attribute equal to one of the following values:
(0) 'degrees_north' 'degrees-north' 'degree_north' 'degrees north' 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg north'
(0) check_for_lon_coord: Warning: Data either does not contain a valid longitude coordinate array or doesn't contain one at all.
(0) A valid longitude coordinate array should have a 'units' attribute equal to one of the following values:
(0) 'degrees_east' 'degrees-east' 'degree_east' 'degrees east' 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east'
我看过提问的智慧: 看过
自己思考时长(天): 4

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

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

x
变量信息:
Variable: a
Type: file
filename:    nc
path:    nc.lsx
   file global attributes:
      Conventions : NUWG
      history : created by LAPS Branch of FSL
      record : valtime, reftime
      title : LAPS lsx file - LAPS surface
      version : 3
   dimensions:
      ncl_scalar = 1
      record = 1  // unlimited
      z = 1
      x = 1901
      y = 1801
      nav = 1
      namelen = 132
   variables:
      float u ( record, z, y, x )
         navigation_dim :    nav
         record :    valtime, reftime
         _FillValue :    1e+37
         long_name :    u-component of surface wind
         units :    meter/second
         valid_range :    ( -200, 200 )
         LAPS_var :    U
         lvl_coord :    AGL
         LAPS_units :    M/S

      float v ( record, z, y, x )
         long_name :    v-component of surface wind
         navigation_dim :    nav
         record :    valtime, reftime
         _FillValue :    1e+37
         units :    meter/second
         valid_range :    ( -200, 200 )
         LAPS_var :    V
         lvl_coord :    AGL
         LAPS_units :    M/S

      float p ( record, z, y, x )
         navigation_dim :    nav
         record :    valtime, reftime
         _FillValue :    1e+37
         long_name :    reference level reduced pressure
         units :    pascal
         valid_range :    (  0, 120000 )
         LAPS_var :    P
         lvl_coord :    AGL
         LAPS_units :    PA

      float t ( record, z, y, x )
         navigation_dim :    nav
         record :    valtime, reftime
         _FillValue :    1e+37
         long_name :    surface temperature
         units :    kelvin
         valid_range :    (  0, 350 )
         LAPS_var :    T
         lvl_coord :    AGL
         LAPS_units :    K

      float td ( record, z, y, x )
         navigation_dim :    nav
         record :    valtime, reftime
         _FillValue :    1e+37
         long_name :    surface dew point temperature
         units :    kelvin
         valid_range :    (  0, 350 )
         LAPS_var :    TD
         lvl_coord :    AGL
         LAPS_units :    K

      float vv ( record, z, y, x )
         navigation_dim :    nav
         record :    valtime, reftime
         _FillValue :    1e+37
         long_name :    vertical velocity
         units :    meter/second
         valid_range :    (  0, 20000 )
         LAPS_var :    VV
         lvl_coord :    AGL
         LAPS_units :    M/S

      float rh ( record, z, y, x )
         navigation_dim :    nav
         record :    valtime, reftime
         _FillValue :    1e+37
         long_name :    relative humidity
         units :    meter
         valid_range :    ( -20000, 20000 )
         LAPS_var :    RH
         lvl_coord :    AGL
         LAPS_units :    M

      float msl ( record, z, y, x )
         navigation_dim :    nav
         record :    valtime, reftime
         _FillValue :    1e+37
         long_name :    Mean Sea Level pressure
         units :    pascal
         valid_range :    (  0, 120000 )
         LAPS_var :    MSL
         lvl_coord :    AGL
         LAPS_units :    PA

      float tad ( record, z, y, x )
         navigation_dim :    nav
         record :    valtime, reftime
         _FillValue :    1e+37
         long_name :    temperature advection
         units :    kelvin/second
         valid_range :    ( -20000, 20000 )
         LAPS_var :    TAD
         lvl_coord :    MSL
         LAPS_units :    K/S

      float th ( record, z, y, x )
         navigation_dim :    nav
         record :    valtime, reftime
         _FillValue :    1e+37
         long_name :    potential temperature
         units :    kelvin
         valid_range :    ( -75, 125 )
         LAPS_var :    TH
         lvl_coord :    AGL
         LAPS_units :    K

      float the ( record, z, y, x )
         navigation_dim :    nav
         record :    valtime, reftime
         _FillValue :    1e+37
         long_name :    equivalent potential temperature
         units :    kelvin
         valid_range :    ( -20000, 20000 )
         LAPS_var :    THE
         lvl_coord :    AGL
         LAPS_units :    K

      float ps ( record, z, y, x )
         navigation_dim :    nav
         record :    valtime, reftime
         _FillValue :    1e+37
         long_name :    surface pressure
         units :    pascal
         valid_range :    (  0, 120000 )
         LAPS_var :    PS
         lvl_coord :    AGL
         LAPS_units :    PA

      float vor ( record, z, y, x )
         navigation_dim :    nav
         record :    valtime, reftime
         _FillValue :    1e+37
         long_name :    vorticity
         units :    1/second
         valid_range :    ( -20000, 20000 )
         LAPS_var :    VOR
         lvl_coord :    AGL
         LAPS_units :    /S

      float mr ( record, z, y, x )
         navigation_dim :    nav
         record :    valtime, reftime
         _FillValue :    1e+37
         long_name :    mixing ratio
         units :    gram/kilogram
         valid_range :    ( -20000, 20000 )
         LAPS_var :    MR
         lvl_coord :    AGL
         LAPS_units :    G/KG

      float mrc ( record, z, y, x )
         navigation_dim :    nav
         record :    valtime, reftime
         _FillValue :    1e+37
         long_name :    moisture convergence
         units :    gram/kilogram/seconds
         valid_range :    ( -20000, 20000 )
         LAPS_var :    MRC
         lvl_coord :    AGL
         LAPS_units :    G/KG/S

      float div ( record, z, y, x )
         navigation_dim :    nav
         record :    valtime, reftime
         _FillValue :    1e+37
         long_name :    divergence
         units :    1/second
         valid_range :    ( -20000, 20000 )
         LAPS_var :    DIV
         lvl_coord :    AGL
         LAPS_units :    /S

      float tha ( record, z, y, x )
         navigation_dim :    nav
         record :    valtime, reftime
         _FillValue :    1e+37
         long_name :    potential temperature advection
         units :    kilogram/second
         valid_range :    ( -20000, 20000 )
         LAPS_var :    THA
         lvl_coord :    AGL
         LAPS_units :    K/S

      float mra ( record, z, y, x )
         navigation_dim :    nav
         record :    valtime, reftime
         _FillValue :    1e+37
         long_name :    moisture advection
         units :    gram/kilogram/second
         valid_range :    ( -20000, 20000 )
         LAPS_var :    MRA
         lvl_coord :    AGL
         LAPS_units :    G/KG/S

      float spd ( record, z, y, x )
         navigation_dim :    nav
         record :    valtime, reftime
         _FillValue :    1e+37
         long_name :    surface wind speed
         units :    meter/second
         valid_range :    ( -20000, 20000 )
         LAPS_var :    SPD
         lvl_coord :    AGL
         LAPS_units :    M/S

      float css ( record, z, y, x )
         navigation_dim :    nav
         record :    valtime, reftime
         _FillValue :    1e+37
         long_name :    colorado severe storm index
         units :              
         valid_range :    ( -20000, 20000 )
         LAPS_var :    CSS
         lvl_coord :    AGL
         LAPS_units :              

      float vis ( record, z, y, x )
         navigation_dim :    nav
         record :    valtime, reftime
         _FillValue :    1e+37
         long_name :    visibility
         units :    meters
         valid_range :    ( -20000, 20000 )
         LAPS_var :    VIS
         lvl_coord :    AGL
         LAPS_units :    M

      float fwx ( record, z, y, x )
         navigation_dim :    nav
         record :    valtime, reftime
         _FillValue :    1e+37
         long_name :    LAPS / Kelsch Fire weather index
         units :        
         valid_range :    (  0, 20 )
         LAPS_var :    FWX
         lvl_coord :    none
         LAPS_units :    none

      float hi ( record, z, y, x )
         navigation_dim :    nav
         record :    valtime, reftime
         _FillValue :    1e+37
         long_name :    Heat index
         units :        
         valid_range :    (  0, 20 )
         LAPS_var :    HI
         lvl_coord :    none
         LAPS_units :    none

      float tgd ( record, z, y, x )
         _FillValue :    1e+37
         long_name :    Ground Temperature
         units :    kelvin
         valid_range :    (  0, 400 )
         LAPS_var :    TGD
         lvl_coord :    AGL
         LAPS_units :    K

      integer imax ( ncl_scalar )

      integer jmax ( ncl_scalar )

      integer kmax ( ncl_scalar )

      integer kdim ( ncl_scalar )

      character u_comment ( record, z, namelen )

      character v_comment ( record, z, namelen )

      character p_comment ( record, z, namelen )

      character t_comment ( record, z, namelen )

      character td_comment ( record, z, namelen )

      character vv_comment ( record, z, namelen )

      character rh_comment ( record, z, namelen )

      character msl_comment ( record, z, namelen )

      character tad_comment ( record, z, namelen )

      character th_comment ( record, z, namelen )

      character the_comment ( record, z, namelen )

      character ps_comment ( record, z, namelen )

      character vor_comment ( record, z, namelen )

      character mr_comment ( record, z, namelen )

      character mrc_comment ( record, z, namelen )

      character div_comment ( record, z, namelen )

      character tha_comment ( record, z, namelen )

      character mra_comment ( record, z, namelen )

      character spd_comment ( record, z, namelen )

      character css_comment ( record, z, namelen )

      character vis_comment ( record, z, namelen )

      character fwx_comment ( record, z, namelen )

      character hi_comment ( record, z, namelen )

      character tgd_comment ( record, z, namelen )

      character asctime ( record, namelen )

      short u_fcinv ( record, z )
         _FillValue :    0

      short v_fcinv ( record, z )
         _FillValue :    0

      short p_fcinv ( record, z )
         _FillValue :    0

      short t_fcinv ( record, z )
         _FillValue :    0

      short td_fcinv ( record, z )
         _FillValue :    0

      short vv_fcinv ( record, z )
         _FillValue :    0

      short rh_fcinv ( record, z )
         _FillValue :    0

      short msl_fcinv ( record, z )
         _FillValue :    0

      short tad_fcinv ( record, z )
         _FillValue :    0

      short th_fcinv ( record, z )
         _FillValue :    0

      short the_fcinv ( record, z )
         _FillValue :    0

      short ps_fcinv ( record, z )
         _FillValue :    0

      short vor_fcinv ( record, z )
         _FillValue :    0

      short mr_fcinv ( record, z )
         _FillValue :    0

      short mrc_fcinv ( record, z )
         _FillValue :    0

      short div_fcinv ( record, z )
         _FillValue :    0

      short tha_fcinv ( record, z )
         _FillValue :    0

      short mra_fcinv ( record, z )
         _FillValue :    0

      short spd_fcinv ( record, z )
         _FillValue :    0

      short css_fcinv ( record, z )
         _FillValue :    0

      short vis_fcinv ( record, z )
         _FillValue :    0

      short fwx_fcinv ( record, z )
         _FillValue :    0

      short hi_fcinv ( record, z )
         _FillValue :    0

      short tgd_fcinv ( record, z )
         _FillValue :    0

      float level ( z )
         long_name :    level of data
         units :        
         _CoordinateAxisType :    GeoZ

      float z ( z )
         long_name :    level of data
         units :   
         _CoordinateAxisType :    GeoZ

      double valtime ( record )
         long_name :    valid time
         units :    seconds since (1970-1-1 00:00:00.0)

      double reftime ( record )
         long_name :    reference time
         units :    seconds since (1970-1-1 00:00:00.0)

      character origin_name ( namelen )

      character process_name ( namelen )

      character grid_name ( namelen )

      character earth_shape ( namelen )

      character grid_type ( nav, namelen )
         long_name :    GRIB-1 grid type

      integer grid_type_code ( nav )
         long_name :    GRIB-1 GDS data representation type

      character x_dim ( nav, namelen )
         long_name :    longitude dimension

      character y_dim ( nav, namelen )
         long_name :    latitude dimension

      short Nx ( nav )
         long_name :    number of x points

      short Ny ( nav )
         long_name :    number of y points

      float La1 ( nav )
         long_name :    first latitude
         units :    degrees_north

      float Lo1 ( nav )
         long_name :    first longitude
         units :    degrees_east

      float LoV ( nav )
         long_name :    orientation of grid
         units :    degrees_east

      float Latin1 ( nav )
         long_name :    orientation of grid
         units :    degrees_north

      float Latin2 ( nav )
         long_name :    orientation of grid
         units :    degrees_north

      float Dx ( nav )
         long_name :    x grid increment
         units :    meters

      float Dy ( nav )
         long_name :    y grid increment
         units :    meters
代码:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
begin
fi = addfile("nc.lsx", "r")

u = fi->u(0,:,:,:)
v = fi->v(0,:,:,:)
wks = gsn_open_wks("png", "out_wind")
gsn_define_colormap(wks,"BlGrYeOrReVi200") ; 设置色表
res = True
res@vcGlyphStyle = "CurlyVector"
res@vcMonoLineArrowColor = False ; 彩色箭头
res@vcRefLengthF = 0.04 ; 单位长度箭头的长度
res@vcRefMagnitudeF = 20 ; 单位长度箭头的数值
res@vcMinDistanceF = 0.017
res@vcRefAnnoArrowUseVecColor = False ; 右下角的图例中的箭头保持原来的颜色
res@gsnSpreadColors = True ;
res@lbOrientation = "Vertical" ; 竖直放置 Laber bar
res@gsnAddCyclic  = False
res@gsnMaximize          = False        ; maximize plot
res@mpMaxLatF            = 90.        ; area to zoom in on
res@mpMinLatF            = 0.
res@mpMinLonF            = 0.
res@mpMaxLonF            = 180.

plot = gsn_csm_vector_map(wks, u(0,:,:), v(0,:,:), res)


end

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

新浪微博达人勋

发表于 2014-4-15 19:27:20 | 显示全部楼层
头文件里面没有发现有x和y坐标变量,所以尽管ncl获取了u和v,但没有办法将其对应到map上。可以手动为u和v添加x和y坐标变量,并设定坐标变量的units属性。
密码修改失败请联系微信:mofangbao
回复 支持 1 反对 0

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2014-4-16 09:01:29 | 显示全部楼层
longlivehj 发表于 2014-4-15 19:27
头文件里面没有发现有x和y坐标变量,所以尽管ncl获取了u和v,但没有办法将其对应到map上。可以手动为u和v添 ...

大神,你所谓的头文件是指?请详细的再给解释一下好吗
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2014-4-16 09:46:53 | 显示全部楼层
lisixiuhe 发表于 2014-4-16 09:01
大神,你所谓的头文件是指?请详细的再给解释一下好吗

头文件就是你贴出的那一大片变量信息!
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2014-4-16 10:42:08 | 显示全部楼层
longlivehj 发表于 2014-4-16 09:46
头文件就是你贴出的那一大片变量信息!

手动为u和v添加x和y坐标变量 这个怎么添加 真的是不会啊 跪求大神指点
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2014-4-16 11:55:53 | 显示全部楼层
lisixiuhe 发表于 2014-4-16 10:42
手动为u和v添加x和y坐标变量 这个怎么添加 真的是不会啊 跪求大神指点

头文件包含的信息量不够。
x和y的范围、间隔是多少?
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2014-4-16 14:03:13 | 显示全部楼层
longlivehj 发表于 2014-4-16 11:55
头文件包含的信息量不够。
x和y的范围、间隔是多少?

没有关于x y的信息了 这个是全部

      float La1 ( nav )
         long_name :        first latitude
         units :        degrees_north

      float Lo1 ( nav )
         long_name :        first longitude
         units :        degrees_east

      float LoV ( nav )
         long_name :        orientation of grid
         units :        degrees_east

      float Latin1 ( nav )
         long_name :        orientation of grid
         units :        degrees_north

      float Latin2 ( nav )
         long_name :        orientation of grid
         units :        degrees_north

      float Dx ( nav )
         long_name :        x grid increment
         units :        meters

      float Dy ( nav )
         long_name :        y grid increment
         units :        meters
跟这些信息有关吗?
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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