function gps = readgps(filename, gpsType)
% READGPS   - Read oasis GPS files
% 
% Use as: gps = readgps(filename, gpsType)
%
% Inputs: filename = name of gps file to read
%         gpsType  = type of gps reciever
%                    options = 'garmin'
%                              'magellan'
%
% Output: gps = matrix of data with the following columns
%                time(matlab format) 
%                latitude
%                longitude
%                standard deviation of position in meters
%                number of samples

% Brian Schlining
% 21 July 2000


switch lower(gpsType)
case 'garmin'
   [jday lat lon stdDev numSamples f g h i j year] = textread(filename, '%f %f %f %f %f %f %f %f %f %s %f', 'commentstyle','shell');
   gps = [jul2date(jday, year) lat lon stdDev numSamples];
case 'magellan'
   x = readflatfile(filename);
   gps = [jul2date(x(:,1), x(:, end)) x(:, 2:5)];
end



