Make_array() and using arrays as subscripts [message #46859] |
Mon, 09 January 2006 12:19 |
Liberum
Messages: 48 Registered: September 2005
|
Member |
|
|
Hi everyone,
I have a problem with the function MAKE_ARRAY() that I hope someone can
help me with.
I created a string array with the dimension (3, 344) and performed some
basic assignment operations.
Now I know that when I am finished with the operations I will perform
on the array, the length 344 will be too long. Let's say that only the
first 120 elements will be needed. Now I assigned that entire array the
string '9999' and then when I am ready to reduce the size of the array
I used the WHERE() function to find the indices where each element is
not equal to '9999'. All went well until I form this array-as-subscript
operation:
my_array = my_array[good_indices]
The dimensions all disappear and all I get is an array with the
elements equalling the number of elements of good_indices, i.e.,
print, size(my_array,/dimensions)
IDL> 120
Now I have used this type of array-as-subscript before on other types
of array and I have never had this problem before. Does anyone know why
this happens or how can I cut my_array without losing my 3 dimensions?
Sincerely,
Sheldon
|
|
|