comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Array Tiling - The IDL Way
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Array Tiling - The IDL Way [message #79572] Mon, 12 March 2012 12:32 Go to previous message
rogass is currently offline  rogass
Messages: 200
Registered: April 2008
Senior Member
On 12 Mrz., 19:54, Michael Galloy <mgal...@gmail.com> wrote:
> On 3/12/12 11:31 AM, Percy Pugwash wrote:
>
>> I have a large array that I'd like to break up into tiles (square tiles of side T). I would like to have those tiles in the form of a stack, such that my array goes from dimensions [Nx*T,Ny*T] to [T,T,Nx*Ny].
>
>> Is there any way I can do this using only functions like REFORM and TRANSPOSE and no for-loops? Ideally I'd like to do it in-place too. I've been racking my brain for a nice IDLesque way to do this, but no luck thus far...
>
>> P
>
> I think this is what you are trying to do:
>
>    IDL> a = indgen(10, 10)
>    IDL> b = transpose(reform(a, 2, 5, 2, 5), [1, 3, 0, 2])
>
> This will break the image a into 5 tiles of size 2 in each dimension. So
> you can do the following, e.g., to retrieve the tile at (4, 4):
>
>    IDL> print, reform(b[4, 4, *, *])
>        88      89
>        98      99
>
> Mike
> --
> Michael Galloywww.michaelgalloy.com
> Modern IDL, A Guide to Learning IDL:http://modernidl.idldev.com
> Research Mathematician
> Tech-X Corporation

Uh, it's a 'little' bit more efficient than my one .... :)

Cheers

CR
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: how to extend a vector from size A to size B, (A<B) without "damage" the data in A
Next Topic: please send your resume

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:23:17 PDT 2025

Total time taken to generate the page: 0.00464 seconds