[ncl-talk] Plot wavelet with "Months" as X-axis
Dennis Shea
shea at ucar.edu
Fri Jan 13 09:12:20 MST 2017
You will have to put in the correct numbers. ncl-talk has no idea to
what the 'time' axis refers refers
res at tmYLMode = "Explicit"
res at tmYLValues = (/3000,3500,4000,.....,8000/)
res at tmYLLabels = (/"Jan","Feb",.....,"Dec"/)
On Thu, Jan 12, 2017 at 11:16 PM, Lyndon Mark Olaguera <
olagueralyndonmark429 at gmail.com> wrote:
> Hi All,
>
> I'm plotting a wavelet based from this example https://www.ncl.ucar.
> edu/Document/Functions/Built-in/wavelet.shtml
>
> Is there an easy way to make the x-axis in terms of months (Jan to Dec)?
>
> Here's my code:
>
> begin
> ;************************************
> ; create pointer to file and read in variables
> ;************************************
> f = addfile ("hpass_SCS.nc","r")
> prec = f->PREC(:,0,0) ; one value/year
> time = prec&time
> N = dimsizes(time)
> ;************************************
> ; Remove mean and linear trend (recommended, not required)
> ; Missing values are not allowed.
> ;************************************
> prec = dtrend(prec,False)
> ;************************************
> ; compute wavelet (Missing values not allowed due to use of FFT)
> ;************************************
> mother = 0
> param = 6.0
> dt = 1.
> s0 = 0.25
> dj = 0.25
> jtot = 44
> npad = N
> nadof = new(2,float)
> noise = 1
> siglvl = .05
> isigtest= 1
>
> w = wavelet(prec,mother,dt,param,s0,dj,jtot,npad,noise,
> isigtest,siglvl,nadof)
> ;************************************
> ; 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 = "unit^2"
>
>
> ;************************************
> ; initial resource settings
> ;************************************
> wks = gsn_open_wks("png","wavelet") ; send graphics to PNG
> file
> res = True ; plot mods desired
> res at cnFillOn = True ; turn on color
> res at cnFillPalette = "BlAqGrYeOrReVi200" ; set color map
> 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 lbOrientation = "Vertical" ; vertical label bar
> res at trYReverse = True ; reverse y-axis
> ;res at tmLabelAutoStride = True
> res at cnLevelSelectionMode = "ManualLevels" ; set manual contour
> levels
> res at cnMinLevelValF = 0.0 ; set min contour level
> res at gsnLeftString = "Wavelet Power"
> plot = gsn_csm_contour(wks,power({0:120},:),res)
> end
>
>
> I'll appreciate any help.
>
> Many thanks,
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170113/da528d23/attachment.html
More information about the ncl-talk
mailing list