<div dir="ltr"><div><div><div><div><div>re:<br>===<br><span class="gmail-im">Is
there an **NCL supported** "method to get the locations of a threshold
value?" <br><br>IE: threshold value => contour level? To my knowledge, the short answer is
"no".<br><div><br></div>I know of no way to retrieve the lat/lon locations of a specific or an arbitrary contour level.<br>===<br><br></span></div><span class="gmail-im">I stand corrected. Dave Brown pointed me toward 'get_isolines'<br><br> <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/get_isolines.shtml">http://www.ncl.ucar.edu/Document/Functions/Built-in/get_isolines.shtml</a><br><br></span></div><span class="gmail-im">This will return the x,y (lon,lat) values of specified contour lines. <br><br>**Usage will require careful reading of the documentation.**<br><br>====<br><br><br></span></div><span class="gmail-im">Using the example previously referred to:<br><br> f = addfile("$NCARG_ROOT/lib/ncarg/data/cdf/<a href="http://uv300.nc">uv300.nc</a>","r")<br> u = f->U<br> printVarSummary(u)<br> printMinMax(u,1)<br><br> nt = 0<br><br> wks = gsn_open_wks("png","TEST") ; send graphics to PNG file<br> plot = gsn_csm_contour_map(wks,u(nt,:,:),False) ; create a default plot<br><br> print(plot)<br> print("===============================================")<br><br>;;--------------<br>;; Variable: plot<br>;; Type: obj<br>;; Total Size: 4 bytes<br>;; 1 values<br>;; Number of Dimensions: 1<br>;; Dimensions and sizes: [1]<br>;; Coordinates: <br>;; Number Of Attributes: 3<br>;; tickmarks : tickmarks tickMarkClass 52<br>;; data : TEST_data scalarFieldClass 9<br>;; contour : TEST_contour contourPlotClass 11 <=== graphic object<br>;; (0) map mapPlotClass 37<br>;;--------------<br><br> thresh = 10.0 <br> isolines = get_isolines(plot@contour, thresh) ; <=== input to get_isolines<br> print(isolines) ; [yx | 2] x [points | 72]<br><br>;; Variable: isolines ; simple variable*<br>;; Type: float<br>;; Total Size: 576 bytes<br>;; 144 values<br>;; Number of Dimensions: 2<br>;; Dimensions and sizes: [yx | 2] x [points | 72] <=====<br>;; Coordinates: <br>;; Number Of Attributes: 5<br>;; _FillValue : 9.96921e+36<br>;; level : 10<br>;; segment_count : 2<br>;; start_point : ( 0, 50 ) <==== important<br>;; n_points : ( 50, 22 ) <==== "<br> print("===============================================")<br> print("isolines(0,:)="+isolines(0,:)+ " "+ isolines(1,:))<br> print("===============================================")<br><br>=================================<br></span></div><span class="gmail-im">For multiple contour lines, the function returns a variable of type 'list'.<br></span></div><span class="gmail-im">Each element of the list contains the x,y (lon,lat) of each contour line<br></span><div><div><div><span class="gmail-im"><br></span></div><div><span class="gmail-im">Good Luck<br></span></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 12, 2016 at 3:34 PM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@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><div><span class="">Is
there an **NCL supported** "method to get the locations of a threshold
value?" <br><br>IE: threshold value => contour level? To my knowledge, the short answer is
"no".<br><div><br></div>I know of no way to retrieve the lat/lon locations of a specific or an arbitrary contour level.<br><br>====<br><br></span><div><span class=""><div>This
is a task that is conceptually easy to address. One simple method is to
use linear interpolation. (see attached) However, in practice, there
are issues.<br><br></div><div>Look at the main plot for zonal wind:<br> <a href="http://www.ncl.ucar.edu/Applications/cylineq.shtml" target="_blank">http://www.ncl.ucar.edu/Applic<wbr>ations/cylineq.shtml</a><br><br></div><div>Say, your threshold value is 12.3 m/s.<br><br></div></span><div>At each longitude, there are one or more '12.3' values looking pole_to_pole.<br><br></div>Choose
-8.0 .... at some longitudes there is no such value while at others,
there are multiple values (closed contours). What to do? How to return
reasonable values?<br><br></div><span class=""><div>I am attaching a simple scrip and function that uses the <a href="http://uv300.nc" target="_blank">uv300.nc</a> file distributed with NCL.<br></div></span>You can play with this. Currently, it returns the locations of the 1st encountered threshold value. <br><br></div>If you are looking at (say) the northern hemisphere and there is one 5880gpm contour, it may work for you.<br><br></div>Good luck<div><div class="h5"><br><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 9, 2016 at 10:57 PM, 陈婕 <span dir="ltr"><<a href="mailto:chenj2014@lzu.edu.cn" target="_blank">chenj2014@lzu.edu.cn</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear Mr/Mrs,<br>
<br>
I want to get locations of a threshold value. For example, I want to know the locations of 5880gpm contour line at 500hpa. Actually,I only can find the approximate values and their locations from the original grid data. Is there a function for interpolation or a method to get the locations of a threshold value?<br>
<br>
<br>
Best regards,<br>
Jie Chen<br>
______________________________<wbr>_________________<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/mailma<wbr>n/listinfo/ncl-talk</a><br>
</blockquote></div><br></div></div></div></div></div></div>
</blockquote></div><br></div>