function [times, pass_times, urllist, url] = htncat(CS, time, ranges)
%----------------------------------------------------------------------------
%
% This function generates a time and file name for URI AVHRR images
%
% Formal parameters:
% catalog_server: URL of the catalog server.
% time: The time range of the data set.
%
% The return values are:
% times: The time in decimal years (years and fractions) for all hits.
% pass_times: This is a matrix of time with the year, day and hour
% of each hit. Note that the day here is the calendar day.
%
%----------------------------------------------------------------------------

%
% $Log: htncat.m,v $
% Revision 1.1  1999/06/01 07:10:26  dbyrne
%
%
% Moved up from kleedata/
%
% Revision 1.2  1999/05/28 17:32:51  kwoklin
% Add all globec datasets. Fix depth representation for all globec datasets
% and nbneer dataset. Fix frontal display for htn and glkfront. Make use of
% getjgsta for all jgofs datasets. Point usgsmbay to new server. Point htn,
% glk, fth and prevu to new FF server.                                 klee
%

% $Id: htncat.m,v 1.1 1999/06/01 07:10:26 dbyrne Exp $
% klee 05/17/99

pass_times = []; url=[]; urllist = []; times = [];

% Get beginning and ending of time interval.
StartTime = max(time(1), ranges(4,1));
LastTime = min(time(2), ranges(4,2));

Constraint = ['DODS_URL,DODS_Decimal_Year(HTN_Avhrr)&decimal_year("',num2str(StartTime,9),'","',num2str(LastTime,9),'")'];
URL = [CS,'?',Constraint];
url = URL;
loaddods(url);

%deref string vector DODS_URL
urla = eval('DODS_URL');
urllist = derefurl(urla);

%deref string vector DODS_Decimal_Year
times = derefdat(DODS_Decimal_Year);
pass_times = [pass_times; times];

return;
