[SciPy-user] step in arrays
03 Feb 2003 12:07:43 +0000
c = b[0:2168:8,0:5004:8] #this should subsample b every 8th point
On Mon, 2003-02-03 at 12:02, Agustin Lobo wrote:
> I would need a little help on this:
> I want to read a set of images
> (raw bin data, unsigned int*8) and
> display them using xply.imagesc just
> to mae sure there have been no errors at downloding
> For each file, I'm doing the following:
> f =open("NDVI_GIMMS_8KM.8107","r")
> b = array(a,typecode=UnsignedInt8)
> b.shape = (2168,5004)
> The problem is that, as the array "b" is very large,
> the display takes too long. Therefore, I'm trying
> to subsample b. I've tried with take(), but no luck.
> The question is, how could I select every i.e. 10th row
> and col from matrix b?
> Also, any other comment on improving what I want to do
> is welcome! (perhaps I can subsample at reading).
> Dr. Agustin Lobo
> Instituto de Ciencias de la Tierra (CSIC)
> Lluis Sole Sabaris s/n
> 08028 Barcelona SPAIN
> tel 34 93409 5410
> fax 34 93411 0012
> SciPy-user mailing list
Teraview Ltd., 302-304 Cambridge Science Park, Milton Road, Cambridge CB4 0WG, United Kingdom.
tel: +44 (1223) 435380 / 435386 (direct-dial) fax: +44 (1223) 435382