function [u,v,t,fs]=timebase_chk(files)
%[u,v,t,fs]=timebase_chk(files)
%checks time bases and if not the same filters and decimates faster one
[u,v,t,T]=ncload(files,'uvtT');

if all(isnan(T(:,1)))|all(isnan(T(:,2)))%no time base given for one of files
  fs=1;
else
  nz=find(all(~isnan(T')));
  dt=T(nz(1)+1,:)-T(nz(1),:);
  for i=1:2
    if dt(i)>1%time measured in seconds
      dt(i)=dt(i)/(24*3600);
    elseif dt(i)==0%case where time is all zeros
      [p,nm]=fileparts(files{i});%cludge for buoy group naming convention
      nz=max(find(isletter(nm)));
      if nz~=length(nm)
	dt(i)=str2num(nm((nz+1):end))/(24*3600);
      end
    end
  end
  if dt(2)-dt(1) ~= 0%different time bases so filter and decimate fastest
    [u,v,t,fs]=dec_fil(files);
  else
    fs=1/dt(1);
  end
end
