title: Identifying the nearest grid point
body: <p>I have three arrays</p>
  
  <pre><code>lat=[15,15.25,15.75,16,....30]
  long=[91,91.25,91.75,92....102]
  
  data=
  array([[  0. ,   0. ,   0. , ...,   0. ,   0. ,   0. ],
         [  0. ,   0. ,   0. , ...,   0. ,   0. ,   0. ],
         [  0. ,   0. ,   0. , ...,   0. ,   0. ,   0. ],
         ..., 
         [-99.9, -99.9, -99.9, ...,   0. ,   0. ,   0. ],
         [-99.9, -99.9, -99.9, ...,   0. ,   0. ,   0. ],
         [-99.9, -99.9, -99.9, ...,   0. ,   0. ,   0. ]])
  </code></pre>
  
  <p>It is of [44 cols and 60 rows] same as long x lat</p>
  
  <p>If I input any point (16.3,101.6), I need to find out the nearest grid and extract the data from that grid from third array. How can I do it using numpy in python ? Here I am giving example of one point, but in real problem, I have several points. </p>
  
  <p>I have tried with this function,</p>
  
  <pre><code>def getclosest_ij(lats,lons,latpt,lonpt):
      dis_sq1=(lats-latpt)
      dis_sq2=(lons-lonpt)
      minidex_lat=dis_sq1.argmin()
      minidex_lon=dis_sq2.argmin()
      return minidex_lon,minidex_lat
  </code></pre>