<div dir="ltr"><div>Dear Rick & Dennis, <br></div><div>So many thanks for your help. It was so efficient.</div><div>Best wishes,<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Feb 26, 2022 at 2:22 AM Dennis Shea <<a href="mailto:shea@ucar.edu">shea@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>Expanding on Rick's post</div><div>===</div><div>There are several functions that can be used.</div><div><br></div><div>Two are:</div><div> (1) <a href="https://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml" target="_blank"><b>getind_latlon2d</b></a><b> </b><== get the index values if the four nearest grid points to the user specified location(s)</div><div> return the values of the nearest grid point location. No interpolation is performed.<br></div><div> (2) <a href="https://www.ncl.ucar.edu/Document/Functions/Contributed/rcm2points_Wrap.shtml" target="_blank"><b>rcm2points_Wrap</b></a><b> </b><== use the four nearest grid points and use bilinear interpolation to obtain values at the user specified location(s)</div><div><br></div><div>===</div><div>I modified Rick's code to use each function:<br></div><div><br></div><div>[1]</div><div> %> ncl <b>extract-LatLonAOD_getind_latlon2d.ncl </b>==> aod-siri.getind_latlon2d.txt</div><div>[2] <br></div><div> %> ncl <b>extract-LatLonAOD_rcm2pts.ncl</b> ==> aod-siri.rcm2points.txt</div><div><br></div><div><div><br></div><div>BOTH scripts have many print statements to facilitate understanding the flow. Please examine the outputs.<br></div></div><div>------------------------<br></div><div>aod-siri.rcm2points.txt contains values bilinearly interpolated using the 4 nearest grid points<br></div><div><br></div><div>00001 2015040106 25.90 54.55 0.39799 <br>00002 2015040112 25.90 54.55 0.40869 <br>00003 2015040118 25.90 54.55 0.35409 <br>00004 2015040200 25.90 54.55 0.46902 <br>00005 2015040206 25.90 54.55 0.55770 <br>00006 2015040212 25.90 54.55 0.33024 <br>00007 2015040218 25.90 54.55 0.10930 <br>00008 2015040300 25.90 54.55 0.06019</div><div>----------------------</div><div><br></div><div>aod-siri.getind_latlon2d.txt contains values at the nearest grid point<br></div><div><br></div><div>00001 2015040106 25.91 54.56 0.39773 <br>00002 2015040112 25.91 54.56 0.40965 <br>00003 2015040118 25.91 54.56 0.35460 <br>00004 2015040200 25.91 54.56 0.46916 <br>00005 2015040206 25.91 54.56 0.55682 <br>00006 2015040212 25.91 54.56 0.32912 <br>00007 2015040218 25.91 54.56 0.10935 <br></div><div><br></div><div>================</div><br><div><br></div><div><br></div><div><br></div><div><br><b></b></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 25, 2022 at 10:35 AM Rick Brownrigg via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.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>I'm not certain about extracting the values at specific locations. It looks like you were on the right track (at least, a solution that works). I've attached a very slightly modified version of the script fragment you sent. I made the variables lon_pts/lat_pts proper arrays (lines 6-7), and then closed the do-loop so the script is syntactically correct (line 30). The indices returned by getind_latlon2d() seem to be about right, as seen by the added print statement at line 24.<br></div><div><br></div><div> Hope that helps...</div><div>Rick</div><div><br></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">S.Rahimi<br><br></div>