[lsst-dm-stack-users] image.getArray() question

Dustin Lang dstn at cmu.edu
Mon Feb 10 10:45:34 PST 2014


It's for consistency with numpy's indexing conventions, [y,x]

On Mon, 10 Feb 2014, Chris Walter wrote:

> Hi All,
> 
> I was curious: why does image.getArray return an array in the order (Y,X)? The builtin AFW functions all seem to use X,Y (width, height).
> 
> from image::ImageBase<PixelT>::Array lsst.afw.image::ImageBase<PixelT>::getArray()
> 	
>  return ndarray::external(
>         reinterpret_cast<PixelT*>(row_begin(0)),
>         ndarray::makeVector(getHeight(), getWidth()),
>         ndarray::makeVector(rowStride, 1),
>         this->_manager
>     );
> 
> Is it something about memory or disk layout?  I got caught up trying to find a particular pixel and it wasn't working since I assumed getArray would use the same convention.  I assume there is a good reason but I was curious as to what it was.
> 
> -Chris
> 
> 
> _______________________________________________
> lsst-dm-stack-users mailing list
> lsst-dm-stack-users at lsstcorp.org
> http://listserv.lsstcorp.org/mailman/listinfo/lsst-dm-stack-users
> 



More information about the dm-users mailing list