pro pr_sxtobs, st_date0, en_date0, qstop=qstop, outfile=outfile, hc=hc, $
		ffi=ffi, pfi=pfi, $
		longform=longform, list=list, obs=obs, notit=notit
;
;+
;NAME:
;	pr_sxtobs
;PURPOSE:
;	Read the SXT observing log and list the images taken
;CALLING SEQUENCE:
;	pr_sxtobs, '1-jan', /ffi
;	pr_sxtobs, '30-oct-91', '2-nov-91', /hc, /ffi
;	pr_sxtobs, '1-jan-92', '1-jan-92 14:00', outfil='jan92.sxtobs'
;INPUT:
;	st_date	- The UT date to search for.  If no date is entered,
;		  the current date is used.  The year is not
;		  required, but if entered should be of the
;		  form 1-Oct-91 style.  The date should be
;		  entered in string style with date first.
;OPTIONAL INPUT:
;	en_date	- The ending date to list data for.  If no date is passed,
;		  it only searches for "st_date"
;OPTIONAL KEYWORD INPUT:
;	outfile	- If a filename is passed, the results will also
;		  be written to that file
;	hc	- If set, write the results to a temporary file, print
;		  it and delete it.
;	ffi	- If set, then only search FFI.  Default is to list both PFI/FFI
;	pfi	- If set, then only search PFI.  Default is to list both PFI/FFI
;	notit	- If set, then do not put the title on the output
;OPTIONAL KEYWORD OUTPUT:
;	list	- The "get_info" array information (string array)
;	obs	- The SXT observing log data
;HISTORY:
;	Written 28-Oct-93 by M.Morrison
;-
;
if (n_elements(st_date0) eq 0) then begin
    st_date = anytim2ints(strmid(!stime, 0, 6))		;date only, not time
end else begin
    st_date = anytim2ints(st_date0)
end
;
if (n_elements(en_date0) eq 0) then begin
    en_date = anytim2ints(st_date, off=24.*60.*60)
end else begin
    en_date = anytim2ints(en_date0)
end
;
qffi = keyword_set(ffi)
qpfi = keyword_set(pfi)
if (qpfi+qffi eq 0) then begin
    qffi = 1
    qpfi = 1
end
;
obs = 0b
list = ''
rd_obs, st_date, en_date, bcs, sxtf, sxtp, sxtf=qffi, sxtp=qpfi
;
qgot_pfi = get_nbytes(sxtp) gt 10
qgot_ffi = get_nbytes(sxtf) gt 10
case 1 of
    qgot_pfi and qgot_ffi:		obs = [sxtf, sxtp]
    qgot_pfi and (not qgot_ffi):	obs = sxtp
    qgot_ffi and (not qgot_pfi):	obs = sxtf
    else: begin
	print, 'PR_SXTOBS: No SXT FFI images found between ' + fmt_tim(st_date) + ' and ' + fmt_tim(en_date)
	return
    end
end
if (n_elements(obs) gt 1) then obs = obs(sort(int2secarr(obs)))		;time sort
;
list = get_info2(obs, /non, longform=longform)
;
tit = ['PR_SXTOBS.PRO Run: ' + !stime, $
	'SXT Observing Log Search from: ' + fmt_tim(st_date) + ' to ' + fmt_tim(en_date), $
	'  ']
if (not keyword_set(notit)) then list = [tit, list]
prstr, list, file=outfile, hc=hc
;
if (keyword_set(qstop)) then stop
end
