function get_yo_dates, index, launch=launch, entrance=entrance, 	$
		pointing=pointing, moon=moon, mercury=mercury,		$
		safehold=safehold, value=value, verbose=verbose, 	$
		header=header
;+
; NAME:
;   get_yo_dates
; PURPOSE:
;   Return significant Yohkoh dates.
; CALLING SEQUENCE:
;   Launch = get_yo_dates(/launch)	; Return launch date
;   SXT_ent= get_yo_dates(/entrance)	; Date SXT entrance filter failed
;   SXT_ent= get_yo_dates(/entr,/verbos); Provide additional information
;   SXT_ent= get_yo_dates(/entr,/ver,/head); Provide additional information with header
;   SXT_ent= get_yo_dates(/entr,/value)	; Provide values of entrance filter 
;   SC_pnt = get_yo_dates(/pointing)	; Dates of S/C pointing changes
;   SC_pnt = get_yo_dates(/poi,verbose)	; Provide additional information
;   SC_pnt = get_yo_dates(/poi,/val)	; Return the values
;   moon   = get_yo_dates(moon=1)	; Get first eclipse date
;   mercury= get_yo_dates(/mercury)	; Get the mercury date
;
;   SC_pnt = get_yo_dates(index,/point)	; Return nominal pointing time of index
;
; OPTIONAL INPUTS:
;   index	= Standard Yohkoh index or time in any Yohkoh format
; OPTIONAL INPUT KEYWORDS:
;   launch	= Set to return launch date
;   entrance	= Set to return dates when SXT entrance filter transmission changed
;		  Value returned the fractional open area
;   safehold	= Set ot return the dates when SXT was in safehold
;   pointing	= Set to return dates of Yohkoh spacecraft pointing
;
;   verbose	= Set to return additional information as a string vector
;   value	= Set to return the associated value (rather than the date)
;   header	= If verbose is set, return a header as first element of output 
;			string vector
;
; RESTRICTIONS:
;   The keywords launch, entrance and pointing are mutually exclusive.
; MODIFICATION HISTORY:
;   25-jan-93, J. R. Lemen LPARL, Written
;   22-aug-95, S. L. Freeland - second entrance filter failure
;   13-nov-95, JRL, Added safehold dates; Updated Moon (eclipse) dates
;   29-aug-96, S.L. Freeland  - third entrance filter failterwq!
on_error,2		; Return to caller

; ----------- Check the input parameters -----------------

ok = keyword_set(pointing) + keyword_set(launch) + keyword_set(entrance) +	$
     keyword_set(mercury)  + keyword_set(moon)   + keyword_set(safehold)

if (ok eq 0) then begin
    doc_library,'get_yo_dates'
    message,'You must supply at least one keyword parameter'
endif

if ok gt 1 then begin
    message,'/pointing, /launch, /entrance, /mercury, /moon',/cont
    message,' are mutually exclusive'
endif

ok = keyword_set(value) + keyword_set(verbose)
if ok gt 1 then message,'/value and /verbose are mutually exclusive'

; ---------------  Set up the data base  ---------------------------
launch_date = '30-Aug-91 10:30:00'		; Yohkoh Launch date
merc_date   = ' 6-nov-93 03:07:23'		; First Contact time 
merc_date   = [merc_date, ' 6-nov-93 03:13:48',' 6-nov-93 03:59:41']	; 2nd and central point
merc_date   = [merc_date, ' 6-nov-93 04:40:03',' 6-nov-93 04:45:24']	; fourth, fifth
merc_date   = fmt_tim(merc_date)

moon_date   = ['13-Nov-93 20:54','24-Nov-95 03:25']	; This is an incomplete list

; ---- Dates of entrance filter changes ----
E_times = [launch_date, fmt_tim('13-Nov-92 16:50'), $
                        fmt_tim('16-AUG-95  08:21:02'), $
                        fmt_tim('25-Aug-96  00:00:00'), $
                        !stime]
ent_val = [0., 1./12, 2./12,3./12]				; Open fraction of entrance filter

; ---- Dates of Spacecraft safeholds ------

;		 ----- start -----   ------ stop ------
safe_date   = ['24-Oct-95 07:29:20','28-Oct-95 05:00:47']

; ---- Dates of Spacecraft pointing changes ------


; ---------------  Return the requested information ----------------

case 1 of

keyword_set(launch):   	begin
			   outval = launch_date
			   if keyword_set(verbose) then begin
			      outval = ['Yohkoh launched on '+outval]
			      if keyword_set(header) then outval = 	$
					['Yohkoh launched from Kagoshima Space Center',outval]
			   endif
			endif
keyword_set(pointing): 	begin
			  message,'/pointing not implemented yet'
			endcase
keyword_set(entrance):  begin
			  if n_elements(index) eq 0 then begin
				times = E_times(0:n_elements(E_times)-2)
				vvv = ent_val
			  endif else begin
				times = anytim2ints(index)
				vvv = fltarr(n_elements(times))
				for i=0,n_elements(E_times)-2 do begin
				   ss = sel_timrange(times, E_times(i), E_times(i+1), /between)
				   if ss(0) gt -1 then vvv(ss) = ent_val(i)
				endfor
			  endelse
			  if keyword_set(verbose) then begin
				outval = strarr(n_elements(times))
				for i=0,n_elements(times)-1 do 	$
				  outval(i) = string(fmt_tim(times(i)),vvv(i),format='(a,f10.4)')
				if keyword_set(header) then outval = ['  Date               Open Fraction of SXT Entrance Filter',outval]
			  endif else if keyword_set(value) then begin
				  outval = vvv	
				  if n_elements(vvv) eq 1 then outval = outval(0)
			  endif else outval = fmt_tim(times)
			endcase
keyword_set(mercury):  	begin
			   outval = merc_date
			   if keyword_set(verbose) then begin
				outval = 'First  contact ' + merc_date(0)
				outval = [outval, 'Second contact '+merc_date(1)]
				outval = [outval, 'Central point  '+merc_date(2)]
				outval = [outval, 'Third  contact '+merc_date(3)]
				outval = [outval, 'Fourth contact '+merc_date(4)]
			   endif
			endcase
keyword_set(moon):	outval = moon_date
keyword_set(safehold):  begin
			   outval = safe_date
			   if keyword_set(verbose) then begin
				txt = ['Start time: ','Stop time:  ']
				for i=0,n_elements(safe_date)-1 do $
					outval(i) = txt(i mod 2)+outval(i)
			   endif
			   if keyword_set(header) then outval = $
					['Spacecraft safehold dates:', outval]
			endcase
endcase 

return,outval
end
