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

Home » Public Forums » archive » Re: indexing over structure tags
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: indexing over structure tags [message #24871 is a reply to message #24812] Tue, 24 April 2001 00:45 Go to previous messageGo to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Randall Skelton wrote:
>
> Thanks Tom... I did think of that. However, in this particular case there
> is some merit in having the name of the structure be a useful and human
> readable tag. Nobody would be happy trying to remember yet another
> arbitrary numbering scheme for molecules when they'd rather just type the
> name ;) My suspicion is that there isn't an easy way to do what I want...
>
> Randall
>


Dear Randall,

I will show you an easy way, how to access any level of a structure
by incrementing of a an array.


may be we have a structure like

pi={name:'p.mustermann'}
global={pi:pi}
n2o={param:fltarr(10),short_name:'N2O',long_name:'mixing
ratio',units:'ppb',flag:'NONE'}
time={param:fltarr(10),short_name:'time',long_name:'time
[UT]',units:'seconds since 2000-01-01 00:00:00 UTC', flag:'NONE'}

icgs={!global:global,time:time,n2o:n2o}

more attribute of this data structure are explained by my publication.
http://www.fz-juelich.de/zb/text/publikation/juel3786.html

The following routine creates an array of tagnames and an
array of pointers of any submitted structure
The return value of this function is n_elements(names)
and the keywords names and ptr_values


n=struct2names_and_ptrs(icgs,names=names,ptr_values=ptr_valu es)
PRINT,n
IDL> 11

IDL> PRINT,names
!GLOBAL.PI.NAME TIME.PARAM TIME.SHORT_NAME TIME.LONG_NAME TIME.UNITS
TIME.FLAG
N2O.PARAM N2O.SHORT_NAME N2O.LONG_NAME N2O.UNITS N2O.FLAG

IDL> FOR I=0,n-1 do help,*(ptr_values[i])
<PtrHeapVar1> STRING = 'p.mustermann'
<PtrHeapVar2> FLOAT = Array[10]
<PtrHeapVar3> STRING = 'time'
<PtrHeapVar4> STRING = 'time [UT]'
<PtrHeapVar5> STRING = 'seconds since 2000-01-01 00:00:00 UTC'
<PtrHeapVar6> STRING = 'NONE'
<PtrHeapVar7> FLOAT = Array[10]
<PtrHeapVar8> STRING = 'N2O'
<PtrHeapVar9> STRING = 'mixing ratio'
<PtrHeapVar10> STRING = 'ppb'
<PtrHeapVar11> STRING = 'NONE'



http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/struct2names_and_ptrs.tar.gz

This routine was written to use by add_tag, delete_tag, replace_tagvalue
and rename_tag
on each level of a structure with the following routine you are able to
build any structure defined from names and ptr_values.

http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/names_and_ptrs2struct.tar.gz

For further routines and licensing please look at
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml



Is this the solution of your problem?


Reimar



--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-1)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg1/
=============================================
a IDL library at ForschungsZentrum J�lich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml

http://www.fz-juelich.de/zb/text/publikation/juel3786.html
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: fastest operations/fctns.
Next Topic: MBAR

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

Current Time: Wed Oct 08 14:53:03 PDT 2025

Total time taken to generate the page: 0.00550 seconds