Mas runfile.pro and mas runparam.pro

From MCEWiki
Revision as of 12:04, 8 April 2008 by 24.84.194.46 (talk) (Example usage)

Overview

mas_runfile.pro and mas_runparam.pro provide an interface to MCE runfile data.

Example usage

The runfile data is loaded into a runfile structure with a call to mas_runfile. The runfile data can then be accessed by calling mas_runparam with the runfile structure and the name of the block and key desired:

IDL> rf = mas_runfile('1207167414_iv_dm9.run')
IDL> help,rf,/struc
** Structure <83f4fcc>, 4 tags, length=13128, data length=13128, refs=1:
   BLOCKS          STRING    Array[3]
   TAG_INDICES     LONG      Array[3]
   TAGS            STRING    Array[1, 545]
   KEYS            STRING    Array[1, 545]
IDL> print,mas_runparam(rf, 'FRAMEACQ', 'ARRAY_ID')
AR1

By default, all runfile data is returned as a string. This is true even if the data obviously consist of integer or floating point values. To return a converted result, use the keywords /long or /float:

IDL> gaini = mas_runparam(rf, 'HEADER', 'RB rc1 gaini0')
IDL> help,gaini
GAINI           STRING    = '-0000040 -0000040 -0000040 -0000040 -0000040 -0000040 -0000040 -000004'...
IDL> slope = mas_runparam(rf, 'SQUID', 'Col0_squid_lockslope_up',/float)
IDL> print,slope[3]
      5.18432