Institut für Astronomie und AstrophysikAbteilung AstronomieSand 1, D-72076 Tübingen, Germany |
MRD_STRUCT
Return a structure as defined in the names and values data.
struct = MRD_STRUCT(NAMES, VALUES, NROW, STRUCTYP='name' )
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.
A structure as described in the parameters or 0 if an error is detected.
/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.
MRD_COMMON
May create a temporary file if the structure definition is too long for the EXECUTE function and using old style structures
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().
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.
(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.
GETTOK() - needed for virtual machine mode only
V5.3 (uses STRSPLIT)
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
[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]