爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 4605|回复: 1

NCL读取csv格式数据 无法画浓度分布图

[复制链接]

新浪微博达人勋

发表于 2016-10-22 19:24:06 | 显示全部楼层 |阅读模式

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

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

x
NCL读取csv格式数据后,无法画出浓度分布图,图上无数据,一直找不到原因。
图像空白如下:



脚本如下:
  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
  alat = asciiread("./latitude1.csv",-1,"float")
  alon = asciiread("./longitude1.csv",-1,"float")
  data = asciiread("./c1.csv",-1,"float")
  lat  = latGlobeFo(140,"lat","latitude","degrees_north")
  lon  = lonGlobeFo(140,"lon","lonitude","degrees_east")
  lat!0 ="a"
  lon!0 ="b"
  lat&a = alat
  lon&b = alon
  c = new((/140,140/),float,-9999)
  do it=0,dimsizes(alat)-1,1
  c(it,it)=data(it)
  c@_FillValue = -9999
  end do
  c!0 = "olat"
  c!1 = "olon"
  c&olat = lat
  c&olon = lon
  c@units = "ppmv"
  c&olat@units = "degrees_north"
  c&olon@units = "degrees_east"
  ;print(c(1,1))
  printVarSummary(c)
  wks   = gsn_open_wks ("png", "Annual_Observed" )          ; send graphics to PNG file
  gsn_define_colormap(wks,"hotcolr_19lev")
  res                       = True                 ; plot mods desired
  res@tiMainString          = "Annual CO2 distribution (observed) "       ;-- draw a title
  res@pmTickMarkDisplayMode = "Always"
  res@gsnMaximize           = True
  res@gsnDraw               = True              ; don't draw
  res@gsnFrame              = False                ; don't advance frame
  res@gsnAddCyclic          = False
  res@trGridType           = "TriangularMesh"
  res@lbLabelBarOn          = True
  res@cnLevelSelectionMode     = "ManualLevels"
  res@cnMinLevelValF       = 282.1                  ; set min contour level
  res@cnMaxLevelValF       = 400                ; set max contour level
  res@cnLevelSpacingF      =  5
  res@cnLineThicknessF      = 5                    ;-- make lines thicker
  res@cnMonoLineColor       =  True                  ;-- use multiple line colors
  res@cnLevelSpacingF       = 5                    ;-- contour level spacin
  res@cnLineLabelsOn        = True                 ; turn on line labels
  res@cnFillOn              = True                 ; turn on color
  res@cnInfoLabelOn         = True
  res@mpCenterLonF          = 0                      ; center plot at 0
  res@mpMinLatF             = -90
  res@mpMaxLatF             = 90
  res@mpMinLonF             = 0                        ; select a subregion
  res@mpMaxLonF             = 358.75

  ;---Using the color map to define colors for contours or vectors
  res@cnFillPalette = "hotcolr_19lev"
  ;---Reading the colormap into an N x 4 (RGBA) array
  cmap = read_colormap_file("hotcolr_19lev")

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


拜托大家帮我找一下原因
Annual_Observed.png
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-10-22 20:54:56 | 显示全部楼层
你自己检查你的数据到底读进去没有!!!
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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