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

Home » Public Forums » archive » Re: Array indexing: what is IDL doing?
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: Array indexing: what is IDL doing? [message #60696] Tue, 10 June 2008 07:16 Go to previous message
Conor is currently offline  Conor
Messages: 138
Registered: February 2007
Senior Member
On Jun 9, 11:34 am, Heinz Stege <public.215....@arcor.de> wrote:
> On Fri, 6 Jun 2008 09:50:33 -0700 (PDT), Conor wrote:
>> So I want to pull out a small subsection from within a larger idl
>> array. I want to do something like this:
>
>> bigarr = findgen(500,100000)
>> bigx = [indgen(50)+100,indgen(25)+200]
>> bigy = indgen(10000)+50000
>
>> res = bigarr[bigx,bigy]
>
>> However IDL doesn't like that and says:
>
>> % All array subscripts must be same size. Var = BIGARR
>> % Execution halted at: $MAIN$
>
> You may want to try this command:
> res = bigarr[bigx,bigy,0]
>
> IDL accepts arrays of different size as subscripts, if at least one of
> the subsripts is a scalar. Here the "0" addresses an "extra"
> dimension. Since this extra dimension is of size 1, it is degenerated
> in the result. Array res has two dimensions, 75x10000.
>
> Heinz

Hmm... this does work! It seems very strange though. Seems like a
rather arbitrary rule...
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: how get value from combobox
Next Topic: Workbench problem following update

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

Current Time: Wed Oct 08 19:50:40 PDT 2025

Total time taken to generate the page: 0.00433 seconds