function [ d ] = elimPoints( d, allPID, PIDfile )
% function [pt] = elimPoints( pt, allPID, PIDfile )
%
% edit data array to remove specified points
% 
% inputs:
%   pt        data array, with rows corresponding to 'allPID'
%   allPID    list of PIDS corresponding to 'pt'
%   PIDfile   file with list of points to be removed
% outputs:
%   pt        edited data array (same dimensions as input)

% read file with PIDs to be eliminated, store in 'findPID'
findPID = textread(PIDfile,'%s%*s');
% fid=fopen(PIDfile,'r');
% ln = fgetl(fid);
% j = 1;
% while ischar(ln)
%     findPID{j} = ln(1:6);
%     % get next line
%     ln = fgetl(fid); 
%     j = j+1;
% end
% fclose(fid);

% loop to find that PID in master PID list,
% and set corresponding data row to NaN values
for j = 1:length(findPID)
     ii = find(strcmp(allPID, findPID{j}));
     d(ii,:) = nan;
end

