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

Home » Public Forums » archive » Re: Array slices
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 slices [message #47248 is a reply to message #47247] Thu, 02 February 2006 08:53 Go to previous messageGo to previous message
Anne[1] is currently offline  Anne[1]
Messages: 8
Registered: February 2006
Junior Member
To convert everything to a [3,3] array just use the REFORM function, ie
arr=reform(arr). This will get rid of and redundent dimensions.
Actually I find it more annoying when the [3,3,1] array gets converted
to a [3,3] array since that is usually harder to deal with!
Anne
Richard Edgar wrote:
> Greetings,
>
> I'm having trouble with slices of 3D arrays in IDL, and I suspect that
> it's something I don't understand about the way IDL interprets things.
> My problem can be summed up as follows:
>
> IDL> arr=DINDGEN(3,3,3)
> IDL> help,arr
> ARR DOUBLE = Array[3, 3, 3]
> IDL> help,arr[*,*,1]
> <Expression> DOUBLE = Array[3, 3]
> IDL> help,arr[*,1,*]
> <Expression> DOUBLE = Array[3, 1, 3]
> IDL> help,arr[1,*,*]
> <Expression> DOUBLE = Array[1, 3, 3]
>
> My questions are:
> a) Why don't all three slices return a [3,3] array?
> b) How do I eliminate the 'useless' dimension?
>
> I typically have routines which want a 2D array, which I only get from
> the first of these. They (naturally) choke when given a 3D array, one of
> whose dimensions is unity.
>
> Thanks in advance,
>
> Richard
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: display line numbers in idlde?
Next Topic: Re: Speeding up multiple file reading

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

Current Time: Fri Oct 10 06:17:07 PDT 2025

Total time taken to generate the page: 1.91552 seconds