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

Home » Public Forums » archive » 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
Array slices [message #47250] Thu, 02 February 2006 08:44 Go to previous message
Richard Edgar is currently offline  Richard Edgar
Messages: 8
Registered: February 2006
Junior Member
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
Read Message
Previous Topic: Red Hot" new AUDIO ebook for FREE
Next Topic: Suppressing diagnostic messages en masse

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

Current Time: Sat Oct 11 03:06:12 PDT 2025

Total time taken to generate the page: 2.48190 seconds