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

Home » Public Forums » archive » Re: Generally accessing the rest of the elements in an array
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: Generally accessing the rest of the elements in an array [message #23777 is a reply to message #23775] Wed, 21 February 2001 05:55 Go to previous messageGo to previous message
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
William Thompson wrote:
>
> "tbowers" <tbowers@nrlssc.navy.mil> writes:
>
>> How do I access the 2nd + dimensions of an array generally, without knowing
>> the
>> number of higher dims this array has. E.g. say a is a 3 column by
>> n-dimensional
>> aray, and n is unknown. Here, I'll define it as:
>
>> a = indgen(3,2,4)
>
>> I want the equivalent of (in this case):
>> b = (a[0,*,*])^2 + (a[1,*,*])^2 + (a[2,*,*])^2
>
> (rest deleted)
>
> You should be able to do something like the following:
>
> b = a[0,*,*,*,*,*,*,*]^2 + a[1,*,*,*,*,*,*,*]^2 + a[2,*,*,*,*,*,*,*]^2

Ugh.

I think Mr/Dr Bowers should think about a new data structure that can deal with the
flexibility he requires. An IDL structure perhaps?

When you start using arrays of more than three or four dimensions, and this is my very
personal viewpoint only, I would definitely spend a couple of hours thinking about how to
repackage either the data in the code or the code itself to change the "flow of data"
(insert hand-waving here) to avoid the type of expressions like the above.

paulv

--
Paul van Delst A little learning is a dangerous thing;
CIMSS @ NOAA/NCEP Drink deep, or taste not the Pierian spring;
Ph: (301)763-8000 x7274 There shallow draughts intoxicate the brain,
Fax:(301)763-8545 And drinking largely sobers us again.
pvandelst@ncep.noaa.gov Alexander Pope.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Win32 and Removeable Drives
Next Topic: Newsgroup archive online

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

Current Time: Fri Oct 10 08:57:59 PDT 2025

Total time taken to generate the page: 0.48098 seconds