爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 5854|回复: 4

[作图] 垂直剖面图出现杂线?

[复制链接]
发表于 2016-1-28 16:14:07 | 显示全部楼层 |阅读模式

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

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

x
用ncl循环画了一些垂直剖面图,结果大部分是对的,里头的一部分图上出现了杂线,好奇怪,自己论坛里头搜了一下没解决,然后改了改区域的范围或者是等值线的范围,也没有解决,因此发贴求教。谢谢。

杂线

杂线
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2016-1-28 16:17:20 | 显示全部楼层
  ;********************************************
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"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
load "/data/qxs/dxh/ncep/thick_specified_contourF.ncl"


;********************************************
begin
    baofa_initial= asciiread("8423_cisk_test.txt",-1,"float")
    counter_num=dimsizes(baofa_initial)
    baofa=reshape(baofa_initial,(/floattoint(counter_num(0)/3.0),3/))
   
    lat_baofa=baofa(:,1:1)/10.0
          lon_baofa=baofa(:,2:2)/10.0
          counter_point=dimsizes(lat_baofa)
  
   
    f      = addfile ("typhoon_8_poumian.nc", "r")
          latitude=f->latitude
          longitude=f->longitude
          level=f->level
          counter_level=dimsizes(level)
    time   = f->time
    iymdh    = cd_calendar(time, -3)
    yrStrt=1984102306
    yrLast=1984103012         
    ;yrLast=1983092900       
    iStrt  = ind(iymdh.eq.yrStrt)
    iLast  = ind(iymdh.eq.yrLast)
    do ii=0,(counter_point(0)-1)
    w=short2flt( f->w(iStrt:iStrt,:,:,:) )
    sandu=short2flt( f->d(iStrt:iStrt,:,:,:) )
    vo=short2flt( f->vo(iStrt:iStrt,:,:,:) )
   
    do i=0,(counter_level-1)
    pre_levels=level(i)
    rh=short2flt( f->r(iStrt:iStrt,{pre_levels:pre_levels},:,:) );
    ;q= short2flt( f->q(iStrt:iStrt,{pre_levels:pre_levels},:,:) )
    t2_zanshi_tmp   = short2flt( f->t(iStrt:iStrt,{pre_levels:pre_levels},:,:) )
    tmpprs=flt2dble(t2_zanshi_tmp)
    tmp_ave=flt2dble(t2_zanshi_tmp)
    es=6.112*exp(17.67*(tmpprs-273.15)/(tmpprs-29.65))
    q=rh*(0.62197*es/(pre_levels-es))/100.
          e  = pre_levels * q/(0.62197+q)+1e-10;10^(-10)
          
          tlcl  = 55.0+2840.0/(3.5*log(tmp_ave)-log(e)-4.805)
          theta = tmp_ave*(1000. / pre_levels )^(0.2854*(1.0-0.28*q))
          eqt   = theta*exp(((3376./tlcl)-2.54)*q*(1.0+0.81*q))
          se=doubletofloat(eqt)
          counter_se=dimsizes(se)
          if (i.eq.0) then
          se_output=new((/1,counter_level,counter_se(2),counter_se(3)/),"float")
          end if
          se_output(0:0,i:i,:,:)=se
          delete([/pre_levels,q,t2_zanshi_tmp,tmpprs,tmp_ave,es,e,tlcl,theta,eqt,se/])
          end do
          counter=dimsizes(se_output)
          se=reshape(se_output,(/counter(1),counter(2),counter(3)/))
          se!0="level"
    se!1="latitude"
    se!2="longitude"
    se&level=level
    se&latitude=latitude
    se&longitude=longitude
          ;t2_tmp=reshape(t2,(/counter(1),counter(2),counter(3)/))-273.15
          ;copy_VarCoords(se,t2_tmp)
          vo_tmp=reshape(vo,(/counter(1),counter(2),counter(3)/))
          vo_tmp=vo_tmp*100000
          copy_VarCoords(se,vo_tmp)
          sandu_tmp=reshape(sandu,(/counter(1),counter(2),counter(3)/))
          sandu_tmp=sandu_tmp*100000
          copy_VarCoords(se,sandu_tmp)
          w_tmp=reshape(w,(/counter(1),counter(2),counter(3)/))
          w_tmp=w_tmp*10
          copy_VarCoords(se,w_tmp)
          ti_string=tostring(iymdh(iStrt))
          wks   = gsn_open_wks ("png", "se_typhoon8423_"+ti_string )           ; open workstation
    gsn_define_colormap(wks,"BlWhRe")                ; choose colormap
   ; gsn_define_colormap(wks,"BlueRed")
  
  ;colors = (/"firebrick3","firebrick1","indianred1","lightsalmon","ivory1",\
      ;       "lavenderblush","lavender","lightskyblue1","lightskyblue","deepskyblue",\
      ;       "dodgerblue"/)
  ;gsn_define_colormap(wks, "WhBlGrYeRe")
  
  
  res                      = True                  ; plot mods desired
