<div dir="ltr"><div class="gmail_default" style="font-size:small">Dear Ankita,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">In general, it is hard for us to simply look at a script and determine what the problem is without information about what is wrong. That is, are you getting an error? Are you getting a bad plot?</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">However, I see you are trying to overlay a pressure/hgt plot, which is pressure versus latitude, and overlay this on a map (lat/lon) plot, which doesn't make sense. These are two different coordinate systems and it simply won't work.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Please explain in more detail about what you are trying to plot. It would also help if you can provide the data.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Thanks,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jan 6, 2018 at 12:11 AM, Ankita Sharma via ncl-talk <span dir="ltr"><<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:"comic sans ms",sans-serif"><font color="#000000">Hello,</font></div><div class="gmail_default" style="font-family:"comic sans ms",sans-serif"><font color="#000000"><br></font></div><div class="gmail_default" style="font-family:"comic sans ms",sans-serif"><font color="#000000"> I have seen scripts regarding my issues and also tried to correct my scripts using concepts of that scripts. I am new to NCL and have tried every possible measure to plot Hovmueller diagram but still, I'm stuck into it.</font><span style="color:rgb(7,55,99)"></span></div><div class="gmail_default" style="font-family:"comic sans ms",sans-serif"><font color="#000000">It's my humble request to NCL committee that please have a look at my script and help me with my issues in plotting vector Hovmueller diagram.</font></div><div class="gmail_default" style="font-family:"comic sans ms",sans-serif"><font color="#000000">I am sending you the script upon which I have been working from last one month.</font></div><div class="gmail_default" style="font-family:"comic sans ms",sans-serif"><font color="#000000"><br></font></div><div class="gmail_default" style="font-family:"comic sans ms",sans-serif"><span style="color:rgb(0,0,255)"><br></span></div><div class="gmail_default" style="font-family:"comic sans ms",sans-serif"><span style="color:rgb(0,0,255)">begin</span><br></div><div class="gmail_default"><font face="comic sans ms, sans-serif" color="#0000ff"><div class="gmail_default"><br></div><div class="gmail_default">;---File handling</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span></div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>fn = "<a href="http://omega.mon.mean.nc" target="_blank">omega.mon.mean.nc</a>" ; define filename</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>omega = addfile(fn,"r")<span style="white-space:pre-wrap"> </span> <span style="white-space:pre-wrap"> </span>; open netcdf file</div><div class="gmail_default"><span style="white-space:pre-wrap"> </span>fn = "<a href="http://uwnd.mon.mean.nc" target="_blank">uwnd.mon.mean.nc</a>" ; define filename</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>uwnd = addfile(fn,"r") <span style="white-space:pre-wrap"> </span>; open netcdf file</div><div class="gmail_default"><br></div><div class="gmail_default">;---Read needed variables from file</div><div class="gmail_default"> </div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>U = uwnd->uwnd</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>W = omega->omega</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>P0mb = 1000.</div><div class="gmail_default"><span style="white-space:pre-wrap"> </span>hyam = uwnd->uwnd <span style="white-space:pre-wrap"> </span>; get a coefficiants</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>hybm = omega->omega <span style="white-space:pre-wrap"> </span>; get b coefficiants</div><div class="gmail_default"><br></div><div class="gmail_default">;---Define other arguments required</div><div class="gmail_default"> interp = 2 </div><div class="gmail_default"> pnew = (/ 1000,900,850,800,750,700,550,<wbr>500,250,200,150,100/)</div><div class="gmail_default"> pnew@units = "mb" </div><div class="gmail_default">;</div><div class="gmail_default">; Omega is significantly smaller than u, so we will scale it so that some vertical motion is visible</div><div class="gmail_default">;</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span></div><div class="gmail_default"><span style="white-space:pre-wrap"> </span>wAve = avg(W(0,:,:,{170})) <span style="white-space:pre-wrap"> </span>; used for scaling</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>uAve = avg(U(0,:,:,{170}))</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>scale = fabs(uAve/wAve)</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>wscale = W*scale <span style="white-space:pre-wrap"> </span>; now scale</div><div class="gmail_default"><br></div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>copy_VarCoords(W, wscale) <span style="white-space:pre-wrap"> </span>; copy coordinate variables</div><div class="gmail_default"><br></div><div class="gmail_default"><br></div><div class="gmail_default">;*****************************<wbr>********************</div><div class="gmail_default">; calculate divergence: Use Wrap to include meta data</div><div class="gmail_default">;*****************************<wbr>********************</div><div class="gmail_default"><br></div><div class="gmail_default"><span style="white-space:pre-wrap"> </span>f = addfile ("<a href="http://uwnd.mon.mean.nc" target="_blank">uwnd.mon.mean.nc</a>", "r")</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>u = f->uwnd</div><div class="gmail_default"><span style="white-space:pre-wrap"> </span>f = addfile ("<a href="http://vwnd.mon.mean.nc" target="_blank">vwnd.mon.mean.nc</a>", "r")</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>v = f->vwnd</div><div class="gmail_default"><br></div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>div = uv2dvG_Wrap(u,v) ; u,v ==> divergence</div><div class="gmail_default"><br></div><div class="gmail_default">;*****************************<wbr>********************</div><div class="gmail_default">; calculate divergent wind components </div><div class="gmail_default">;*****************************<wbr>******************** </div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>ud = new ( dimsizes(u), typeof(u), u@_FillValue )</div><div class="gmail_default"><span style="white-space:pre-wrap"> </span>vd = new ( dimsizes(v), typeof(v), v@_FillValue )</div><div class="gmail_default"><br></div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>dv2uvg(div,ud,vd) ; div ==> divergent wind components</div><div class="gmail_default"><br></div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>copy_VarCoords(u, ud ) </div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>copy_VarCoords(u, vd ) </div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>ud@long_name = "Zonal Divergent Wind"</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>ud@units = u@units</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>vd@long_name = "Meridional Divergent Wind"</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>vd@units = v@units </div><div class="gmail_default"><br></div><div class="gmail_default">;---Create plot</div><div class="gmail_default"> </div><div class="gmail_default"><span style="white-space:pre-wrap"> </span>wks = gsn_open_wks ("png", "Vector" ) <span style="white-space:pre-wrap"> </span>; send graphics to PNG file</div><div class="gmail_default"><br></div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>res = True <span style="white-space:pre-wrap"> </span>; plot mods desired</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>res@tiMainString = "Vector Hovmoller" <span style="white-space:pre-wrap"> </span>; title</div><div class="gmail_default"><br></div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>res@cnLineLabelsOn = True <span style="white-space:pre-wrap"> </span>; turn off line labels</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>res@cnFillOn = True <span style="white-space:pre-wrap"> </span>; turn on color fill</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>res@cnFillPalette = "GMT_polar" <span style="white-space:pre-wrap"> </span>; choose color map</div><div class="gmail_default"><br></div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>res@lbLabelStride = 2 <span style="white-space:pre-wrap"> </span>; every other color</div><div class="gmail_default"><br></div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>res@vcRefMagnitudeF = 3.0 <span style="white-space:pre-wrap"> </span>; define vector ref mag</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>res@vcRefLengthF = 0.045 <span style="white-space:pre-wrap"> </span>; define length of vec ref</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>res@vcGlyphStyle = "CurlyVector" <span style="white-space:pre-wrap"> </span>; turn on curly vectors</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>res@vcMinDistanceF = 0.01 <span style="white-space:pre-wrap"> </span>; thin out vectors</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>res@vcMapDirection = True</div><div class="gmail_default"><br></div><div class="gmail_default"><span style="white-space:pre-wrap"> </span>res = True</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>res@vcRefMagnitudeF = 4. ; make vectors larger</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>res@vcRefLengthF = 0.050 ; reference vector length</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>res@vcGlyphStyle = "CurlyVector" ; turn on curly vectors</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>res@vcMinDistanceF = 0.012 ; thin the vectors</div><div class="gmail_default"> </div><div class="gmail_default"><br></div><div class="gmail_default"><br></div><div class="gmail_default">;---Draw plot from pole to pole at 180E</div><div class="gmail_default"> </div><div class="gmail_default"><span style="white-space:pre-wrap"> </span>plot = gsn_csm_pres_hgt_vector(wks,U(<wbr>0,:,:,{170}),W(0,:,:,{170}),<wbr>wscale(0,:,:,{170}),res ) </div><div class="gmail_default"><span style="white-space:pre-wrap"> </span>plot_ov = gsn_csm_vector_map(wks,ud(0,1,<wbr>:,:),vd(0,1,:,:),res)</div><div class="gmail_default"><br></div><div class="gmail_default"><span style="white-space:pre-wrap"> </span>overlay(plot,plot_ov) ; overlay the U-wind plot on the hovmoller plot</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>draw(plot) ; draw the temperature plot (with the U-wind plot overlaid)</div><div class="gmail_default"> <span style="white-space:pre-wrap"> </span>frame(wks) ; advance the frame</div><div class="gmail_default"><br></div><div class="gmail_default">end</div><div class="gmail_default"><br></div><div class="gmail_default"><br></div><div class="gmail_default"><div class="gmail_default" style="color:rgb(34,34,34)"><font color="#000000">Thank you,</font></div><div class="gmail_default" style="color:rgb(34,34,34)"><font color="#000000">Ankita Sharma</font></div></div></font></div></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">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/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>