<div dir="ltr">Hi Shaimah,<div>There is a couple ways to do this. You can change the period coordinate variable to be in units of months,<br><div>changing this:</div><div>power&period     = w@period<br></div><div>to this:</div><div>power&period     = w@period*12<br></div><div>(and then set tmYLValues/tmYLLabels how you'd like)</div><div><br></div><div>or, leave the period alone and simply alter the tmYLLabels:</div><div>res@tmYLMode = "Explicit"<br>res@tmYLValues = (/1,2,4,8,16,32,64,128/)<br>res@tmYLLabels = res@tmYLValues*12</div><div><br></div><div>Either should work. </div><div>Adam</div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 4, 2019 at 12:41 AM Shaimah ali via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi,<br></div>I am plotting a wavelet based on this example<br><a href="https://www.ncl.ucar.edu/Applications/Scripts/wavelet_2.ncl" target="_blank">https://www.ncl.ucar.edu/Applications/Scripts/wavelet_2.ncl</a>.<br><br></div><div>I need to convert the Y-axis periods in to units of months(like 12,20,40..months),instead of units of years.. So what are the changes i have to be done in my code.<br></div><div>I have monthly mean data of AOD for 19.7 years.(235 values).<br>here is my code:<br><br>aod = asciiread("aod.dat",-1,"float")<br>  aod!0 = "time"<br>  ntime = dimsizes(aod)<br>  timeo = fspan(2000.19,2019.,ntime)<br>  aod&time = timeo<br><br>  time  = timeo<br>  N     = dimsizes(time)<br>  <br>;WAVELET<br><br>  mother  = 0<br>  param   = 6.0<br>  dt      = 0.25   ;timesteps in units of years<br>  s0      = dt<br>  dj      = 0.25 <br>  jtot    = 1+floattointeger(((log10(N*dt/s0))/dj)/log10(2.))<br>  npad    = N<br>  nadof   = 0<br>  noise   = 1<br>  siglvl  = .05<br>  isigtest= 0<br><br>  w = wavelet(aod,mother,dt,param,s0,dj,jtot,npad,noise,isigtest,siglvl,nadof)<br><br>; create coodinate arrays for plot<br><br>  power            = onedtond(w@power,(/jtot,N/))<br>  power!0          = "period"                        ; Y axis<br>  power&period     = w@period                      ; convert period to units of years<br><br>  power!1          = "time"                          ; X axis<br>  power&time       = time<br><br>  power@long_name  = "Power Spectrum"<br>  power@units      = "1/unit-freq"<br><br>  <br>; compute significance ( >= 1 is significant)<br>  SIG              = power                            ; transfer meta data<br>  SIG              = power/conform (power,w@signif,0)<br>  SIG@long_name    = "Significance"<br>  SIG@units        = " "<br><br>; initial resource settings<br><br>  wks = gsn_open_wks("png","01")             ; send graphics to PNG file<br><br>  res                     = True                  ; plot mods desired<br>  res@gsnDraw             = True ;False                 ; Do not draw plot<br>  res@gsnFrame            = True ;False                 ; Do not advance frome<br>  res@gsnMaximize         = True <br>  res@cnFillOn            = True                  ; turn on color<br>  res@cnFillPalette       = "BlAqGrYeOrReVi200"   ; set color map<br>  res@cnFillMode          = "RasterFill"          ; turn on raster mode<br>  res@cnRasterSmoothingOn = True                  ; turn on raster smoothing<br>  res@cnLinesOn           = False ;True                 ; turn off contour lines<br>  res@cnLineLabelsOn      = False<br>  res@cnInfoLabelOn       = False<br>  res@trYReverse          = False  ;True                  ; reverse y-axis <br>  res@tmLabelAutoStride   = False   ;True<br>  res@tmYROn              = False <br>  res@tmXTOn              = False<br><br>  res@tmYLMode = "Explicit"<br><br>  res@tmYLValues = (/1,2,4,8,16,32,64,128/)<br>  res@tmYLLabels = (/"1","2","4","8","16","32","64","128"/)<br>  <br>  res@tmXBMode = "Explicit"<br>  res@tmXBValues = (/20,40,60,80,100,120,140,160,180,200,220,240/)<br>  res@tmXBLabels = (/"20","40","60","80","100","120","140","160","180","200","220","240"/)<br>  <br>  <br>  res@cnLevelSelectionMode = "ExplicitLevels"       ; set manual contour levels<br>  res@cnLevels = (/0.01,0.02,0.04,0.08,0.1,0.12,0.14,0.16,0.20,0.24,0.28,0.32/)<br><br>  res@tiMainString       = ""<br>  res@gsnRightString      = ""<br>  res@gsnCenterString     = "AOD"<br>  res@gsnLeftString       = ""<br>  res@tiYAxisString       = "Periodicities (years)"<br>  res@tiXAxisString       = "Months(2000-2019)"<br><br>  plot = new(2,graphic)<br>  plot(0) = gsn_csm_contour(wks,power,res)<br><br><br></div><div>THANK YOU<br></div><div>Shaima.N<br></div></div></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_-6117770734125356102gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist,  </font></span><span><font color="#888888">Climate and Global Dynamics Laboratory, NCAR<br></font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a>   </font></span><span><font color="#888888">303-497-1726 </font></span></div><span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div></div></div></div></div></div></div>