[AstroPy] slicing

Aldcroft, Thomas aldcroft at head.cfa.harvard.edu
Thu Feb 11 06:39:45 EST 2016


On Thu, Feb 11, 2016 at 5:42 AM, Stefano Covino <
stefano.covino at brera.inaf.it> wrote:

> Dear friends,
>
> let’s assume we have a data array read from a FITS file:
>
> data = getdata(‘file.fits’)
>
> I need to do some computations on a subset of it, for instance:
>
> datf = dat[bb-size:bb+size,aa-size:aa+size]
>
> where aa and bb are x,y positions and size a fixed number (e.g. 10).
>
>
>
> So, the question. Is it possible that aa and bb are not simple integers
> but lists or arrays of integers?
>

Hi Stefano,

You can get a good idea of what is possible with array indexing by starting
with the numpy documentation:

  http://docs.scipy.org/doc/numpy-1.10.1/user/basics.indexing.html

- Tom


>
>
> Thanks,
>         Stefano
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> https://mail.scipy.org/mailman/listinfo/astropy
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20160211/dcc8ec8d/attachment.html>


More information about the AstroPy mailing list