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

Home » Public Forums » archive » How come? Weird subarray problem...
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: How come? Weird subarray problem... [message #85209 is a reply to message #85208] Fri, 12 July 2013 13:13 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Stefan writes:

> I have been wondering why a specific part of my code does not work and I discovered this:
>
> a = findgen(10,10,10)
> help, a
> FLOAT = Array[10, 10, 10]
> help, a[*,*,0]
> FLOAT = Array[10, 10]
> help, a[*,0,*]
> FLOAT = Array[10, 1, 10]
> help, a[0,*,*]
> FLOAT = Array[1, 10, 10]
>
>
> IDL only recognises a subarray correctly if the given index is at the last position...is this normal or maybe is there a way around this?

A better way to state this is that IDL only *incorrectly* recognizes a
subarray when the given index is at the last position, when it
inexplicably drops the final dimension. (Well, inexplicably for a lot of
people. Some people--you maybe--like this way of doing things.) In any
case, a simple REFORM may set you right, for whatever it is you are
doing.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: localising IDL programs
Next Topic: Barplot

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

Current Time: Wed Oct 08 19:29:42 PDT 2025

Total time taken to generate the page: 0.00234 seconds