How can I create a slice object for Numpy array?
<p>I've tried to find a neat solution to this, but I'm slicing several 2D arrays of the same shape in the same manner. I've tidied it up as much as I can by defining a list containing the 'x,y' center e.g. <code>cpix = [161, 134]</code>  What I'd like to do is instead of having to write out the slice three times like so:</p>

<pre><code>a1 = array1[cpix[1]-50:cpix[1]+50, cpix[0]-50:cpix[0]+50] 
a2 = array2[cpix[1]-50:cpix[1]+50, cpix[0]-50:cpix[0]+50] 
a3 = array3[cpix[1]-50:cpix[1]+50, cpix[0]-50:cpix[0]+50]
</code></pre>

<p>is just have something predefined (like maybe a mask?) so I can just do a </p>

<pre><code>a1 = array1[predefined_2dslice] 
a2 = array2[predefined_2dslice] 
a3 = array3[predefined_2dslice] 
</code></pre>

<p>Is this something that numpy supports? </p>