爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 6450|回复: 5

[作图] 为什么变化最大的正负闭合中心通不过显著性检验

[复制链接]

新浪微博达人勋

发表于 2017-4-4 23:26:20 | 显示全部楼层 |阅读模式

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

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

x
如图,在热带地区以外的最值闭合中心却通不过显著性检验,反而旁边的区域却通过了,感觉像是检验填色图左移几个格子似的,不知道怎么回事?望各位朋友帮忙解决一下,在此谢谢各位啦!
(代码较长,有些地方略啰唆,代码为:300hPa位势高度与EOF的PC1做回归,并对其做t检验(tval))
十分感谢各位留言的童鞋!!!
  1. load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
  2. load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
  3. load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

  4. begin
  5. yrStrt = 1979
  6. yrLast = 1996
  7. ymStrt = yrStrt*100 +  1
  8. ymLast = yrLast*100 + 12

  9. ff=addfile("/disk3/erainterim2.5/monthly/pressure/air.mon.mean.nc","r")
  10. TIME   = ff->time
  11. YYYY   = cd_calendar(TIME,-1)/100                 ; entire file
  12. iYYYY  = ind(YYYY.ge.yrStrt .and. YYYY.le.yrLast)
  13. ST=ff->t(iYYYY,{850},:,:)
  14. STT=short2flt(ST)-273.15
  15. copy_VarMeta(ST, STT)
  16. STT@units= "C"
  17. STT2=month_to_season(STT,"DJF")
  18. f=addfile("/disk3/erainterim2.5/monthly/pressure/hgt.mon.mean.nc","r")
  19. Z=f->z(0:215,:,:,:)
  20. Z:=short2flt(Z)
  21. ZDJF=month_to_season(Z, "DJF")
  22. TT=ZDJF(:,{200},:,:)-ZDJF(:,{850},:,:)
  23. copy_VarMeta(ZDJF(:,0,:,:), TT)
  24. printVarSummary(TT)
  25. printMinMax(TT, False)

  26.   neof   = 1        ; number of EOFs
  27.   optEOF = True      
  28.   optEOF@jopt = 1   ; This is the default; most commonly used; no need to specify.
  29.   ;optEOF@jopt = 1   ; **only** if the correlation EOF is desired

  30.   optETS = False
  31. ; =================================================================
  32.   TT2     = TT(:,{-20:20},:)
  33.   rad    = get_r2d("float")
  34.   clat   = TT2&latitude            
  35.   clat   = sqrt( cos(rad*clat) )                 ; gw for gaussian grid
  36.   printVarSummary(clat)

  37. ; =================================================================
  38. ; weight all observations
  39. ; =================================================================
  40.   xw     = TT2*conform(TT2, clat, 1)
  41.   copy_VarMeta(TT2, xw)
  42.   xw@long_name = "hgt: "+Z@long_name
  43. ; =================================================================
  44.   eof    = eofunc_n_Wrap(xw, neof, optEOF, 0)      
  45.   eof=-1*eof                          ; *special* match sign of CPC
  46.   eof2    =eofunc_n_Wrap(STT2,neof,optEOF,0)
  47.   eof2=-1*eof2
  48.   eof_ts = eofunc_ts_n_Wrap (xw, eof, optETS, 0)
  49.   printVarSummary( eof2 )                         ; examine EOF variables

  50.   eof_ts = dim_standardize_n( eof_ts, 0, 1)      ; normalize
  51.   printMinMax(eof_ts,False)

  52. ; =================================================================
  53. ; Regress
  54. ; =================================================================
  55.   TT3=STT2(latitude|:,longitude|:,time|:)
  56.   tval=new((/73,144/),"float")
  57.   nxy =new((/73,144/),"integer")
  58.    lon = lonGlobeF(144, "lon", "lon", "degrees_east")
  59.   tval!1= "lon"
  60.   tval&lon = lon
  61.   lat = latGlobeF(73, "lat", "lat", "degrees_north")
  62.   tval!0= "lat"
  63.   tval&lat = lat

  64.    lon = lonGlobeF(144, "lon", "lon", "degrees_east")
  65.   nxy!1= "lon"
  66.   nxy&lon = lon
  67.   lat = latGlobeF(73, "lat", "lat", "degrees_north")
  68.   nxy!0= "lat"
  69.   nxy&lat = lat
  70.   eof_regres = eof2                             ; create an array w meta data
  71.   do ne=0,neof-1
  72.      eof_regres(ne,:,:) = regcoef(eof_ts(ne,:),TT3, tval,nxy )
  73.   end do
  74. ; df=16
  75. ; tval=student_t(tval, df)
  76. ; printVarSummary(eof_regres)
  77.   ;printMinMax(eof_regres,False)
  78.   printMinMax(tval, False)

  79. ;============================================================
  80. ; PLOTS
  81. ;============================================================
  82.   wks = gsn_open_wks("pdf","/disk1/dzz/study/ncl/TT/SATEOF")         ; send graphics to PNG file
  83.   gsn_define_colormap(wks,"amwg256")

  84.   plot = new(neof,graphic)                ; create graphic array
  85.   plot2= new(neof,graphic)                                       ; only needed if paneling
  86. ; EOF patterns
  87.   res                      = True         
  88.   res@gsnDraw              = False        ; don't draw yet
  89.   res@gsnFrame             = False        ; don't advance frame yet

  90.   ;res@gsnAddCyclic         = False        ; plotted dataa are not cyclic

  91.   res@mpFillOn             = False        ; turn off map fill
  92.   res@mpOutlineOn          = True
  93.   res@mpMinLatF            = -40         ; zoom in on map
  94.   res@mpMaxLatF            =  80
  95.   res@mpMinLonF            = 0
  96.   res@mpMaxLonF            = 360
  97.   res@mpCenterLonF         = 180
  98.   res@cnFillOn             = False        ; turn on color fill
  99.   res@cnLinesOn            = True       ; True is default
  100.   res@cnLineLabelsOn       = False        ; True is default
  101.   res@gsnContourNegLineDashPattern = 1
  102.   res@cnLineDrawOrder      ="PostDraw"
  103.   ;res@cnFillPalette        = "BlWhRe"     ; set color map
  104.   res@cnLevelSelectionMode = "ManualLevels"
  105.   res@cnMinLevelValF      = -1.
  106.   res@cnMaxLevelValF      =1.5
  107.   res@cnLevelSpacingF      = 0.5
  108.   res@lbLabelBarOn         = False        ; turn off individual lb's
  109.   res@cnInfoLabelOn        = False
  110.   ;res@lbTitleOn            = False
  111.   res@cnSmoothingOn        = True
  112.   ;res@cnRasterSmoothingOn        = True
  113.   ;symMinMaxPlt(eof_regres, 0.5, False, res)       ; contributed.ncl
  114.   ;res2@cnRasterSmoothingOn        = True


  115. ; panel plot only resources
  116.   resP                     = True         ; modify the panel plot
  117.   resP@gsnMaximize         = True         ; large format
  118.   resP@gsnPanelLabelBar    = True         ; add common colorbar

  119.   resP@txString            = ""

  120.   res2                       = True
  121.   res2@gsnDraw               = False
  122.   res2@gsnFrame              = False
  123.   res2@cnFillOn              = True        ; turn on color fill
  124.   res2@cnLinesOn            = False       ; True is default
  125.   res2@cnLineLabelsOn       = False        ; True is default
  126.   ;res2@gsnContourNegLineDashPattern = 1
  127.   ;res@cnFillPalette        = "BlWhRe"     ; set color map
  128.   res2@lbLabelBarOn         = False        ; turn off individual lb's
  129.   res2@cnLevelSelectionMode = "ExplicitLevels"
  130.   res2@cnLevels             = (/-2.120,-1.746,1.746,2.120/)
  131.   res2@cnFillColors         =  (/22,7,0,177,225/)
  132.   res2@cnInfoLabelOn        = False
  133.   ;res2@lbTitleOn            = False
  134.   ;res2@cnSmoothingOn        = True
  135. ;*******************************************
  136. ; first plot
  137. ;*******************************************
  138.   do n=0,neof-1
  139.      res@gsnLeftString  = "(a) T850"
  140.      res@gsnRightString = "CI=0.5 C"
  141.      plot(n)= gsn_csm_contour_map(wks,eof_regres(n,:,:),res)
  142.      plot2(n)=gsn_csm_contour(wks,tval,res2)  
  143.      overlay(plot, plot2)
  144.      draw(plot)
  145.      frame(wks)
  146.   end do
  147.   gsn_panel(wks,plot,(/neof,1/),resP)     ; now draw as one plot)
  148. end
复制代码

QQ截图20170404232806.png
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2017-4-5 10:45:20 | 显示全部楼层
自顶!我自己找到原因啦,原来是等值线图的eof_regres的经纬度信息是(latitude,longitude),而填色图显著性检验的tval的经纬度信息是(lat,lon),然后我把tval的经纬度信息也改成(latitude,longitude),画出来的就是在最值区域里通过显著性检验了,不过我觉得tval的经纬信息(-90,90)/(0,357.5)和eof_regres的是一样的,可为什么NCL在识别的时候要按lat/latitude这样来呢,搞不懂
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2017-4-7 15:10:04 | 显示全部楼层
识别的时候要按lat/latitude
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2017-4-8 09:48:13 | 显示全部楼层
{:eb315:}{:eb315:}
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2017-4-8 15:21:48 | 显示全部楼层
lgz 发表于 2017-4-7 15:10
识别的时候要按lat/latitude

原来是这样,谢啦!
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-7-17 11:25:38 | 显示全部楼层
可以请教一下楼主和大神们,程序里面的这行
TT=ZDJF(:,{200},:,:)-ZDJF(:,{850},:,:)
计算的是什么吗?
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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