- 积分
- 1878
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-1-1
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
感谢大家进来看问题~
用ncl绘制小波,在同学linux环境下用ncl是可以出图的,但是用在win7下的ncl却报错了,显示Segmentation fault(核心已转储),但我的文件并不大,应该不是数据造成的。
不知道是什么原因,希望大神们能帮忙看看
脚本如下:
begin
f = addfile("G:/wavelet/1986_2015_summer.nc", "r")
hgt = f->z(:,0,:,:)
aavehgt = dim_avg_n_Wrap(hgt(:,{28:40},{80:102}), (/1,2/))
printVarSummary(aavehgt)
time=aavehgt&time
N=dimsizes(aavehgt)
;---小波计算
mother=0 ;母小波类型,通常为0,即“Morlet”小波
dt=1 ;时间间隔,1年
param=-1 ;默认数值;6
s0=dt ;
dj=0.25 ;常用设定
jtot=1+floattointeger(((log10(N*dt/s0))/dj)/log10(2.)) ;常用设定
npad=N ; 常用设定
nadof=0 ; 常用设定
noise=1 ; 常用设定,红噪声检验
siglvl=.05 ; 置信度水平
isigtest=0 ;采用chi-square检验
w=wavelet(aavehgt,mother,dt,param,s0,dj,jtot,npad,noise,isigtest,siglvl,nadof)
;-----------------------------------------
power =onedtond(w@power,(/jtot,N/)) ;功率普
power!0="period" ;Y axis
power&period =w@period
power!1="time" ;X axis
power&time=ispan(1986,2015,1)
power@long_name="Power Spectrum"
power@units = "1/unit-freq"
;计算显著性(>=1则显著)
SIG = power ;复制元数据
SIG = power/conform(power,w@signif,0)
SIG@long_name="Significance"
SIG@units = " "
;---------------------------------------
wks=gsn_open_wks("png","G:/plot-enso-wavelet")
gsn_define_colormap(wks,"BlAqGrYeOrReVi200")
YLValues = (/1,2,4,8,16,32/)
YLLabels = (/"1","2","4","8","16","32"/)
res = True
res@gsnDraw = False
res@gsnFrame = False
res@gsnRightString = " "
res@gsnLeftString = " "
res@trYReverse = True ;daozhi y_axis
res@tmYLMode = "Explicit"
;res@tmYLValues = w@period
;res@tmYLLabels = w@period
res@tmYLValues = YLValues
res@tmYLLabels= YLLabels
res@tmLabelAutoStride = True
res@trYMaxF=max(YLValues)
;res@trYMinF=min(YLValues)
res@cnLinesOn = False
res@cnLineLabelsOn = False
res@cnInfoLabelOn = False
;res@cnLevelSelectionMode="ManualLevels"
;res@cnMinLevelValF = 0.00
; res@cnMaxLevelValF = 0.40
; res@cnLevelSpacingF = 0.10
res2 = res
res@tiXAxisString = "Year"
res@tiXAxisOffsetYF = 0.135
res@tiYAxisString = "Years"
res@cnFillOn = True
res@cnFillMode = "RasterFill"
res@cnRasterSmoothingOn = True
;===========
res2@cnLevelSelectionMode = "ManualLevels"
res2@cnMinLevelsValF = 0.00
res2@cnMaxLevelsValF = 2.00
res2@cnLevelSpacingF = 1.00
res2@cnFillScaleF = 0.5
res2@cnFillDotSizeF=0.002
plot = gsn_csm_contour(wks,power,res)
iplot = gsn_csm_contour(wks,SIG,res2)
opt=True
opt@gsnShadeFillType = "pattern"
opt@gsnShadeHigh = 17
iplot = gsn_contour_shade(iplot, -999., 1., opt)
overlay(plot,iplot)
;resg= True
;resg@cnFillOn=True
plot = ShadeCOI(wks,plot,w,power&time,False)
gws = w@gws
resl = True
resl@gsnFrame = False
resl@gsnDraw = False
resl@trYAxisType = "LogAxis"
resl@trYReverse = True
resl@tmYLMode = "Explicit"
resl@tmYLValues = YLValues
resl@tmYLLabels = YLLabels
resl@trYMaxF = max(YLValues)
resl@trYMinF = min(YLValues)
resl@tiXAxisString = "Global Wavelet Power"
plotg=gsn_csm_xy(wks,gws,power&period,resl)
plotc = gsn_attach_plots(plot,plotg,res,resl)
draw(plot)
frame(wks)
end
非常感谢大家!!
|
|