Behaviour of REFORM() changed in IDL 5.5? [message #29253] |
Fri, 08 February 2002 07:46  |
Georg Wiora
Messages: 13 Registered: November 2001
|
Junior Member |
|
|
Hi everybody!
I just found out that the behaviour of the REFORM() function
seems to be changed in IDL 5.5. With IDL 5.4 I was able to
reform a one dimensional array to a two dimensional with a
trailing dimension of size one. With idl 5.5 these dimension
is removed automaticaly. But from the documentation the
automatic reduction of dimensions should only happen if no
dimensions are specified. This change is not documented in
the (windows) help file.
Here is my example:
array = INDGEN(100)
image = REFORM(100,1)
In IDl 5.4 the result was: image[100,1]
In IDl 5.5 the result is: image[100]
Is there anything known about a bug fix for that?
Thanks,
Georg
|
|
|
Re: Behaviour of REFORM() changed in IDL 5.5? [message #29287 is a reply to message #29253] |
Tue, 12 February 2002 00:32  |
Georg Wiora
Messages: 13 Registered: November 2001
|
Junior Member |
|
|
Am Mon, 11 Feb 2002 06:29:05 -0700, hat Robert Stockwell
<rgs1967@hotmail.com> geschrieben:
> when its in a functionm (IDL5.5 linux). Is there perhaps
> another operation you perform that implicitly
> causes "IMAGE" to get rid of the single dimension?
> For instance, in the example below, multiplying image by 2
> causes the extra dimension to be dropped.
Thanks Bob!
That was really a good hint. I did a REVERSE() on the index
with size one. That made it vanish. But still strange, that
it worked before...
|
|
|
Re: Behaviour of REFORM() changed in IDL 5.5? [message #29308 is a reply to message #29253] |
Mon, 11 February 2002 05:29  |
Robert Stockwell
Messages: 74 Registered: October 2001
|
Member |
|
|
Georg Wiora wrote:
> Am Fri, 08 Feb 2002 11:15:02 -0700, hat Robert Stockwell
> <rgs1967@hotmail.com> geschrieben:
>
>> Georg Wiora wrote:
>>
>>
>>> Here is my example:
>>> array = INDGEN(100)
>>> image = REFORM(100,1)
>>>
> Sorry for the Typo :-\
> It's obviously
> image = REFORM(array,100,1)
Yes, I noticed that you must have meant the above :)
>> Hi Georg,
>>
>> What os are you? A Windows one? Unfortunately my win2000
>>
> I have a WIN 2000 system.
>
> When I try it on the command line, it works fine, but not in
> my application. Probably it is just some instability problem.
WOW, that would indeed be a serious bug. Can you post the
offending code (shortened down as much as you can)?
I did a quick test, and reform seems to work fine for me
when its in a functionm (IDL5.5 linux). Is there perhaps
another operation you perform that implicitly
causes "IMAGE" to get rid of the single dimension?
For instance, in the example below, multiplying image by 2
causes the extra dimension to be dropped.
Cheers,
bob
function test_reform
array = INDGEN(100)
image = REFORM(array,100,1)
help,image
newimage = image*2
help,newimage
return,image
end
; main level code
r = test_reform()
help,r
end
Results:
IMAGE INT = Array[100, 1]
NEWIMAGE INT = Array[100]
R INT = Array[100, 1]
|
|
|