Re: Concatenating arrays across chosen dimension [message #31240] |
Thu, 27 June 2002 00:30  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Dick Jackson wrote:
>
> Hi Reimar,
>
> Nice to see how similar our routines are!
>
> If large arrays are involved, it looks like mine might be a bit quicker, since I
> happened to do the concatenation as the vector of 'a' elements with the vector
> of 'b' elements. There is no shuffling of data elements to be done, all of 'b'
> is just put after all of 'a'. You used concatenation on the first dimension
> (dimension 0) with 'c=[at,bt]', which requires IDL to do more work in composing
> the result. Every row of the result takes elements from 'a' then 'b'.
>
> The most efficient way would be to do the concatenation on the last dimension,
> but the fact that we can't do this in general is the problem that got us here in
> the first place!
Dear Dick,
both solutions showed how quite good our practice is and how
easy it is to solve small or big problems in idl.
February last year I and Craig found out we have written
nearly the same code for a replace_string routine.
With sharing of routines we always learn from each other.
That's the benefit of this newsgroup!
best regards
Reimar
>
> "Reimar Bauer" <R.Bauer@fz-juelich.de> wrote...
>> Dick Jackson wrote:
>>>
>>> "Randall Skelton" <rhskelto@atm.ox.ac.uk> wrote...
>>>
>>>> Ok... I have to ask. Is there actually a nice, clean way to concatenate
>>>> multidimensional arrays in IDL?
>>>>
>>>> a = make_array(2,2,2,2)
>>>> b = make_array(2,2,2,5)
>>>>
>>>> data1 = [ [[[a]]] , [[[b]]] ]
>>>>
>>>> Obviously the above fails, but what is the solution? Surely some
>>>> combination of rebin/reform...
>>
>> Dear Dick,
>>
>> we have written a general routine to concatinate on each dimension you
>> want.
>>
>>
> http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/download
> /concatenate_arrays.tar.gz
>>
> http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/download
> /concatenate_arrays.sav
>
> Cheers,
> --
> -Dick
>
> Dick Jackson / dick@d-jackson.com
> D-Jackson Software Consulting / http://www.d-jackson.com
> Calgary, Alberta, Canada / +1-403-242-7398 / Fax: 241-7392
--
Reimar Bauer
Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml
============================================================ =======
|
|
|