PRO read_marx_data, marxdir, ypos, zpos, time, order, pha, PARFILE=parfile ;;+ ; ; This PROCEDURE reads in a few data vectors ; from a given marx output directory ; ; USAGE: ; read_marx_data, marxdir, ypos, zpos, xpixel, ypixel, time, PARFILE= parfile ; ; INPUTS: ; marxdir : The directory containing the marx output ; ; OUTPUTS: ; ypos : Vector of ypos data (ypos.dat) (mm) ; zpos : Vector of zpos data (zpos.dat) (mm) ; time : Vector of photon arrival times (seconds) ; order : Vector of diffraction order ; pha : Vector of detected pulse-height of each event ; ; KEYWORD: ; PARFILE = parfile : If the par file is NOT marx.par, ; use this keyword as follows: ; read_marx_data, marxdir, ypos, zpos, ...., PARFILE = 'parfilename.par' ; ; AUTHOR/DATE: CJB, 4/30/97 ; ;;- IF ( N_PARAMS() NE 6) THEN BEGIN PRINT,' ' PRINT,' read_marx_data USAGE: ' PRINT,' ' PRINT,' read_marx_data, marxdir, ypos, zpos, time, order,' + $ ' pha, PARFILE= parfile' PRINT,' ' PRINT,' INPUTS: ' PRINT,' marxdir : The directory containing the marx output' PRINT,' ' PRINT,' OUTPUTS: ' PRINT,' ypos : Vector of ypos data (ypos.dat) (mm) ' PRINT,' zpos : Vector of zpos data (zpos.dat) (mm) ' PRINT,' time : Vector of photon arrival times (seconds) ' PRINT,' order* : Vector of diffraction order' PRINT,' pha : Vector of detected pulse-height of each event' PRINT,' ' PRINT,' *assuming there is an order.dat file, i.e. grating ne "NONE" ' PRINT,' If there is no order.dat file, order = -1 ' RETURN ENDIF put_slash, marxdir IF ( KEYWORD_SET(PARFILE) ) THEN BEGIN parfile_name = marxdir + parfile ENDIF ELSE BEGIN parfile_name = marxdir + 'marx.par' ENDELSE PRINT,' ' PRINT,' Reading in MARX output data from ' + marxdir + ' now . . .' PRINT,' ' ypos = read_marx_file (marxdir + 'ypos.dat') zpos = read_marx_file (marxdir + 'zpos.dat') time = read_marx_file (marxdir + 'time.dat') order = read_marx_file (marxdir + 'order.dat') pha = read_marx_file (marxdir + 'pha.dat') PRINT,' read_marx_data finished.' END