爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 5221|回复: 0

ncl 站点数据

[复制链接]
发表于 2014-6-11 20:53:50 | 显示全部楼层 |阅读模式
GrADS
系统平台:
问题截图:
问题概况: 请问如何用ncl 画站点数据呢,参考了
http://blog.sina.com.cn/s/blog_44f7c0840100on44.html
但是效果总是不是很理想,我希望跟wrf里自带precip 风格一致
这是我画的,底下是wrf自带脚本
我看过提问的智慧: 看过
自己思考时长(天): 5

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

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

x
本帖最后由 天气学原理 于 2014-6-11 20:57 编辑

附脚本
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

  ; station data
    station_data = readAsciiTable("rain.txt", 4, "float", 0)
    station_id = floattointeger(station_data(:,0))
    lat = station_data(:,1)
    lon = station_data(:,2)
    precip = station_data(:,3)
    precip@_FillValue = -9999
    num_station = dimsizes(station_id)

;=====================================================
  olon = new(65,"float");
  olat = new(39,"float");
  data = new((/39,65/),"float")
  olon=fspan(72,136,65)
  olat=fspan(17,55,39)
;============================================================
  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
;============================================================
    rscan = (/10,5,3/)   
  data = obj_anal_ic_deprecated(lon,lat,precip,olon,olat,rscan, False)  ;============================================================

cmap = (/(/1.00,1.00,1.00/),(/0.00,0.00,0.00/), \
            (/0.00,0.00,0.00/),(/1.00,1.00,1.00/), \
            (/0.00,0.63,0.97/),(/0.00,0.93,0.93/), \
            (/0.00,0.87,0.00/), \
            (/0.00,0.56,0.00/), \
            (/1.00,1.00,0.00/),(/0.91,0.75,0.00/), \
            (/1.00,0.56,0.00/),(/1.00,0.00,0.00/), \
            (/0.84,0.00,0.00/),(/0.75,0.00,0.00/), \
            (/1.00,0.00,0.94/),(/0.59,0.00,0.71/), \
            (/0.68,0.56,0.94/),(/0.00,0.00,1.00/)/)


; We generate plots, but what kind do we prefer?
; type = "x11"
; type = "pdf"
  type = "ps"
; type = "ncgm"
  wks = gsn_open_wks(type,"wrf_precip_tot")
  gsn_define_colormap(wks,cmap)         ; choose color map




; Set some basic resources
  res = True
  res@MainTitle = "24 precip"


  res@mpGeophysicalLineColor = "Black"
  res@mpNationalLineColor    = "Black"
  res@mpUSStateLineColor     = "Black"
  res@mpGridLineColor        = "Black"
  res@mpLimbLineColor        = "Black"
  res@mpPerimLineColor       = "Black"
  res@mpGeophysicalLineThicknessF=0.5
  res@mpGridLineThicknessF = 0.5
  res@mpDataBaseVersion="MediumRes"
  res@mpDataSetName="Earth..4"
  res@mpOutlineSpecifiers="China:states"

  res@gsnAddCyclic  = False      
  res@mpMinLatF             =  25          ; Asia limits
  res@mpMaxLatF             =  35
  res@mpMinLonF             =  105
  res@mpMaxLonF             = 125




   ; Plotting options for Precipitation

    res@UnitLabel            = "mm"
    res@cnLevelSelectionMode = "ExplicitLevels"
    res@cnLevels             = (/ .1, .2, .4, .8, 1.6, 3.2, 6.4, \                                        12.8, 25.6, 51.2, 102.4/)


;    res@cnInfoLabelOn        = False
     res@cnConstFLabelOn      = False
     res@cnFillOn             = True
     res@gsnSpreadColors       = True
     res@gsnSpreadColorStart   = 3
     res@gsnSpreadColorEnd     = 14


;===========================================================
  plot=gsn_csm_contour_map(wks,data,res)

end



a.PNG
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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