2d array slicing problem

Robert Kern robert.kern at gmail.com
Fri Oct 7 20:42:18 CEST 2005


jeg wrote:
> dear all,
> 
> i'm an astronomer working with 2d images -- 2d numarrays. i have a
> script which basically does some operations on some images, and one of
> the first steps is to find a galaxy on an image (at, say, a known x,y
> coord), and create a sub-image by slicing out part of the larger array
> to create a more managable smaller one (e.g. 50x50 pixels from a
> 1000x1000 array).
> 
> i was running this fine under python 2.3.4, but due to the slowness of
> my machine, moved to a speedy 64-bit linux box running version 2.4.2.
> arrays were no longer being sliced in the correct way, for example:
> 
> B = A[3:7,6:10]
> 
> generates different Bs if i run an identical script on the same image
> on the different machines.
> 
> note: we deal with FITS format images, which are read into numarrays
> using the pyfits.py module. does anyone know any obvious reason this
> should be happening? 

Not without having the data and the machines in front of me. You'll get
better luck asking on numarray's mailing list.

-- 
Robert Kern
rkern at ucsd.edu

"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
  -- Richard Harter




More information about the Python-list mailing list