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

Home » Public Forums » archive » Arrays: strange feature ?!
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: Arrays: strange feature ?! [message #19972 is a reply to message #19877] Wed, 03 May 2000 00:00 Go to previous messageGo to previous message
rshill is currently offline  rshill
Messages: 2
Registered: May 2000
Junior Member
In article <3910324B.CDDD96FB@pet.mpin-koeln.mpg.de>,
Alex Schuster <alex@pet.mpin-koeln.mpg.de> wrote:
> You can create the array like this:
>
> image = [ [image1], [image2], [image3] ]

Not quite. In fact, the notation is remarkably flexible.

IDL> i1 = bytarr(10,20)
IDL> i2 = i1
IDL> i3 = i1
IDL> t = [i1,i2,i3]
IDL> help,t
T BYTE = Array[30, 20]
IDL> t = [[i1],[i2],[i3]]
IDL> help,t
T BYTE = Array[10, 60]
IDL> t = [[[i1]],[[i2]],[[i3]]]
IDL> help,t
T BYTE = Array[10, 20, 3]
IDL> t2 = [t,t]
IDL> help,t2
T2 BYTE = Array[20, 20, 3]
IDL> t2 = [[t],[t]]
IDL> help,t2
T2 BYTE = Array[10, 40, 3]
IDL> t2 = [[[t]],[[t]]]
IDL> help,t2
T2 BYTE = Array[10, 20, 6]
IDL> t2 = [[[[t]]],[[[t]]]]

t2 = [[[[t]]],[[[t]]]]
^
% Only eight levels of variable concatenation are allowed.
IDL>

As you can see, there is a limit. For three or fewer
dimensions, the rule seems to be that if the number of
outermost brackets in a row is 1, the arrays are
concatenated in X; if 2, they are concatenated in Y; and
if 3, they are concatenated in Z. Consider this further
example:

IDL> x = indgen(10)
IDL> help, [[[x]],[[x]],[[x]]]
<Expression> INT = Array[10, 1, 3]

YMMV, but I like it, myself.

Bob Hill

--
Robert S. Hill
Raytheon ITSS Code 681, NASA/GSFC, Greenbelt, MD 20771



Sent via Deja.com http://www.deja.com/
Before you buy.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: 5.3: IDLgrVolume,CUTPLANES=
Next Topic: POLY_FIT gives wrong answer !

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

Current Time: Sun Oct 12 09:27:25 PDT 2025

Total time taken to generate the page: 0.32066 seconds