IDL removes dimensions of size 1 automatically [message #41191] |
Fri, 24 September 2004 11:02 |
Benjamin Hornberger
Messages: 258 Registered: March 2004
|
Senior Member |
|
|
Hi all,
I had a hard time finding a bug which came from IDL's behaviour to
remove dimensions of size 1 automatically sometimes.
IDL> a=[[1u,1u]]
IDL> help,a
A UINT = Array[2]
IDL> ;; IDL doesn't even let me specify this (2,1) element array
IDL> a=reform(a,2,1)
IDL> help,a
A UINT = Array[2, 1]
IDL> b=fix(a)
IDL> help,b
B INT = Array[2]
IDL> ;; IDL removed my second dimension even though I just wanted to
change the type
IDL> c=2*a
IDL> help,c
C INT = Array[2]
IDL> print,c
2 2
IDL> ;; again IDL kicked out my second dimension
I found this very annoying. Does anyone know more about it? Why is it
like that? In which situations will IDL do that?
Thanks for any comments,
Benjamin
|
|
|