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

Home » Public Forums » archive » Re: Structure of Structure
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: Structure of Structure [message #11312] Wed, 25 March 1998 00:00
alpha is currently offline  alpha
Messages: 49
Registered: September 1996
Member
"Thomas A. McGlynn" <tam@silk.gsfc.nasa.gov> writes:

> Stephan Oerder wrote:
> with additional optional arguments to create an array of
> structures or to define the structure type. If you request a
> structure of more than 128 elements, then the routine automatically
> creates substructures, putting the first 64 elements in the
> top level structure, the next 64 in a structure as the 65th element
> and so forth. I believe this has run successfully on VAXes
> for versions of IDL > 3.6.

this is similar to my IDL 5.0 bug i found in idl 4.01 at 23.Dec. 96
which is known to RSI as an internal kernel-Bug of IDL!

i worte a programm that hung the maschine:


pro fail

for te=1,105 do begin
anzahl=te
tname=strarr(anzahl)
for i=0,anzahl-1 do tname(i)='TN_'+strcompress(string(i),/remove_all)

ttyp=strarr(anzahl)
; zum ausuchen / try one of it
ttyp(*)="'String-test'"
ttyp(*)="fltarr(10)"
ttyp(*)="dcomplexarr(102)"

ziel=byte(0)
estring='ziel={'
for i=0,anzahl-1 do begin
if i gt 0 then estring=estring+','
estring=estring+tname(i)+':'+ttyp(i)
endfor
estring=estring+'}'

if execute(estring) then begin
print,' Execute OK: ',te
endif else begin
goto,abbruch
endelse
endfor

abbruch:
print, ' Execute failed at ',te
end

Even worse is the switshing of the data-type every time!


Panther


> It's available in the IDL Astronomy library at:

> http://idlastro.gsfc.nasa.gov/ftp/pro/structure/mrd_struct.p ro

> Good luck,

> Tom McGlynn
> tam@silk.gsfc.nasa.gov
--
Panther in the Jungle __..--''``\--....___ _..,_
-BELIEVE AND DECEIVE- _.-' .-/"; ` ``<._ ``-+'~=.
http://www.ang-physik _.-' _..--.'_ \ `(^) )
.uni-kiel.de/~hendrik ((..-' (< _ ;_..__ ; `'
Re: Structure of Structure [message #11330 is a reply to message #11312] Tue, 24 March 1998 00:00 Go to previous message
Thomas A. McGlynn is currently offline  Thomas A. McGlynn
Messages: 23
Registered: March 1996
Junior Member
Stephan Oerder wrote:
>
> Thanks a lot !!!
> I tried it already on a PC-IDL-System !!!!
> But we need it on a VAX-VMS-System !!!
> Do you (or somebody else) have the PRO-File of "Create_Struct(...)" ???
> Stephan
>
> Theo Brauers wrote:
>> You may try:
>>
>> m1 = create_struct('a', 0, 'b', bytarr(12))
>> m2 = create_struct(name='m2_str', 'a', 0, 'c', fltarr(12))
>> ; array of structures
>> m3 = replicate(m2, 3)
>>
>> m = create_struct('a1', m1)
>> m = create_struct(m, 'a2' , m2)
>> m = create_struct(m, 'a3' , m3)
>>
>> Best, Theo
>> ----------------------------------------------
>> Dr. Theo Brauers
>> Institut fuer Atmosphaerische Chemie (ICG-3)
>> Forschungszentrum Juelich
>> 52425 JUELICH, Germany
>> Tel. +49-2461-61-6646 Fax. +49-2461-61-5346


You might also want to look at a function I wrote a few years
ago called MRD_STRUCT. It takes two string array arguments. The
first gives the names of the structure columns and the second gives
a prototype for what the column should look like.

E.g., A call would might look like:

names = ["name_for_col1", "name_for_col2",...]
vals = ["dblarr(10,10)", "0L", "intarr(3,2,4), ...]

str = mrd_struct(names, vals)

with additional optional arguments to create an array of
structures or to define the structure type. If you request a
structure of more than 128 elements, then the routine automatically
creates substructures, putting the first 64 elements in the
top level structure, the next 64 in a structure as the 65th element
and so forth. I believe this has run successfully on VAXes
for versions of IDL > 3.6.

It's available in the IDL Astronomy library at:

http://idlastro.gsfc.nasa.gov/ftp/pro/structure/mrd_struct.p ro

Good luck,

Tom McGlynn
tam@silk.gsfc.nasa.gov
Re: Structure of Structure [message #11337 is a reply to message #11330] Mon, 23 March 1998 00:00 Go to previous message
David Foster is currently offline  David Foster
Messages: 341
Registered: January 1996
Senior Member
Stephan Oerder wrote:
>
> <snip of Bill's solution>
>
>> Bill Thompson
>
> Thanks 1000 * times !!!
>
> This was not the main problem !!!
> My problem is that under IDL 3.xx and IDL 4.xx
> IDL have a problem with Structure of Structure definitions.
> I tested your routine under IDL 3.xx and IDL 4.xx (PC, Vax-VMS) and it
> was not working .
> But under IDL 5.0 (Alpha) it works...
> -> let's update...
> Stephan

The problem may not be with the definition of a stucture within a
structure, but may simply be that IDL prior to version 5.0 had a
maximum number of structure tags allowed (don't know the number
off the top of my head). Nesting the structures may not help as
this was an internal limitation.

Dave
--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2240
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
Re: Structure of Structure [message #11343 is a reply to message #11337] Mon, 23 March 1998 00:00 Go to previous message
Stephan Oerder is currently offline  Stephan Oerder
Messages: 4
Registered: March 1998
Junior Member
William Thompson wrote:
>
> Stephan Oerder <Oerder@nv.et-inf.uni-siegen.de> writes:
>
>> I have a problem :
>> IDL/WAVE informs me that my big structure have too many tags !!!
>> So I decided to to devide the big structure into two smaller ones...
>> I try to create a structure of a structure :
>
>> fr_1 = { STRUCT_1_NAME, $
>> Test_1:bytarr(12), $
>> Test_2:bytarr(12), $
>> Test_3:bytarr(12) $
>> }
>
>> fr_2 = { STRUCT_2_NAME, $
>> Test_a:bytarr(12), $
>> Test_b:bytarr(12), $
>> Test_c:bytarr(12) $
>> }
>
>> fr = { STRUCT_NAME, $
>> struct_var_2 : {STRUCT_1_NAME}, $
>> struct_var_2 : {STRUCT_2_NAME}, $
>> }
>
>> This is not working !!!!
>> How can I create a structure of a structure ???
>> Stephan
>
> Your problem is extremely simple. You have a couple of simple typos in the
> final command. (It happens to the best of us.) If you instead enter in
>
> fr = { STRUCT_NAME, $
> struct_var_1 : {STRUCT_1_NAME}, $
> struct_var_2 : {STRUCT_2_NAME} $
> }
>
> it should work fine.
>
> Bill Thompson

Thanks 1000 * times !!!

This was not the main problem !!!
My problem is that under IDL 3.xx and IDL 4.xx
IDL have a problem with Structure of Structure definitions.
I tested your routine under IDL 3.xx and IDL 4.xx (PC, Vax-VMS) and it
was not working .
But under IDL 5.0 (Alpha) it works...
-> let's update...
Stephan
Re: Structure of Structure [message #11365 is a reply to message #11337] Fri, 20 March 1998 00:00 Go to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
Stephan Oerder <Oerder@nv.et-inf.uni-siegen.de> writes:

> I have a problem :
> IDL/WAVE informs me that my big structure have too many tags !!!
> So I decided to to devide the big structure into two smaller ones...
> I try to create a structure of a structure :

> fr_1 = { STRUCT_1_NAME, $
> Test_1:bytarr(12), $
> Test_2:bytarr(12), $
> Test_3:bytarr(12) $
> }

> fr_2 = { STRUCT_2_NAME, $
> Test_a:bytarr(12), $
> Test_b:bytarr(12), $
> Test_c:bytarr(12) $
> }

> fr = { STRUCT_NAME, $
> struct_var_2 : {STRUCT_1_NAME}, $
> struct_var_2 : {STRUCT_2_NAME}, $
> }

> This is not working !!!!
> How can I create a structure of a structure ???
> Stephan

Your problem is extremely simple. You have a couple of simple typos in the
final command. (It happens to the best of us.) If you instead enter in

fr = { STRUCT_NAME, $
struct_var_1 : {STRUCT_1_NAME}, $
struct_var_2 : {STRUCT_2_NAME} $
}

it should work fine.

Bill Thompson
Re: Structure of Structure [message #11370 is a reply to message #11365] Fri, 20 March 1998 00:00 Go to previous message
Theo Brauers is currently offline  Theo Brauers
Messages: 58
Registered: November 1997
Member
create_structure is a build-in function of IDL. It should work
on all systems. As far as I remember there was a problem with
structures of of structures in IDL3.xx or IDL 4.xx but who
cares? I am using IDL 5.0.3 on WinNT.
Theo

Stephan Oerder wrote:
>
> Thanks a lot !!!
> I tried it already on a PC-IDL-System !!!!
> But we need it on a VAX-VMS-System !!!
> Do you (or somebody else) have the PRO-File of "Create_Struct(...)" ???
> Stephan
>
> Theo Brauers wrote:
>> You may try:
>>
>> m1 = create_struct('a', 0, 'b', bytarr(12))
>> m2 = create_struct(name='m2_str', 'a', 0, 'c', fltarr(12))
>> ; array of structures
>> m3 = replicate(m2, 3)
>>
>> m = create_struct('a1', m1)
>> m = create_struct(m, 'a2' , m2)
>> m = create_struct(m, 'a3' , m3)
>>
>> Best, Theo
>> ----------------------------------------------
>> Dr. Theo Brauers
>> Institut fuer Atmosphaerische Chemie (ICG-3)
>> Forschungszentrum Juelich
>> 52425 JUELICH, Germany
>> Tel. +49-2461-61-6646 Fax. +49-2461-61-5346

--
----------------------------------------------
Dr. Theo Brauers
Institut fuer Atmosphaerische Chemie (ICG-3)
Forschungszentrum Juelich
52425 JUELICH, Germany
Tel. +49-2461-61-6646 Fax. +49-2461-61-5346
Re: Re: Structure of Structure [message #11372 is a reply to message #11365] Fri, 20 March 1998 00:00 Go to previous message
Stephan Oerder is currently offline  Stephan Oerder
Messages: 4
Registered: March 1998
Junior Member
Thanks a lot !!!
I tried it already on a PC-IDL-System !!!!
But we need it on a VAX-VMS-System !!!
Do you (or somebody else) have the PRO-File of "Create_Struct(...)" ???
Stephan

Theo Brauers wrote:
> You may try:
>
> m1 = create_struct('a', 0, 'b', bytarr(12))
> m2 = create_struct(name='m2_str', 'a', 0, 'c', fltarr(12))
> ; array of structures
> m3 = replicate(m2, 3)
>
> m = create_struct('a1', m1)
> m = create_struct(m, 'a2' , m2)
> m = create_struct(m, 'a3' , m3)
>
> Best, Theo
> ----------------------------------------------
> Dr. Theo Brauers
> Institut fuer Atmosphaerische Chemie (ICG-3)
> Forschungszentrum Juelich
> 52425 JUELICH, Germany
> Tel. +49-2461-61-6646 Fax. +49-2461-61-5346
Re: Structure of Structure [message #11373 is a reply to message #11365] Fri, 20 March 1998 00:00 Go to previous message
Theo Brauers is currently offline  Theo Brauers
Messages: 58
Registered: November 1997
Member
You may try:

m1 = create_struct('a', 0, 'b', bytarr(12))
m2 = create_struct(name='m2_str', 'a', 0, 'c', fltarr(12))
; array of structures
m3 = replicate(m2, 3)

m = create_struct('a1', m1)
m = create_struct(m, 'a2' , m2)
m = create_struct(m, 'a3' , m3)

Best, Theo

Stephan Oerder wrote:
>
> I have a problem :
> IDL/WAVE informs me that my big structure have too many tags !!!
> So I decided to to devide the big structure into two smaller ones...
> I try to create a structure of a structure :
>
> fr_1 = { STRUCT_1_NAME, $
> Test_1:bytarr(12), $
> Test_2:bytarr(12), $
> Test_3:bytarr(12) $
> }
>
> fr_2 = { STRUCT_2_NAME, $
> Test_a:bytarr(12), $
> Test_b:bytarr(12), $
> Test_c:bytarr(12) $
> }
>
> fr = { STRUCT_NAME, $
> struct_var_2 : {STRUCT_1_NAME}, $
> struct_var_2 : {STRUCT_2_NAME}, $
> }
>
> This is not working !!!!
> How can I create a structure of a structure ???
> Stephan

--
----------------------------------------------
Dr. Theo Brauers
Institut fuer Atmosphaerische Chemie (ICG-3)
Forschungszentrum Juelich
52425 JUELICH, Germany
Tel. +49-2461-61-6646 Fax. +49-2461-61-5346
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: passing pointers to CALL_EXTERNAL
Next Topic: Compatibility of MAP functions between IDL & wave

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

Current Time: Wed Oct 08 18:13:29 PDT 2025

Total time taken to generate the page: 0.00953 seconds