- 积分
- 279
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-12-10
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 sona 于 2020-2-6 09:42 编辑
我的数据前后有missing value导致不能正常计算……这是一个光找问题没动脑子的案例 :(
我在用ncl小波分析一个时间序列,因对机理不甚了解,所以就按照ncl范例改了改,但是一直无法出图,总显示以下类似错误
> plot = gsn_csm_contour(wks,power,res)
warning:ContourPlotInitialize: scalar field is constant; no contour lines will appear; use cnConstFEnableFill to enable fill
我就回去查了一下数据,发现计算后的power居然都是inf,不知道这究竟是什么问题,还请各位指教一二。多谢!
部分代码如下:
时间序列是eof分析后的一个pc,开始还想作dtrend,出问题后回溯原因时,发现dtrend后的序列显示如下,除了开始两个值,后面全是一样的值
(0) 9.884003e+36
(1) 9.884003e+36
(2) -8.520693e+34
(3) -8.520693e+34
(4) -8.520693e+34
(5) -8.520693e+34
……
不知道什么原因?
然后我就采用原序列,时间序列是月分辨率,但是无论dt设成1.还是1./12,结果都一样,不知道到底是哪里出了问题?
wts = eof_ts(0,:)
; wts = dtrend(wts,False)
mother = 0
param = 6.0
dt = 1.
s0 = dt
dj = 0.25
jtot = 1 + floattointeger(((log10(N*dt/s0))/dj)/log10(2.))
npad = N
nadof = new(2,float)
noise = 1
siglvl = .05
isigtest= 1
w = wavelet(wts,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 = "time" ; X axis
power&time = time
power@long_name = "Power Spectrum"
power@units = "unit^2"
; compute significance ( >= 1 is significant)
SIG = power ; transfer meta data
SIG = power/conform (power,w@signif,0)
SIG@long_name = "Significance"
SIG@units = " "
;************************************
; initial resource settings
;************************************
wks = gsn_open_wks("x11","wavelet") ; send graphics to PNG file
plot = new(2,graphic) ; create graphical array
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@cnFillPalette = "BlAqGrYeOrReVi200" ; set color map
res@cnFillMode = "RasterFill" ; turn on raster mode
res@cnRasterSmoothingOn = True ; turn on raster smoothing
res@cnLinesOn = False ; turn off contour lines
res@lbOrientation = "Vertical" ; vertical label bar
res@trYReverse = True ; reverse y-axis
res@tmLabelAutoStride = True
res@vpHeightF = .4 ; height and width of plot
res@vpWidthF = .85
res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
res@cnMinLevelValF = 0.0 ; set min contour level
res@cnMaxLevelValF = 20.0 ; set max contour level
res@cnLevelSpacingF = 2.0 ; set contour spacing
; power
res@gsnLeftString = "Wavelet Power"
plot(0) = gsn_csm_contour(wks,power({0:35},0:N-1),res)
; significance
res@cnMinLevelValF = 1.0 ; set min contour level
res@cnMaxLevelValF = 4.0 ; set max contour level
res@cnLevelSpacingF = 3.0 ; set contour spacing
res@gsnLeftString = "Wavelet Significance"
plot(1) = gsn_csm_contour(wks,SIG({0:35},0:N-1),res)
|
|