[AIT logo]

Institut für Astronomie und Astrophysik

Abteilung Astronomie

Sand 1, D-72076 Tübingen, Germany
[Uni logo]


MRD_STRUCT Source code in mrd_struct.pro

MRD_STRUCT

Name
       MRD_STRUCT
Purpose
       Return a structure as defined in the names and values data.
Calling Sequence
       struct = MRD_STRUCT(NAMES, VALUES, NROW, STRUCTYP='name' )
Input Parameters
       NAMES   = A string array of names of structure fields.
       VALUES  = A string array giving the values of the structure
                 fields.  See examples below.
       NROW    = The number of elements in the structure array.
Returns
       A structure as described in the parameters or 0 if an error
       is detected.
Keyword Parameters
       /NO_EXECUTE - If set then the use of the EXECUTE() statement is avoided.
                  By default, the NO_EXECUTE pathway is used if IDL is
                  running under the Virtual Machine.    Note if  /NO_EXECUTE
                  is set, then the user cannot supply arbitary values, but
                  all possible values used by MRDFITS will be allowed.
       STRUCTYP = The structure type.  Since IDL does not allow the
                  redefinition of a named structure it is an error
                  to call MRD_STRUCT with different parameters but
                  the same STRUCTYP in the same session.  If this
                  keyword is not set an anonymous structure is created.
Common Blocks
       MRD_COMMON
Side Effects
       May create a temporary file if the structure definition is too long
       for the EXECUTE function and using old style structures
Restrictions
       By default, the program defines the structure in a long string
       which is executed with CREATE_STRUCT within a single EXECUTE statement.
       If program is being run in the IDL Virtual machine (EXECUTE statement
       not allowed), then a separate CREATE_STRUCT statement is called
       for each tag.   This mode does not have the full capabilities of the
       normal mode, but should be sufficient for use with MRDFITS().
Procedure
       A structure definition is created using the parameter values.
       MRD_NSTRUCT is called  and generates the structure in pieces using the
       execute and create_struct keywords.
Example
       (1) str = mrd_struct(['fld1', 'fld2'], ['0','dblarr(10,10)'],3)
           print, str(0).fld2(3,3)
       (2) str = mrd_struct(['a','b','c','d'],['1', '1.', '1.d0', "'1'"],1)
               ; returns a structure with integer, float, double and string
               ; fields.
Procedures Used
       GETTOK() - needed for virtual machine mode only
Minimum IDL Version
       V5.3 (uses STRSPLIT)
Revision History
       Created by T. McGlynn October, 1994.
       Modified by T. McGlynn September, 1995.
          Added capability to create substructures so that structure
          may contain up to 4096 distinct elements.  [This can be
          increased by futher iteration of the process used if needed.]
       Converted to IDL V5.0   W. Landsman   September 1997
       Removed V4.0 reference to common block  October 1997
       Allowed unlimited number of structure elements if the version
       is greater than 5.0.  Put back in code to handle prior versions.
       The [] will need to be translated back to () for this to
       work.  T. McGlynn December 15 1998.
       Add MRD_NSTRUCT since IDL has mysterious problems compiling
       very large structures.
       Removed TEMPDIR and OLD_STRUCT keywords  W. Landsman October 2003
       Alternate pathway without EXECUTE for V6.0 virtual machine, D. Lindler
       Removed limit on EXECUTE statement.  W. Landsman  October 2003
       Restore EXECUTE limit (sigh...), added NO_EXECUTE keyword
                         W. Landsman July 2004
       Fix use of STRUCTYP with /NO_EXECUTE  W. Landsman June 2005

Last modified by pro2html on 2005 June 24 at 03:12 UTC

[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]

Jörn Wilms (wilms@astro.uni-tuebingen.de)
Updated automatically