
function dataOut = read_M1_GPS_full(buoy,dep)

if ispc
  pre = '//atlas.shore.mbari.org/';
else
  pre = '/Volumes/';
end

mydir = [pre 'oasis_coredata/deployments/' ...
  buoy '/' dep '/' buoy '/'];

fmt = ['%d%*c%f %f %f' repmat('%*f ',1,6) '%*s %d'];
fid = fopen([mydir 'data/gps']);

%skip header
 hd='#';
 while ~isempty(strfind(hd,'#'))
   ft=ftell(fid);
   hd=fgetl(fid);
 end
 clear hd;

%pre-allocate for speed
 fseek(fid,ft,'bof');
 ct=0;
 while ~feof(fid)
   fgetl(fid);
   ct=ct+1;
 end

%read data
 fseek(fid,ft,'bof');
 data=NaN(ct,5);
 for n=1:ct
   s = sscanf(fgetl(fid), fmt)'; %3-5x faster than str2num
   if length(s)==5 %else a badly formatted line
     data(n,:) = s([5 1:4]);
   end
 end
 fclose(fid);
 clear fid ft ct n s ans;

%format time
 dataOut = [datenum([data(:,1) zeros(size(data,1),1) ...
   data(:,2)+data(:,3)/1e5]) data(:,[5,4])];
 clear data;

%get rid of NaN time stamps
 dataOut(isnan(dataOut(:,1)),:) = [];
