title: Multiplying a numpy array with another numpy array at a specific index
body: <p>For ease of explanation I will be using 2-dimensional numpy arrays (I am using 3-dimensional arrays in my problem).</p>
  
  <p>I have 2 arrays, one records the odds of something occuring at those specific coordinates. The other array is a pre-generated matrix that is used to lower the values of the first array around a central point in a pre-determined radius. </p>
  
  <p>I want to automatically select points in the first matrix (henceforth A), and prevent the program to select another point that sits too close to previously selected points. So I want to multiply the values around the selected point related to the distance from said point.</p>
  
  <p>E.G.:</p>
  
  <p>Matrix A:</p>
  
  <pre><code>[[0, 0, 0, 0, 0, 0],
   [0, 1, 2, 2, 1, 0],
   [0, 2, 4, 4, 2, 0],
   [0, 2, 4, 4, 2, 0],
   [0, 1, 2, 2, 1, 0],
   [0, 0, 0, 0, 0, 0]]
  </code></pre>
  
  <p>Matrix B:</p>
  
  <pre><code>[[ 1, 0.5, 1 ],
   [0.5, 0, 0.5],
   [ 1, 0.5, 1 ]]
  </code></pre>
  
  <p>Now say that index [2, 1] is selected as a point of interest. B is multiplied with A, but only with the values in a 3*3 around [2, 1]</p>
  
  <p>Result:</p>
  
  <pre><code>[[0,  0,  0, 0, 0, 0],
   [0, 0.5, 0, 1, 1, 0],
   [0,  2,  2, 4, 2, 0],
   [0,  2,  4, 4, 2, 0],
   [0,  1,  2, 2, 1, 0],
   [0,  0,  0, 0, 0, 0]]
  </code></pre>
  
  <p>This should result in the points around [2, 1] not being valuable enough to be selected as points of interest, unless the conditions are high enough to be selected anyway, hence the multiplication.</p>
  
  <p>Now, I can't seem to figure out a way to perform this specific multiplication. <code>numpy.multiply()</code> would repeat B so that it gets applied over the entire matrix A while I only want to apply it on a small part of A.</p>
  
  <p>Another option would be looping over the affected section of Matrix A, but this requires an insane amount of time (especially in 3-dimensional matrices)</p>
  
  <p>In other words, I want to apply a convolution filter without summing up the multiplication results at the end, but apply them to the underlying values of the convolved matrix (A)</p>
  
  <p>Any insights on this issue are appreciated.</p>