| Re: Want to get Array(48) instead of Array(1,48) [message #29970 is a reply to message #29871] |
Mon, 25 March 2002 23:50  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Dominik Paul wrote:
>
> I know the problem and the only solution I found till yet is, that I change
> the order of the dimensions from [1,48] to [48,1] and then IDL will "loose"
> the last dimension, changing it into [48]. This can be done wich test_array=
> transpose(test_array, [1,0]).
>
> Dom
>
Dear Domink
this works but if RSI will sometime in the future change the dropping
of last dimension one (I hope soon) this goes wrong.
Mark shows the better usage of reform.
regards
Reimar
> "chi-kuei" <twcollie@hotmail.com> schrieb im Newsbeitrag
> news:a7om25$8jn$1@news01.cit.cornell.edu...
>> Hi,
>>
>> It occurs to me that when I do the following:
>>
>> IDL> test_array = fltarr(48)
>> test_array is Array[48]
>>
>> but when I assign the value from a 2-D array
>> IDL> test_array = data_array(0, 0:47)
>> test_array becomes Array[1,48]
>>
>> I notice they are different because when I use curvefit, the Array[1,48]
>> will give me error message, the Array[48] will not.
>>
>> I can make the Array[1,48] become Array[48] without changing the value by
>> doing this:
>> IDL> test_array = test_array(*)
>>
>> This means extra steps. Am I doing this in the longer way? Is there any
>> shortcut of doing this.
>>
>> Thanks,
>> Chi-Kuei
>>
>>
--
Reimar Bauer
Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml
============================================================ =======
|
|
|
|