function [pdata] = read_scan_data(filename)
% Zhen Zhang's code to read in array data
% works for ANL and SLAC scan data

fid = fopen(filename);
strread = [];
while 1
    cellread = textscan(fid,'%s',1);
    strread = cellread{1}{1};
    if length(strread)>5
        if strcmp(strread(1:5),'-----')
            break;
        end
    end
end
pdata = cell2mat(textscan(fid,'%f%f%f%f%f%f%f'));
fclose(fid);

end