comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Singular arrays in structures...
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Singular arrays in structures... [message #39903] Mon, 28 June 2004 06:26
tam is currently offline  tam
Messages: 48
Registered: February 2000
Member
Reimar Bauer wrote:

> Tom McGlynn wrote:
>
>
>> I'm sure that this probably has come up before, but I just haven't
>> noticed it but every once in a while I run regression tests...
>>
>> In IDL 5.2 if one starts with
>>
>> x = {a:intarr(1),b:0}
>> y = replicate(a,10)
>>
>> Then
>>
>> y.a = intarr(10) works
>> y.a = intarr(1,10) fails
>>
>> In IDL 5.6 the results are reversed, the second method works
>> while the first fails.
>>
>> Does anyone have any workarounds that will handle
>> both cases or has this inconsistency perhaps been fixed
>> in later versions of IDL? I'd prefer not to have to
>> refer to the IDL version explicitly in the code.
>>
>> Thanks,
>> Tom McGlynn
>
>
> Dear Tom,
>
> A workaround like this should help
>
> sz=size(y.a,/dimensions)
> y.a=reform(intarr(10),sz)
>
> regards
>
> Reimar
>

Thanks Reimar,

I think that's exactly what I need. I can probably use
the /overwrite option in the reform to make it
a little faster since I can modify the array being
assigned to the structure.

Regards,
Tom
Re: Singular arrays in structures... [message #39905 is a reply to message #39903] Fri, 25 June 2004 08:49 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Tom McGlynn wrote:

> I'm sure that this probably has come up before, but I just haven't
> noticed it but every once in a while I run regression tests...
>
> In IDL 5.2 if one starts with
>
> x = {a:intarr(1),b:0}
> y = replicate(a,10)
>
> Then
>
> y.a = intarr(10) works
> y.a = intarr(1,10) fails
>
> In IDL 5.6 the results are reversed, the second method works
> while the first fails.
>
> Does anyone have any workarounds that will handle
> both cases or has this inconsistency perhaps been fixed
> in later versions of IDL? I'd prefer not to have to
> refer to the IDL version explicitly in the code.
>
> Thanks,
> Tom McGlynn

Dear Tom,

A workaround like this should help

sz=size(y.a,/dimensions)
y.a=reform(intarr(10),sz)

regards

Reimar

--
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg-i/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDLWAVE 5.3 -- idlwave.org
Next Topic: 3d projection of a stack images

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 08:05:24 PDT 2025

Total time taken to generate the page: 0.24056 seconds