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

Home » Public Forums » archive » Re: Limiting concatenation IDL 5.5
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Limiting concatenation IDL 5.5 [message #31228] Thu, 27 June 2002 22:11
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
"William Thompson" <thompson@orpheus.nascom.nasa.gov> wrote in message
news:afg4kr$hlu$1@skates.gsfc.nasa.gov...
> Randall Skelton <rhskelto@atm.ox.ac.uk> writes:
>
>> 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...
>
> How about
>
> c = make_array(2,2,2,7)
> c(0,0,0,0) = a
> c(0,0,0,2) = b
>
> Of course, you'd want to put this into a routine, with calls to
SIZE(), etc.

[Uh, David, make sure Bill gets a seat on the board of that IDL Experts'
group.]

Nice point, Bill! Your idea takes a bit of hackery, I'll take a swipe at
some of it:

concatSize = Size(a)
concatSize[dim+1] = concatSize[dim+1] + (Size(b))[dim+1]
c=Make_Array(Size=concatSize)
nDims=Size(a,/N_Dimensions)
aDims=Size(a,/Dimensions)

; This needs to be generalized for all
; possible values of nDims from 1 to 8, (4 assumed)
; either by a CASE statement or tricky
; string handling and Execute():

c[0, 0, 0, 0] = a
c[dim eq 0 ? aDims[0] : 0, $
dim eq 1 ? aDims[1] : 0, $
dim eq 2 ? aDims[2] : 0, $
dim eq 3 ? aDims[3] : 0]=b

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
Re: Limiting concatenation IDL 5.5 [message #31234 is a reply to message #31228] Thu, 27 June 2002 15:46 Go to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
Randall Skelton <rhskelto@atm.ox.ac.uk> writes:

> 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...

How about

c = make_array(2,2,2,7)
c(0,0,0,0) = a
c(0,0,0,2) = b

Of course, you'd want to put this into a routine, with calls to SIZE(), etc.

Bill Thompson
Re: Limiting concatenation IDL 5.5 [message #31269 is a reply to message #31234] Tue, 25 June 2002 10:06 Go to previous message
Randall Skelton is currently offline  Randall Skelton
Messages: 169
Registered: October 2000
Senior Member
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...


On Tue, 25 Jun 2002, Randall Skelton wrote:

> Date: Tue, 25 Jun 2002 16:49:26 +0100
> From: Randall Skelton <rhskelto@atm.ox.ac.uk>
> Newsgroups: comp.lang.idl-pvwave
> Subject: Limiting concatenation IDL 5.5
>
> Hi all,
>
> Having just re-read the dimensional juggling tutorials posted by JD, I
> noticed that in IDL 5.5 (Linux) the limit to the practical concatenation
> dimension was increased from 3 up to 8 ;) Being one of those people who
> occasionally use more than 3 dimensions, this makes my life a whole lot
> easier.
>
> Of course, don't try and go for 9...
>
> IDL> a = findgen(20)
> IDL> print, [[[[[[[[[a]]]]]]]]]
> Segmentation fault
>
> Does anyone else observe the same?
>
> Cheers,
> Randall
>
>
Re: Limiting concatenation IDL 5.5 [message #31270 is a reply to message #31269] Tue, 25 June 2002 09:31 Go to previous message
Randall Skelton is currently offline  Randall Skelton
Messages: 169
Registered: October 2000
Senior Member
Sorry... it seems I was wrong about the number of levels of concatenation
being increased. The seg. fault still exists.

On Tue, 25 Jun 2002, Randall Skelton wrote:

> Hi all,
>
> Having just re-read the dimensional juggling tutorials posted by JD, I
> noticed that in IDL 5.5 (Linux) the limit to the practical concatenation
> dimension was increased from 3 up to 8 ;) Being one of those people who
> occasionally use more than 3 dimensions, this makes my life a whole lot
> easier.
>
> Of course, don't try and go for 9...
>
> IDL> a = findgen(20)
> IDL> print, [[[[[[[[[a]]]]]]]]]
> Segmentation fault
>
> Does anyone else observe the same?
>
> Cheers,
> Randall
>
>
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Deleting from arrays
Next Topic: Matching Structure Tag Lengths

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

Current Time: Wed Oct 08 15:48:49 PDT 2025

Total time taken to generate the page: 0.00590 seconds