function [pid, vect] = readVectfile(fname)
% function [pid, vect] = readVectfile(fname)
%
% read VERTCON vector-format file;
% return list of PIDS
% and corresponding lat/lon and ortho height difference,
%
% INPUT
% fname name of file; may include path
%
% OUTPUT
% piddat  1 name of point (PID)
% vect   dimensions (#PID x 4)
%         1-2 lat/long (deg)
%         3   NaN
%         4   differential ortho height (m)

% check if *mat file exists, otherwise load from ASCII
[f,n,e] = fileparts(fname);
fnameMat = [n e '.mat'];
% if exist(fnameMat)
%     fprintf('loading from saved *.mat file\n');
%     tic;
%     load(fnameMat);
%     toc
% else
    fprintf('loading from ASCII file\n');
    tic;
    [lon, lat, dht, pid] = textread(char(fname),...
           '%f %f %f %s');
    toc
%    save(fnameMat);
% end

% then parse into output arrays
vect = [lat lon NaN*ones(length(lat),1) dht];

return

