爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 21186|回复: 25

[作图] ncl通过显著性检验求助

[复制链接]
发表于 2015-12-29 14:34:25 | 显示全部楼层 |阅读模式

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

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

x
我用fortran计算了回归系数和f检验的值,用grads和ncl 画图,grads画的是对,等值线是通过显著性检验的区域,而ncl画出来就不对,所有区域均通过显著性检验(打点部分),但是我用ncl将f检验的值单独画也是对的,但是一叠加就不对了这是怎么回事

grads画的

grads画的

ncl画的

ncl画的

以下是我的ncl脚本
;************************************************
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"
;
;************************************************
begin
;读入全球slp数据,grd格式
  hg = fbindirread("E:/kaiti/circulation/coldwave_huigui_NCEPsst_NCL/hg_annual54.grd",0,-1,"float")
  fcheck = fbindirread("E:/kaiti/circulation/coldwave_huigui_NCEPsst_NCL/fcheck_annual54.grd",0,-1,"float")
  hgg=onedtond(hg,(/180,360/))
  fcheckk=onedtond(fcheck,(/180,360/))
  
  ;---------读入任意一个原始的nc文件(144*73格点的)-----------
  indata2= addfile("E:/kaiti/circulation/coldwave_huigui_NCEPsst_NCL/sst.mon.mean.nc","r")
  slpp= indata2->sst(0,::-1,:)
   printVarSummary(slpp)
  ;--------把原始nc数据里的坐标变量信息给grd里面的变量(slp)-------
;  hgg!0 = "lat"
;  hgg&lat =slpp&lat
;  hgg!1 = "lon"
;  hgg&lon = slpp&lon
;  hgg@_FillValue =-9.96921e+36
;  hgg&lat@units="degrees_north"
;  hgg&lon@units="degrees_east"
;  printVarSummary(hgg)
   copy_VarCoords(slpp,hgg)

; fcheckk!0 = "lat"
; fcheckk&lat =slpp&lat
; fcheckk!1 = "lon"
; fcheckk&lon = slpp&lon
; fcheckk@_FillValue =-9.96921e+36
; fcheckk&lat@units="degrees_north"
; fcheckk&lon@units="degrees_east"
  printVarSummary(fcheckk)
  copy_VarCoords(slpp,fcheckk)  

   
   

;------------------------------画图(通过显著性区域的打点)-----------------------
  res = True
  res@mpMaxLatF    = 80.                      ; specify the plot domain
  res@mpMinLatF    = -40.                      ;                        
  res@mpMinLonF    = 60                    ;
  res@mpMaxLonF    = 300.                     ;
  res@mpCenterLonF    = 180.                     ;
  wks = gsn_open_wks("ps","E:/kaiti/circulation/coldwave_huigui_NCEPsst_NCL/coldwave_huigui_sst")
  ;gsn_define_colormap(wks,"10colors(2)") ;用调色板输出色标
  gsn_define_colormap(wks,"rainbow");默认的彩虹
  
;-----------回归系数画填色图--------

;-------------------底图填色(该设置一样要放在画图设置的最前面)----------------
  res@mpFillOn     = True
  res@mpLandFillColor = "White"  
  res@cnMissingValFillColor = "White"
  res@mpFillDrawOrder="PostDraw"
;-----------------------------------------------------------
  res@mpOutlineOn  = True               ; turn the map outline on
  res@gsnDraw      =  False                   ; do not draw the plot
  res@gsnFrame     =  False                   ; do not advance the frame
  ;res@mpFillOn           = True    ;给底图填色,新版默认为灰色
  ;res@mpFillColor       = "gray"
  ;res@cnLevelSelectionMode = "ExplicitLevels"       ; set explicit contour levels  
  ;res@cnLevels =(/-3.6,-3.2,-2.8,-2.4,-2,-1.6,-1.2,-0.8,-0.4,0,0.4,0.6,0.8,1.2,1.6,2/)
  
  res@cnLevelSelectionMode = "Manuallevels"
  res@cnMinLevelValF=-0.6
  res@cnMaxLevelValF=0.8
  res@cnLevelSpacingF=0.2
  res@cnLineLabelsOn       = False            ; do not use line labels
  res@cnFillOn             = True             ; color fill
  res@cnLinesOn            = False            ; do not draw contour lines
  ;res@cnLevelSpacingF = 0.1
  ;res@cnFillPalette        = "BlueDarkRed18"
  
  res@tiMainString = ""  ; 设置主标题
  res@gsnLeftString = ""  ; 设置左副标题
  res@gsnRightString = ""  ; 设置右副标题
  plot1=gsn_csm_contour_map(wks,hgg,res)   ; create the temperature plot
  
;------------通过检验的打点-----------------------------------  
sres                      = True              ; set up a second resource list
sres@gsnDraw              = False             ; do not draw the plot
sres@gsnFrame             = False             ; do not advance the frame              
sres@cnLineLabelsOn       = False            ; do not use line labels
sres@cnFillOn             =False             ; color fill
sres@cnLinesOn            = False            ; do not draw contour lines
plot2=gsn_csm_contour(wks,fcheckk,sres)
plot2=ShadeGtContour(plot2,4.02,17); fillpattern=17 是打点的形状
                                ; draw the temperature plot (with the U-wind plot overlaid)
                                
   overlay(plot1,plot2)
   draw(plot1)                              
   frame(wks)                           
end

密码修改失败请联系微信:mofangbao
发表于 2015-12-29 16:39:49 | 显示全部楼层
plot2=ShadeGtContour(plot2,4.02,17)你这句在画t检验超过4.02的区域吗?
t检验是|t|>4.02,你还要考虑小于-4.02的区域吧
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2015-12-29 17:11:57 | 显示全部楼层
这是f检验,f统计量的值都是大于0 的
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2015-12-29 17:12:30 | 显示全部楼层
xiaocaoqiqiao 发表于 2015-12-29 16:39
plot2=ShadeGtContour(plot2,4.02,17)你这句在画t检验超过4.02的区域吗?
t检验是|t|>4.02,你还要考虑小 ...

这是f检验,f统计量的值是大于零的
密码修改失败请联系微信:mofangbao
发表于 2015-12-31 12:16:59 | 显示全部楼层
我之前碰过一次类似的问题,是因为设置 res@cnLevelSpacingF=0.2间隔的问题,你可以尝试改一下~
密码修改失败请联系微信:mofangbao
发表于 2015-12-31 12:45:47 | 显示全部楼层
你可以先不打点,先画F的等值线,看看叠加之后的效果是什么样的。
密码修改失败请联系微信:mofangbao
发表于 2015-12-31 15:54:46 | 显示全部楼层
{:5_213:}
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

 楼主| 发表于 2016-1-5 16:04:50 | 显示全部楼层
海豚∩_∩浩 发表于 2015-12-31 12:45
你可以先不打点,先画F的等值线,看看叠加之后的效果是什么样的。

画了F的等值线,是完全正确的
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2016-1-5 16:12:45 | 显示全部楼层
曦尘 发表于 2015-12-31 12:16
我之前碰过一次类似的问题,是因为设置 res@cnLevelSpacingF=0.2间隔的问题,你可以尝试改一下~

我尝试改了,但是还是全部都打了点
密码修改失败请联系微信:mofangbao
发表于 2016-1-5 17:27:31 | 显示全部楼层
你overlay等值线看看,如果等值线是对的,那就是打点的问题~~
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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