;+
; Project     :	SOHO - CDS
;
; Name        :	LIST_SUPPORT
;
; Purpose     :	List Ground Support a given period
;
; Explanation :	Temparary replacement of LIST_OTHER_OBS
;
; Use         :	LIST_SUPPORT, START, END, SUPPORT, N_FOUND
;
; Inputs      :	START, END = The range of date/time values to use in searching
;			     the database.  Can be in any standard CDS time
;			     format.
;
; Opt. Inputs :	None.
;
; Outputs     : Support = A structure variable containing the following tags
;                         for each planned observation:
;
;                       STRUCT_TYPE  = The character string 'OTHER-OBS-LIST'.
;                       TELESCOP     = The name of the telescope.
;                       MNEMONIC     = The mnemonic for the telescope.
;                       SCI_OBJ      = Science objective
;                       SCI_SPEC     = Specific science objective
;                       NOTES        = Further notes about the observation
;                       START_TIME   = Date/time of beginning of observation,
;                                      in TAI format
;                       END_TIME     = Date/time of end of observation, in TAI
;                                      format
;                       OBJECT       = Code for object planned to be observed
;                       OBJ_ID       = Object identification
;                       CMP_NO       = Campaign number
;
;		N_FOUND	= Number of support periods found.
;
; Opt. Outputs:	None.
;
; Keywords    :	None.
;
; Common      :	None.
;
; Restrictions:	None.
;
; Side effects:	None.
;
; Category    :	Planning, Database.
;
; Prev. Hist. :	None.
;
; Written     :	Version 1, Dominic Zarro, 29 June 1995.
;		Version 2, William Thompson, GSFC, 16 September 1996
;			Updated times to put into UT timezone.
;
;-

PRO list_support,start_search,end_search,support,n_found,error=error

   ON_ERROR,1
   error = ''
   supp={telescop:'',mnemonic:'',$
         sci_obj:'',sci_spec:'',notes:'',start_time:0.d,end_time:0.d,$
         object:'',obj_id:'',cmp_no:''}

;    supp={struct_type:'other-obs-list',telescop:'',mnemonic:'',$
;          sci_obj:'',sci_spec:'',notes:'',start_time:0.d,end_time:0.d,$
;          object:'',obj_id:'',cmp_no:''}

   tstart=utc2tai(anytim2utc(start_search))
   tend=utc2tai(anytim2utc(end_search))
;
;-- Make-up some ground support values
;

   secs_per_day=24.d*3600.d
   datastart = tai2utc(tstart)   ; form .DAY and .TIME
   datastart.time = 0            ; only want day part
   daystart = utc2tai(datastart) ; start of STARTDIS in TAI

   dataend = tai2utc(tend)   ; form .DAY and .TIME
   dataend.time = 0          ; only want day part
   dayend = utc2tai(dataend) ; start of STARTDIS in TAI
   T1 = [7,14,16]               ; contact start time
   T2 = [17,25,28]              ; contact end time
   TN = [12,19,22]               ; contact's local noon
   LABEL = ['Canaries','West U.S.','Hawaii'] ; contact's location
   days=long((dayend-daystart)/secs_per_day)

   for i=0,days-1 do begin
    day_sec=daystart+i*secs_per_day
    for k=0,n_elements(t1)-1 do begin
     supp_start = day_sec+ (T1(k) * 3600d) ; into sec
     supp_end  = day_sec + (T2(k) * 3600d) ; into sec
     supp_name  = label(k)
     supp.start_time=supp_start
     supp.end_time=supp_end
     supp.telescop=label(k)
     support=concat_struct(support,supp)
    endfor
   endfor
   n_found=n_elements(support)
   if n_found eq 0 then delvarx,support
   RETURN
END