; res@tiMainString         = "January 1988"        ; title
  res@cnSmoothingOn=True
  res@cnLevelSelectionMode = "ManualLevels"        ; manual contour levels
  res@cnLevelSpacingF      = 2.5                   ; contour interval
  res@cnMinLevelValF       = 280.                  ; min level
  res@cnMaxLevelValF       = 410.                  ; max level
  ;res@cnMinLevelValF       = -100.                  ; min level
  ;res@cnMaxLevelValF       = 40.                  ; max level
  ;res@cnMinLevelValF       = -15.                  ; min level
  ;res@cnMaxLevelValF       = 15.                  ; max level
  ;res@cnLevelSpacingF      = 2.0                   ; contour interval
  
   ; res@cnMinLevelValF       = -3.                  ; min level
  ;res@cnMaxLevelValF       = 3.                  ; max level
  ;res@cnLevelSpacingF      = 0.5                   ; contour interval
  
  ;    res@cnMinLevelValF       = -5.                  ; min level
  ;res@cnMaxLevelValF       = 5.                  ; max level
  ;res@cnLevelSpacingF      = 0.5                   ; contour interval
  
  res@cnLineLabelsOn       = True                  ; turn on line labels
  res@cnFillOn             = True                  ; turn on color fill

;---This resource not needed in V6.1.0
  res@gsnSpreadColors      = True                  ; use full range of colors

;---This resource defaults to True in NCL V6.1.0
  res@lbLabelAutoStride    = True                  ; optimal labels
   lat_special=lat_baofa(ii:ii,0)
  ;plot = gsn_csm_pres_hgt(wks,sandu_tmp(10:36,{lat_special},{120:155}),res)
  ;plot = gsn_csm_pres_hgt(wks,w_tmp(10:36,{lat_special},{125:155}),res)
  ;plot = gsn_csm_pres_hgt(wks,vo_tmp(10:36,{lat_special},{120:155}),res)
  plot = gsn_csm_pres_hgt(wks,se(10:36,{lat_special},{100:155}),res)
  ;plot = gsn_csm_pres_hgt(wks,t2_tmp(10:36,{5:20},{lon_special}),res)
;plot = gsn_csm_pres_hgt(wks,se(10:36,{5:25},{lon_special}),res)
  print(lat_special)

  ;mresp  = True
  ;mresp@txFontHeightF  = 0.013
  ;mresp@txFontColor = "red"   
  ;mresp@txFontThicknessF = 2.5
  ;gsn_text(wks,plot,"~F37~m",lon_baofa(ii:ii,:),lat_special,mresp)
  ;thick_specified_contourF(plot,0,4,-1)
  thick_specified_contourF(plot,344,4,-1)
  draw(plot)
  frame(wks)

  iStrt=iStrt+1
  ;delete([/plot,wks,ti_string,se,lon_special,t2_tmp/])
  delete([/plot,wks,ti_string,se,lat_special,vo_tmp,sandu_tmp,w_tmp/])
  ;delete([/plot,wks,ti_string,se,lon_special,vo_tmp/])
  end do
end
  
  

这个是ncl程序。
密码修改失败请联系微信:mofangbao
发表于 2016-1-28 17:07:24 | 显示全部楼层
dengxiaohua_121 发表于 2016-1-28 16:17
;********************************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code ...

把 最大最小值 打印出来,看看有极大错误值咩有,然后设置成却测即可
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2016-1-28 17:16:34 | 显示全部楼层
这样啊,谢谢guizi,我试试。
密码修改失败请联系微信:mofangbao
发表于 2016-10-11 08:49:42 | 显示全部楼层
请问楼主最后怎么解决的呢,谢谢
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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