[ncl-talk] unmatched lats/lons on plotted map

Dennis Shea shea at ucar.edu
Fri Feb 25 15:52:15 MST 2022


Expanding on Rick's post
===
There are several functions that can be used.

Two are:
   (1)  *getind_latlon2d*
<https://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml>
<== get the index values if the four nearest grid points to the user
specified location(s)
                                                 return the values of the
nearest grid point location. No interpolation is performed.
   (2)  *rcm2points_Wrap*
<https://www.ncl.ucar.edu/Document/Functions/Contributed/rcm2points_Wrap.shtml>
<== use the four nearest grid points and use bilinear interpolation to
obtain values at the user specified location(s)

===
I modified Rick's code to use each function:

[1]
      %>  ncl *extract-LatLonAOD_getind_latlon2d.ncl     *==>
aod-siri.getind_latlon2d.txt
[2]
      %>  ncl *extract-LatLonAOD_rcm2pts.ncl*                  ==>
aod-siri.rcm2points.txt


BOTH scripts have many print statements to facilitate understanding the
flow. Please examine the outputs.
------------------------
aod-siri.rcm2points.txt  contains values bilinearly interpolated using the
4 nearest grid points

00001 2015040106   25.90    54.55    0.39799
00002 2015040112   25.90    54.55    0.40869
00003 2015040118   25.90    54.55    0.35409
00004 2015040200   25.90    54.55    0.46902
00005 2015040206   25.90    54.55    0.55770
00006 2015040212   25.90    54.55    0.33024
00007 2015040218   25.90    54.55    0.10930
00008 2015040300   25.90    54.55    0.06019
----------------------

aod-siri.getind_latlon2d.txt   contains values at the nearest  grid point

00001 2015040106   25.91    54.56    0.39773
00002 2015040112   25.91    54.56    0.40965
00003 2015040118   25.91    54.56    0.35460
00004 2015040200   25.91    54.56    0.46916
00005 2015040206   25.91    54.56    0.55682
00006 2015040212   25.91    54.56    0.32912
00007 2015040218   25.91    54.56    0.10935

================







On Fri, Feb 25, 2022 at 10:35 AM Rick Brownrigg via ncl-talk <
ncl-talk at mailman.ucar.edu> wrote:

> 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.
>
>  Hope that helps...
> Rick
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at mailman.ucar.edu
> List instructions, subscriber options, unsubscribe:
> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20220225/4e5682af/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: extract-LatLonAOD_rcm2pts.ncl
Type: application/octet-stream
Size: 1696 bytes
Desc: not available
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20220225/4e5682af/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: extract-LatLonAOD_getind_latlon2d.ncl
Type: application/octet-stream
Size: 2119 bytes
Desc: not available
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20220225/4e5682af/attachment-0001.obj>


More information about the ncl-talk mailing list