[ncl-talk] Find the nearest 9 points of a station

Dennis Shea shea at ucar.edu
Mon May 11 15:26:06 MDT 2015


The index values of the closest single ?swath or grid? pt is given by:

http://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml

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

Attached is a slightly mangled function which I modified for your
purpose...
It is UNTESTED . Look at the code. Fix if necessary.



On Mon, May 11, 2015 at 1:05 PM, Yun Yue <yunyue at huskers.unl.edu> wrote:

>  Hi  NCL users,
>
> Say I have a station's lat and lon, I also have MODIS data. In order to
> find the nearest 9 pixels' index to this station, I could calculate
> distance between every pixel and the station, then find the nearest 9
> pixels.
>
> Is there any NCL function to find 9 pixels' index in a faster way?
>
> Thank you very much.
>
> Yun
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150511/aa081e34/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ClosestLocation2d.ncl
Type: application/octet-stream
Size: 1404 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150511/aa081e34/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tst_ClosestLocation2d.ncl
Type: application/octet-stream
Size: 717 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150511/aa081e34/attachment-0001.obj 


More information about the ncl-talk mailing list