请选择 进入手机版 | 继续访问电脑版
爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 6425|回复: 11

[作图] 用尽天下的药石,请问经纬度的间隔如何解决

[复制链接]

新浪微博达人勋

发表于 2018-9-20 18:29:22 | 显示全部楼层 |阅读模式

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

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

x
我已经把网上说的调整经纬度间隔的方法通通试过一遍了,可是结局依然无用,跪求原因

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

begin
;

  a = addfile("1.nc","r")
  wks = gsn_open_wks(“pdf”,"qctest")


; Set some basic resources
  res = True

  res@Footer = False
  res@InitTime = False
  res@vpWidthF = 0.8
  res@vpHeightF =0.5
  mpres  = True  ; Map resources
  pltres = True ; Plot resources

  times = wrf_user_getvar(a,"times",-1)  ; get all times in the file
  ntimes = dimsizes(times)         ; number of times in the file

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  do it = 0,ntimes-1,24        ; TIME LOOP

    print("Working on time: " + times(it) )
    res@TimeLabel = times(it)   ; Set Valid time to use on plots

      qc = wrf_user_getvar(a,"QCLOUD",it)
      qc = qc*1000.
      qc@units = "g/kg"

      level = 0
      opts = res
      opts@cnFillOn         = True
      opts@gsnSpreadColors  = False

      opts@cnMissingValPerimOn     = True
      opts@cnMissingValFillColor   = 0
      opts@cnMissingValFillPattern = 11
      opts@tmXTOn                  = False
      opts@tmYROn                  = False
      opts@tmXBMode                = "Explicit"
      opts@tmXBValues              = (/110,115,120,125,130/)                    ; Create tick marks
      opts@tmXBLabels              = (/"110","1150","120","125","130"/); Create labels
      opts@tmXBLabelFontHeightF    = 0.015
      opts@tmYLMode                = "Explicit"
      opts@tmYLValues              = (/30,40,50/)                     ; Create tick marks
      opts@tmYLLabels              = (/"30","40","50"/)

      opts@cnLevelSelectionMode = "ExplicitLevels"
      opts@cnLevels=(/0.0005,0.2,0.4,0.7/)
       res@cnFillColors=(/"White","Blue","Green","Red","Grey"/)
        contour = wrf_contour(a,wks,qc(level,:,:),opts)
        plot = wrf_map_overlays(a,wks,(/contour/),pltres,mpres)
        delete(contour)
      end if

      delete(opts)
end do        ; END OF TIME LOOP

end


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

新浪微博达人勋

 楼主| 发表于 2018-9-21 13:43:15 | 显示全部楼层
自己顶一下
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2018-9-22 09:21:34 | 显示全部楼层
自己顶一下
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2018-9-25 15:00:40 | 显示全部楼层
自己顶一下
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-9-26 17:29:57 | 显示全部楼层
我曾经在做垂直剖面时候,想把经纬度设置得更细一些,用了好多方法也不成功,后来直接转用grads了
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2018-9-27 08:56:37 | 显示全部楼层
小其其格 发表于 2018-9-26 17:29
我曾经在做垂直剖面时候,想把经纬度设置得更细一些,用了好多方法也不成功,后来直接转用grads了

这个我倒是知道
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2018-9-27 08:57:14 | 显示全部楼层
自己顶一下
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2018-9-27 08:59:45 | 显示全部楼层

这个我倒是会,可以设置一下
dimsX = dimsizes(X_plane)
      xmin  = X_plane(200)
      xmax  = X_plane(350)
      xspan = 350-200
然后再定义一下
opts_xy@tmXTOn                  = False
        opts_xy@tmYROn                  = False
        opts_xy@tmXBMode                = "Explicit"
        opts_xy@tmXBValues              = fspan(0,xspan,nx)                    ; Create tick marks
        opts_xy@tmXBLabels              = sprintf("%.1f",fspan(xmin,xmax,nx))  ; Create labels
画图的时候只画这段:
contour_qc = wrf_contour(a,wks,qc_plane(0:zmax_pos,200:350),opts_tc)


可是我觉得平面图应该有简便算法才对哈
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2018-9-27 09:00:39 | 显示全部楼层
  nx    = floattoint( (xmax-xmin)/2 + 1)
      nx    = nx*2
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-9-28 10:34:57 | 显示全部楼层

请问怎么实现的?
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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