title: Finding the correspondence of data from one data set in the other
body: <p>I have <a href="https://drive.google.com/file/d/0B3HWMYm2lTkVZmFrQTZHQnRoWGs" rel="nofollow">a catalogue of data</a> and I want to use it in my <strong>MCMC</strong> code. What is crucial is the speed of implementation, in order to avoid slowing down my Markov chain monte carlo sampling. 
  <strong>The problem</strong>:
  In the catalogue, I have in the first and second column two parameters called <code>ra</code> and <code>dec</code> which are <em>sky coordinates</em>:</p>
  
  <pre><code>data=np.loadtxt('Final.Cluster.Shear.NegligibleShotNoise.Redshift.cat')
  ra=data[:,0]
  dec=data[:,1]
  </code></pre>
  
  <p>then in the seven and eight columns <code>X</code> and <code>Y</code> positions, i.e. the grid coordinates, they are points in a grid space</p>
  
  <pre><code>Xpos=data[:,6]
  Ypos=data[:,7]
  </code></pre>
  
  <p>In the function that I have written and it is needed to be called like a million time,
  I will give one <code>Xcenter</code> and <code>Ycenter</code> positions (for example Xcenter=200.6, Ycenter=310.9) as inputs to the function and I want to find the correspondence points in the <code>ra</code> and <code>dec</code> columns. However it might happen that the inputs do not have any real correspondence in the <code>ra</code> and <code>dec</code>. So I want to do an interpolation in case there is no similar entries for <code>X</code> and <code>Y</code> and <code>ra</code> and <code>dec</code> data in the catalogue and obtain the interpolated coordinates based on real <code>ra</code> and <code>dec</code> entries in the catalogue.</p>