[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Array index bug....



I am trying to extend the ROTATE procedure to handle arrays of up to 8 
dimensions.  (If anyone has accomplished this please let me know!)

But I have run into the same problem Stein Vidar Hagfors Haugan
described on 1999/02/21:

> Now, IDL *claims* to handle up to 8 dimensions, so one
> would think the best thing is to prepare your code for
> it, e.g.:
>  
>   tvscl,data(0,*,*,*,*,*,*,*)
>  
> The image is *not* what you expect! Clearly something
> breaks down with the eighth dimension.....

Either I don't fully understand how to extract subarrays or there
really is a bug (probably both).  The IDL manual states that 'IDL
allows you to specify "extra" dimensions for an array as long as the
extra dimensions are all zero.'  But this is not what I find.

Case in point:

a=indgen(4,3,2) & print,a
       0       1       2       3 
       4       5       6       7 
       8       9      10      11 
 
      12      13      14      15 
      16      17      18      19 
      20      21      22      23 
 
print,a[0,*,*]	; OK so far
       0 
       4 
       8 
 
      12 
      16 
      20 
 
; Any number of subscripts gives the same answer
; *UNTIL* we use 8 subscripts:
 
print,a[0,*,*,*,*,*,*,*] 
       0 
       0 
       0 
 
      12 
      12 
      12 

Why is this?


--
-- Gwyn F. Fireman
-- General Sciences Corporation / MODIS Characterization Support Team
-- Gwyn.Fireman@gsfc.nasa.gov   301-352-2118