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

Home » Public Forums » archive » Re: Structure reforming
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: Structure reforming [message #31053 is a reply to message #31050] Tue, 04 June 2002 07:51 Go to previous messageGo to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Ivan Valtchanov wrote:
>
> Hi all,
>
> I have an IDL structure variable like this:
>
> help, ccc
> CCC STRUCT = -> <Anonymous> Array[1]
>
> help, ccc, /struct
> NAME STRING Array[133]
> RA DOUBLE Array[133]
>
> and I would like to reform it like this
> help,ccc
> CCC STRUCT = -> <Anonymous> Array[133]
> help,ccc,/struct
> NAME STRING g01
> RA DOUBLE 316.022
>
> Is there any fast way to do it?
>
> Thanks a lot.
>
> Ivan

You can use my reform_struct.

http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/download/reform_struct.tar.gz


regards

Reimar


; NAME:
; reform_struct
;
; PURPOSE:
; This function is used to reform a structure as tag array or struct
array
;
; CATEGORY:
; PROG_TOOLS/STRUCTURES
;
; CALLING SEQUENCE:
;
result=reform_struct(structure,dim1,[dim2],[dim3],[dim4],[di m5],[dim6],[dim7],[dim8],[/struct_array],[/tag_array]
;
; INPUTS:
; structure: a structures
; dim1: the new dimension of the input structure (1D to 8D)
;
; OPTIONAL INPUTS:
; dim2 to dim8: additional dimensions if not declared in dim1
;
; KEYWORD PARAMETERS:
; struct_array: if is set output structure is an array
; tag_array: if is set output structure is 1D and tags are arrays
; You have to set one of these keywords
;
; EXAMPLE:
; data=create_struct('A',FINDGEN(15),'B',SIN(FINDGEN(15)))
; result=reform_struct(data,15,/struct_array)
; HELP,result
; RESULT STRUCT = -> <Anonymous> Array[15]


--
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
============================================================ =======
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: atan in IDL 5.5
Next Topic: how to modify the default 'printf' format

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

Current Time: Sat Oct 11 08:57:34 PDT 2025

Total time taken to generate the page: 0.80306 seconds