<div dir="ltr"><div><div>Hi Matt,<br><br></div>I haven't been able to get the diagonal slicing with wrf_user_intrp3d to work right but I have been able to get diagonal cross-sections, though it was not pretty. Essentially created some arrays of the points that were in the cross-section and then used wrf_interp_1d to interpolate the data at each point in the list to higher resolution in the vertical. Works best with points on the 45 deg angle to reduce horizontal space between points but I suppose that any array of points should work. I played with the "2-point" example for multiple days before going other routes. This way does however let you control the horizontal extent like you were looking to do.<br><br><br></div><div>I'll search for the script and pass it along if you would like to give it a whirl.<br><br></div><div>-Alex<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 23, 2015 at 11:40 AM, Matthew Fearon <span dir="ltr"><<a href="mailto:Matthew.Fearon@dri.edu" target="_blank">Matthew.Fearon@dri.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">Hi Evelyn,<br>
Thank you for your help. I was able to get a diagonal slice using the single pivot point (and angle) example. Still no luck with the two point example. The latter would be better as I could limit the horizontal extent more easily. I'll try again later.
<br>
thanks again,<br>
Matt<br>
<br>
<div style="font-family:Times New Roman;color:#000000;font-size:16px">
<hr>
<div style="direction:ltr"><font face="Tahoma" color="#000000"><b>From:</b> Evelyn Grell - NOAA Affiliate [<a href="mailto:evelyn.grell@noaa.gov" target="_blank">evelyn.grell@noaa.gov</a>]<br>
<b>Sent:</b> Monday, March 23, 2015 8:12 AM<br>
<b>To:</b> Matthew Fearon<br>
<b>Cc:</b> <a href="mailto:wrf-help@ucar.edu" target="_blank">wrf-help@ucar.edu</a>; <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
<b>Subject:</b> Re: [ncl-talk] diagonal cross section with wrf_user_intrp3d<br>
</font><br>
</div><div><div class="h5">
<div></div>
<div>
<div dir="ltr">
<div class="gmail_default">
<div>
<div style="width:905px">
<div>
<div>
<div>
<div>
<div>
<div style="overflow:hidden">
<div dir="ltr">
<div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:12.8000001907349px">
Matthew,</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:12.8000001907349px">
<br>
</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:12.8000001907349px">
Regarding your second question (the easier one), I got confused by this too. I believe the order of the variables got changed between versions:</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:12.8000001907349px">
<div class="gmail_default" style="font-size:12.8000001907349px">In v6.1.2, the order to specify 2 points for a cross section has to be x1,x2,y1,y2.</div>
<div class="gmail_default" style="font-size:12.8000001907349px">In v6.2.1, the order to specify 2 points has to be x1,y1,x2,y2.</div>
<div class="gmail_default" style="font-size:12.8000001907349px">(maybe wrfhelp could add a note in the example.)</div>
<div class="gmail_default" style="font-size:12.8000001907349px"><br>
</div>
<div class="gmail_default" style="font-size:12.8000001907349px">You can check by looking at the code in your</div>
</div>
<div class="gmail_default"><font face="tahoma, sans-serif"><span style="font-size:12.8000001907349px">$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl</span></font><br>
</div>
<div class="gmail_default"><font face="tahoma, sans-serif"><span style="font-size:12.8000001907349px"><br>
</span></font></div>
<div class="gmail_default"><font face="tahoma, sans-serif"><span style="font-size:12.8000001907349px">Another thing that I ran into is that it assumes you are defining your points in "WRF" space (ie arrays start with 1) rather than in "NCL" space (ie
arrays start with 0) so it subtracts 1 for you...</span></font></div>
<div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:12.8000001907349px">
<br>
</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:12.8000001907349px">
<span style="font-size:12.8000001907349px">In wrf_user_interp3d:</span><br>
</div>
<div class="gmail_default" style="font-family:arial,sans-serif;font-size:12.8000001907349px">
<pre><font color="#0000ff">; set vertical cross section
if (opts) then
xy = wrf_user_set_xy( z, loc_param(0)-1, loc_param(2)-1, \ ; the -1 is for NCL dimensions
loc_param(1)-1, loc_param(3)-1, \
angle, opts )</font><font face="tahoma, sans-serif">
</font></pre>
<div style="font-family:tahoma,sans-serif">(loc_param is the variable containing your XS endpoints).</div>
<div style="font-family:tahoma,sans-serif"><br>
</div>
<div style="font-family:tahoma,sans-serif">About your first question, maybe you are missing the 2d interpolation that defines the x-axis?</div>
<div style="font-family:tahoma,sans-serif"><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<div style="width:905px">
<div>
<div>
<div>
<div>
<div>
<div style="overflow:hidden">
<div dir="ltr">
<div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:12.8000001907349px">
something like:</div>
<div class="gmail_default">
<div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:12.8000001907349px">
if (xang.gt.20. .and. xang.lt.340) then</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:12.8000001907349px">
X_plane = wrf_user_intrp2d(lon,xspts,0.,True)</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:12.8000001907349px">
else</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:12.8000001907349px">
X_plane = wrf_user_intrp2d(lat,xspts,0.,True)</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:12.8000001907349px">
end if</div>
<div class="gmail_default">
<div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:12.8000001907349px">
dimsX = dimsizes(X_plane)</div>
<div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:12.8000001907349px">
xspan = dimsX(0)-1</div>
<div style="font-family:tahoma,sans-serif;font-size:12.8000001907349px"><br>
</div>
<div><font face="tahoma, sans-serif"><span style="font-size:12.8000001907349px"> res@tmXBValues = fspan(0,xspan,2) </span></font><br>
</div>
</div>
<div style="font-family:tahoma,sans-serif;font-size:12.8000001907349px"><br>
</div>
<div style="font-family:tahoma,sans-serif;font-size:12.8000001907349px">Hope that helps,</div>
<div style="font-family:tahoma,sans-serif;font-size:12.8000001907349px">Evelyn Grell</div>
<div style="font-family:tahoma,sans-serif;font-size:12.8000001907349px"><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Mon, Mar 23, 2015 at 12:21 AM, Matthew Fearon <span dir="ltr">
<<a href="mailto:Matthew.Fearon@dri.edu" target="_blank">Matthew.Fearon@dri.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">
<pre>Dear WRF-help and NCL users,<br><br>Has anyone successfully plotted a cross section with wrf data <br>along a diagonal, say southeast to northwest or vice versa, using <br>wrf_user_intrp3d? North/south or east/west works fine, but from the <br>documentation, a diagonal seemed possible using the example below<b>, <br></b>although I can't get it working<b>? <br><br></b>Also, the plane is defined (/xstart,xend , ystart,yend/) for sure<br>rather than (/xstart,ystart , xend,yend/) instead?<b><br><br></b>thanks,<br>Matt<b><br><br></b><br><br><br>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"<b>
a = <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/addfile.shtml" target="_blank"><strong>addfile</strong></a></b>("wrfout_d01_2000-01-24_12:00:<a href="http://00.nc" target="_blank">00.nc</a>","r")
time = 1
tc = <a href="https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_getvar.shtml" target="_blank"><strong>wrf_user_getvar</strong></a>(a,"tc",time) ; T [C]
z = <a href="https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_getvar.shtml" target="_blank"><strong>wrf_user_getvar</strong></a>(a,"z",time) ; z on mass points
plane = (/ 40,81 , 259,81 /) ; approx. START x;y and END x;y point
; Extract cross section from point A to point B, as defined in "plane"
; And vertically interpolate to height coordinates ("z")
tc_plane = <strong>wrf_user_intrp3d</strong>(tc,z,"v",plane,0.,True)</pre>
</div>
</div>
<br>
_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</div></div></div>
</div>
</div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>