[Numpy-discussion] Numpy Advanced Indexing Question

Robert Kern robert.kern@gmail....
Wed Jul 16 16:55:58 CDT 2008


On Wed, Jul 16, 2008 at 16:45,  <Jack.Cook@shell.com> wrote:
> Greetings,
>
> I have an I,J,K 3D volume of amplitude values at regularly sampled time
> intervals. I have an I,J 2D slice which contains a time (K) value at each I,
> J location. What I would like to do is extract a subvolume at a constant +/-
> K window around the slice. Is there an easy way to do this using advanced
> indexing or some other method? Thanks in advanced for your help.

cube[:,:,K-half_width:K+half_width]

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
 -- Umberto Eco


More information about the Numpy-discussion mailing list