Re: Problem array subscripting [message #16791 is a reply to message #16681] |
Tue, 17 August 1999 00:00   |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Henry Chapman (chapman9@llnl.gov) writes:
> This can be solved with a little trick I posted awhile back (some time
> after a long thread about indices). The trick is to index an extra
> dimension.
>
> Example:
>
> IDL> array = bindgen(16,16,5)
> IDL> index = indgen(5)
> IDL> x = [0,1,2]
> IDL> y = [8,9,10,11]
>
> IDL> result = array[x, y, index, 0]
The trouble with this trick is that I don't understand
how it works. It's fine for production code, don't get
me wrong, where a little smoke and mirrors can even be
elegant. I just don't want to get up in front of an IDL
programming class and have to explain it. Do you have
any theories?
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|