[lsst-dm-stack-users] Changes to make sub-images less clunky

Mario Juric mjuric at lsst.org
Tue Jan 29 15:01:00 PST 2013


On 1/29/13 15:48 , Paul Price wrote:
> You can also get a numpy array from an Image by:
> 
>     a = im.getArray()
> 
> and then you can do:
> 
>     a[:,12:15] = -1
> 
> *** Note that numpy indices are [y,x], while Robert's new direct
> Python slicing of an Image uses [x,y].  The way I remember this is
> that numpy is operating directly on the in-memory representation
> (which is accessed y,x, as usual in C), while Robert's slicing makes
> things a bit nicer, and so is x,y as is usual in math and English.

"I felt a great disturbance in the Force, as if millions of voices
suddenly cried out in terror..."

This is bound to lead to bugs. And hard to find ones, at that... Hmmm...
-- 
Mario Juric,
Data Mgmt. Project Scientist, Large Synoptic Survey Telescope
Web   :  http://www.cfa.harvard.edu/~mjuric/
Phone :  +1 617 744 9003       PGP: ~mjuric/crypto/public.key



More information about the dm-users mailing list