- 积分
 - 325
 
	- 贡献
 -  
 
	- 精华
 
	- 在线时间
 -  小时
 
	- 注册时间
 - 2014-6-7
 
	- 最后登录
 - 1970-1-1
 
 
 
 
 
 
 | 
	
 
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册 
 
 
 
x
 
用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 
f =addfile("NPO_index.nc","r") ; 打开文件  
npo=f->npo 
N    = dimsizes(npo) 
; compute wavelet (Missing values not allowed due to use of FFT) 
;************************************   
  mother  = 0 
  param   = 6.0 
  dt      = 1.              ;for NPO (timesteps in units of years) 
  s0      = 0.25 
  dj      = 0.25 
  jtot    = 1 + floattointeger(((log10(N*dt/s0))/dj)/log10(2.)) 
; print(jtot) 
  npad    = N 
  nadof   = new(2,float) 
  noise   = 1  
  siglvl  = .05 
  isigtest= 0 
   
 
  w = wavelet(npo,mother,dt,param,s0,dj,jtot,npad,noise,isigtest,siglvl,nadof)  
;************************************ 
; create coodinate arrays for plot 
;************************************ 
  power            = onedtond(w@power,(/jtot,N/)) 
  power!0          = "period"                        ; Y axis 
  power&period     = w@period 
  power!1          = "year"                          ; X axis 
  power&year      = year 
  power@long_name  = "Power Spectrum" 
  power@units      = "unit^2" 
  gws              = w@gws 
; compute significance ( >= 1 is significant) 
  SIG              = power                            ; transfer meta data 
  SIG              = power/conform (power,w@signif,0) 
  SIG@long_name    = "Significance" 
  SIG@units        = " " 
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
wks = gsn_open_wks("eps","NPO_wavelet")              ; open ps file 
gsn_define_colormap(wks,"BlAqGrYeOrReVi200")    ; choose colormap 
res                     = True                  ; plot mods desired  
  res@gsnFrame            = False                 ; don't advance frame yet 
  res@gsnDraw             = False                 ; don't draw yet 
  res@cnFillOn            = True                  ; turn on color 
  res@cnFillMode          = "RasterFill"          ; turn on raster mode 
  res@cnRasterSmoothingOn = True                  ; turn on raster smoothing 
  res@cnLinesOn           = False                 ; turn off contour lines 
  res@gsnSpreadColors     = True                  ; use full colormap 
  res@lbOrientation       = "Vertical"            ; vertical label bar 
  res@trYReverse          = True                  ; reverse y-axis 
  res@tmLabelAutoStride   = True 
  res@tmYLMode = "Explicit" 
  res@tmYLValues = w@period  
  res@tmYLLabels = w@period  
plot2 = gsn_csm_contour(wks,power({0:66},:),res)  
  res1  = True  
  res1@cnFillOn=False 
  plot2 = ShadeCOI(wks,plot2,w,year,res1) 
  res2 = True 
  res2@gsnDraw = False 
  res2@gsnFrame = False 
  res2@cnFillOn = True 
  res2@cnLinesOn = False 
  res2@cnLineLabelsOn = False 
  res2@cnInfoLabelOn = False 
  res2@lbLabelBarOn = False 
  res2@cnMonoFillPattern = False 
  res2@cnLevelSelectionMode = "ExplicitLevels" 
  res2@cnLevels=(/0.05/) 
  res2@cnFillPatterns = (/17,-1/) 
  res2@cnFillColors = (/1,0/) 
  res2@gsnLeftString = "" 
  plot3 = gsn_csm_contour(wks,SIG({0:66},:),res2) 
  overlay(plot2,plot3)  
draw(plot2) 
 
end 
 
 
 
 |   
- 
 
 
 
 
 
 
 
 |