Hi I am trying to produce a wavelet, similar to the example at
http://www.ncl.ucar.edu/Applications/Scripts/wavelet_1.ncl
i keep getting an error that relates to a missing coordinate variable
of time, although time is in the variable I'm reading in (R).
May I have some help getting past this?
Sincerely,
Erik
be1005en% ncl wavelet_1.ncl
Copyright (C) 1995-2007 - All Rights Reserved
University Corporation for Atmospheric Research
NCAR Command Language Version 5.0.0
The use of this software is governed by a License Agreement.
See http://www.ncl.ucar.edu/ for more details.
fatal:No coordinate variable exists for dimension (time) in variable (R)
fatal:Execute: Error occurred at or near line 21 in file wavelet_1.ncl
be1005en%
SCRIPT:
;***********************************
; wavelet_1.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/shea_util.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
;***********************************
begin
;************************************
; set some parameters
;************************************
idtrend = 0 ; 0=no_detrend ; 1=detrend
ifilt = 0
nave = 5 ; length of smoother
;************************************
; create pointer to file and read in variables
;************************************
f = addfile ("accum_precip.nc","r")
R = f->Accum_Rain ; one value/year
printVarSummary(R)
time = R&time
N = dimsizes(time)
x = dim_avg(R)
y = dim_avg(x)
w = wavelet_default(y,0)
;************************************
; create coodinate arrays for plot
;************************************
power = onedtond(w_at_power,(/jtot,N/))
power!0 = "period" ; Y axis
power&period = w_at_period
power!1 = "time" ; X axis
power&time = time
power_at_long_name = "Power Spectrum"
power_at_units = "1/unit-freq"
; compute significance ( >= 1 is significant)
SIG = power ; transfer meta data
SIG = power/conform (power,w_at_signif,0)
SIG_at_long_name = "Significance"
SIG_at_units = " "
;************************************
; initial resource settings
;************************************
wks = gsn_open_wks("ps","wavelet_precip") ; open ps file
gsn_define_colormap(wks,"BlAqGrYeOrReVi200") ; choose colormap
res = True ; plot mods desired
res_at_cnFillOn = True ; turn on color
res_at_cnFillMode = "RasterFill" ; turn on raster mode
res_at_cnRasterSmoothingOn = True ; turn on raster smoothing
res_at_cnLinesOn = False ; turn off contour lines
res_at_gsnSpreadColors = True ; use full colormap
res_at_lbOrientation = "Vertical" ; vertical label bar
res_at_trYReverse = True ; reverse y-axis
res_at_tmLabelAutoStride = True
res_at_vpHeightF = .4 ; height and width of plot
res_at_vpWidthF = .85
res_at_cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
res_at_cnMinLevelValF = 0.0 ; set min contour level
res_at_cnMaxLevelValF = 80.0 ; set max contour level
res_at_cnLevelSpacingF = 2.0 ; set contour spacing
res_at_gsnLeftString = "Wavelet Significance"
plot = gsn_csm_contour(wks,SIG({0:80},:),res)
end
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sun Jul 06 2008 - 12:13:01 MDT
This archive was generated by hypermail 2.2.0 : Sun Jul 06 2008 - 17:20:47 MDT