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
Addressing 3D arrays different from 2D arrays? [message #56583] Tue, 06 November 2007 09:13 Go to previous message
Jaron Kurk is currently offline  Jaron Kurk
Messages: 2
Registered: November 2007
Junior Member
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
test3d[0,xidx,yidx] = 1
print,test2d,total(test2d)
print,reform(test3d[0,*,*]),total(test3d)


If anybody could enlighten me, I would appreciate it!

Jaron Kurk.
[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: Fri Oct 10 06:04:38 PDT 2025

Total time taken to generate the page: 0.48160 seconds