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

Home » Public Forums » archive » Addressing 3D arrays different from 2D arrays?
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: Addressing 3D arrays different from 2D arrays? [message #56682 is a reply to message #56583] Tue, 06 November 2007 09:27 Go to previous message
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
On Tue, 6 Nov 2007, Jaron Kurk wrote:

> Dear readers,
>
> Apologies if this question has long been answered, but I could not
> find anything on it.
>
> Is there some fundamental difference in addressing 3D arrays and 2D
> arrays? In IDL 6.3 (and GDL), the following code fills a 2D array with
> a circle of 1's but a slice of a 3D array with a square of 1's, while
> I would expect just the same area filled with 1's as for the 2D case.
> Note that the use of reform() does not cause the difference, I have
> checked that.
>
> xidx=[5,4,5,6,3,4,5,6,7,4,5,6,5]
> yidx=[3,4,4,4,5,5,5,5,5,6,6,6,7]
> test2d = bytarr(10,10)
> test3d = bytarr(10,10,10)
> test2d[xidx,yidx] = 1

array subscripts

> test3d[0,xidx,yidx] = 1

mixed scalar and array subscripts. Different rules :-)

try: test3d[lonarr(13),xidx,yidx] = 1


regards,
lajos
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL sorting
Next Topic: !path problem

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

Current Time: Sat Oct 11 09:41:34 PDT 2025

Total time taken to generate the page: 0.55998 seconds