pro fileread,ereal,greal,nreal ; returns nevents, a matrix that tabulates the number of total ; events in a file, and gausspeak, the maximum of the gaussian ; that fits the energy spectrum of each file. ; Tests my primative ability to make strings from which ; to build names of files to read. ; ; Corrects for movements of positioner 5/28/96 ; ; Current version counts all photon hits. This should be ; corrected so a region of interest is defined about the ; postion on the detector where most events are expected, ; i.e., ignore most background and Fe55 counts. ; NOTE: I *think* this is solved in the calposition ; code, but should double check!! 2/3/97 ; ; outfile should output parameters in order on detector ; versus order of positioner file ; NOTE: run ARRANGE on output file to do this! ; ; OFFERRED "As Is", use at your own risk and report problems to me please! ; ; Version 0.0 PTB 2/3/97 ; ***************************************************** a='calpoint.000' ereal=fltarr(28,28) greal=fltarr(28,28) nreal=fltarr(28,28) openw,4,'caldat' for i=0,27 do begin ;corresponds to x movement from upper right corner for j=0,27 do begin ;corresponds to movement in y ij=(i)*28+(j+1) add=string(ij) if (ij lt 10) then begin hold='000' add0=strmid(add,7,1) strput,hold,add0,2 add1=hold endif if (ij ge 10 and ij lt 100) then begin hold='000' add0=strmid(add,6,2) strput,hold,add0,1 add1=hold endif if(ij ge 100) then begin add1=strmid(add,5,3) endif strput,a,add1,9 ; CALL THE READER ; readcal1,a,x,y,nne,eav,gausspeak ; printf,4,i,j,nne,eav,gausspeak ; calculate position of positioner for calculation of expected ; image on the detector window if (i/2 eq float(i)/2.) then begin p=27-i q=27-j endif else begin p=27-i q=j endelse ; ; real positions: pos0=5.71249 incs=findgen(28)*11.4286+pos0 incs=incs*640./320. print,incs(p),incs(q) ; ; Now cal readcal with the positional information readcal1,incs(p),incs(q),a,x,y,nne,eav,gausspeak if (i/2 eq float(i)/2.) then begin print,'even',27-i,27-j ereal(27-i,27-j)=eav greal(27-i,27-j)=gausspeak nreal(27-i,27-j)=nne printf,4,27-i,27-j,nne,eav,gausspeak endif if (i/2 ne float(i)/2.) then begin print,'odd',27-i,j ereal(27-i,j)=eav greal(27-i,j)=gausspeak nreal(27-i,j)=nne printf,4,27-i,j,nne,eav,gausspeak endif endfor endfor close,4 end @calposition