function [times, pass_times, URL] = mloacat(URL, time, ranges)
% get times

%
% $Log: mloacat.m,v $
% Revision 1.4  1999/06/29 16:51:48  kwoklin
% Quick fixes on some cat files.           klee
%
% Revision 1.2  1999/05/28 17:57:22  kwoklin
% Fix Pass_Times index representation.                               klee
%
%
% $Id: mloacat.m,v 1.4 1999/06/29 16:51:48 kwoklin Exp $

pass_times = loaddods(URL);
% convert times from units of hours since 1/15/1901 00:00:00 to
% decimal years.
for i = 1:length(pass_times)
  times(i) = day2year(pass_times(i)/24,1901+14/365);
end
% convert pass_times to an index
pass_times = 1:length(pass_times);
pass_times = pass_times(:);
times = times(:);
% subset to valid times
i = find(times >= ranges(4,1) & times <= ranges(4,2));
if ~isempty(i)
  times = times(i);
  % The nc server index goes from 0 to ...   klee 05/27/99
  pass_times = pass_times(i) - 1;
else
  times = [];
  pass_times = [];
end
return
