[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem array subscripting

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?



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