; This routine will load all of the data into the common block. ; ; The data is all kept in the structure kallen_data. The tags are ; correct if we read in group 1 data, for group 0 we use the same ; structure, but it will hold different data.... ; IntProt1: IntHelium1, IntProt2:IntHelium2 ; IntElec1: IntHelium3, IntElec2:IntProt1 ; The date will be the same PRO KRead COMMON kallen_data, data,size,info ; Create the structure we use to store the data A={Entry,tstart:0.0,tend:0.0,IntProt1:0.0,AnisProt1:0.0,$ IntProt2:0.0,AnisProt2:0.0,IntElec1:0.0,AnisElec1:0.0,IntElec2:0.0,$ AnisElec2:0.0} info={Data_info,fname:'[plh.kallenrode]g1_76_h1.dat',HELIOS:1,GROUP:1,$ YEAR:76} datadir = 'ud1:[zfs.kallenrode]' dir, datadir if n_elements(file) eq 0 then file = 'g1_76_h1' echo, 'File name', file, /file ;Figure out from the file name, what HELIOS,GROUP,YEAR we're using. info.HELIOS=FIX(STRMID(file,7,1)) info.YEAR=FIX(STRMID(file,3,2)) info.GROUP=FIX(STRMID(file,1,1)) if info.GROUP eq 2 then begin print,'Group 2 data not yet implemented!' return endif ; Get the actual file EXT = strpos(FILE,'.DAT') if EXT eq -1 then EXT = strlen(FILE) FILE = strmid(FILE,0,EXT) info.fname = datadir+file+'.dat' data=REPLICATE( {Entry} , 2000) name=STRING(REPLICATE(32B,11)) ; A is now just a dummy variable to "slurp up" the unwanted line A=STRING(27B) OPENR,Unit,info.fname,/GET_LUN echo, ' .... Reading file '+info.fname READF,Unit,name READF,Unit,a Size=0 b=FLTARR(10) WHILE NOT EOF(Unit) DO BEGIN READF,Unit,b IF b(0) ne 0 then begin data(Size).tstart=b(0) data(Size).tend=b(1) data(Size).IntProt1=b(2) data(Size).AnisProt1=b(3) data(Size).IntProt2=b(4) data(Size).AnisProt2=b(5) data(Size).IntElec1=b(6) data(Size).AnisElec1=b(7) data(Size).IntElec2=b(8) data(Size).AnisElec2=b(9) Size=Size + 1 ENDif ENDwhile FREE_LUN,Unit ; Shorten the array data = data(0:Size-1) return & end