pro read_reg,fname,x,y,r,bin=bin if n_params(0) eq 0 then begin print,'read_reg,fname,x,y,r' print,'If bin, then remap from bin to 1' return endif x = fltarr(100) & y = x & r = x i = 0 openr,1,fname a = '' excl = 0 while not eof(1) do begin readf,1,a if strpos(a,'CIR') gt 0 then begin excl = strmid(a,0,1) eq '-' j1 = strpos(a,'(') j2 = strpos(a,',') x(i) = float(strmid(a,j1+1,j2-j1-1)) j1 = j2 j2 = strpos(a,',',j1+1) y(i) = float(strmid(a,j1+1,j2-j1-1)) j1 = j2 j2 = strpos(a,')',j1+1) r(i) = float(strmid(a,j1+1,j2-j1-1)) if excl then r(i) = -r(i) i = i+1 endif endwhile close,1 x = x(0:i-1) y = y(0:i-1) r = r(0:i-1) if n_elements(bin) gt 0 then begin x = (x-1)*bin+1 y = (y-1)*bin+1 r = r*bin endif return end