function findPID(myPID, pid, pt)
% function findPID(myPID, pid, pt)
%
% find PID and highlight it on the active map
%
% input:
%   myPID         PID to find in matrix
%   pid           name of all points (PIDs)
%   pt            dimensions (#PID x 4)
%                   1-2 lat/long (deg)
%                   3   azimuth (deg)
%                   4   vector length (m)

global Q hdt; % figure and datacursor handles
                % from last call to 'replotVectors'

% find the desired PID in the full storage array
q = strcmp(pid, myPID);
z = find(q==1);
if isempty(z)
    error(sprintf('cannot find PID ',myPID));
else
    fprintf('found PID --%s-- at position %d\n',myPID,z);
end

% lat/long of the PID
ll = [pt(z,1)-360 pt(z,2)];

% activate datatip on the selected point
hdt.removeAllDataCursors;
hh = hdt.createDatatip(Q);
set(hh,'position',ll)
% updateDataCursors(hdt);

% programatically zoom to point (comment out to disable zoom)
% >> this method does not actually zoom to where the 
%   desired point is centered
% A = gca;
% moveptr(A,'init')
% moveptr(A,'move',ll(1),ll(2))
% zoom(3)

% >> this method permanently resets the axes
%   so you can't zoom back out
% xl = [ll(1)-360-grd ll(1)-360+grd]
% yl = [ll(2)-grd ll(2)+grd]
% set(gca,'xlim',xl,'ylim',yl);

