Home »
Public Forums »
archive »
Re: Matching Structure Tag Lengths
Re: Matching Structure Tag Lengths [message #31448 is a reply to message #31400] |
Thu, 11 July 2002 13:33  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Nate Doyle wrote:
>
>> My suggestion.
>>
>> P has less tags and this tags are all given in S.
>>
>> result=struct2ptr_struct(P)
>> tn=tag_names(p)
>> pos=tag_position(S,tn)
>> n=n_elements(tn)
>> FOR I=0,n-1 do $
>> *result.(I)=interp1(P.(i),S.(pos[i]))
>> ; I don't know this routine interp1
>>
>> result=ptr_struct2struct(result,/free)
>
> Thanks for the reply. I'm not sure that I communicated my problem
> quite right so I think your solution is for a slightly different
> problem. I want the number of tags in the arrays to stay the same, it
> is the length of the tags that I want to change. Perhaps I just don't
> understand your code though. It's very possible.
>
> Nate Doyle
Dear Nate,
I try to explain what I did.
At the moment structure P has less tags as structure S. But
all tags of P are defined in S too.
The tags which are in both structures could be used for an
interpolation.
The function struct2ptr_struct duplicates structure P but all values
of the tags are defined as pointer values.
This means the result structure is defined by this command.
With tag_names a list of all tags given from structure P is stored.
Now it is necessary to know where are these tags defined in structure S
The positions of the tags in structure S is returned with tag_position.
At least a FOR loop runs through each tag of the structure result
with the depending structure P.(i) and the S.(pos[i]) tags.
You have used interp1 in your code. I don't know the syntax from this.
We have some other routines e.g. calc_linear_with_limits in our lib.
While you are not using pointers yourself the result Pointer
Structure is changed by ptr_struct2struct(result,/free) in
a normal structure without pointers.
regards
Reimar
--
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
============================================================ =======
|
|
|
Current Time: Sun Oct 12 04:30:53 PDT 2025
Total time taken to generate the page: 1.44047 seconds