;+
; PROJECT:
;	SDAC
; NAME: 
;       FS_SUBTITLE
;
; PURPOSE:
;
;        This procedure generates subtitle string for fs_graph.
;
; CATEGORY:
;       BATSE
;
; CALLING SEQUENCE:
;	fs_subtitle, subtitle1, subtitle2
;
; CALLS:
;	none
;
; INPUTS:
;       none explicit, only through commons;
;
; OPTIONAL INPUTS:
;	none
;
; OUTPUTS:
;       subtitle1
;       subtitle2
;
; OPTIONAL OUTPUTS:
;	none
;
; KEYWORDS:
;	none
; COMMON BLOCKS:
;	fscom, fs_saveaccum, fs_saveplot
;
; SIDE EFFECTS:
;	none
;
; RESTRICTIONS:
;	none
;
; PROCEDURE:
;	none
;
; MODIFICATION HISTORY:
; Mod. 7/8/94 by Amy Skowronek to show physical detector id's (0-7) and
; channel id's (starting at 0)
;	Version 3, richard.schwartz@gsfc.nasa.gov, bring energy labels in
;	line with current software.  26-sep-1997
;	Version 4, richard.schwartz@gsfc.nasa.gov, revise energy labels in
;	line with current software for discla.  8-mar-1998.
;-
pro fs_subtitle, subtitle1, subtitle2
;
;
;
@fscom
@fs_saveaccum
@fs_saveplot            
;
; Generate labels at bottom of plot.
;
getut, utstart = utstart
date ='Data Start: '+atime(utstart,/hxr)+ $
  '    Current: '+strmid(atime(sys2ut(0),/hxr), 0, 14)

case 1 of 
dd_type le 1: begin
   edges = discla_edges(det_sav(0))
   ;edges = [(discla_edges())(*,det_sav(0))<1000,1e4,15.]
   ;edge_products, edges(sort(edges)), edges_2=edges
   edges = edges(*,[indgen(4)+1,0,5])
   ch_str = string(ch_sav, format='(6i2)')
   lad_string = 'LAD  Geometric Area cm!u2!n' 
   area = 2025.
   end
dd_type eq 2: begin
   set_pendleton, 2	;Preece edges with Lestrade calibration.
   edges = cont_edges(time=utstart, det_sav(0))
   if n_elements(ch_sav) eq 1 then ch_str = string(ch_sav(0),format='(i2)') $
      else ch_str = string([min(ch_sav),max(ch_sav)], format="(i2,' - ', i2)")
   lad_string = 'LAD  Geometric Area cm!u2!n' 
   area = 2025.
   end
dd_type eq 3: begin
   edges = discsp_edges(utstart, det=det_sav(0)) > 5.
   ch_str = string(ch_sav, format='(4i2)')
   lad_string = 'SPEC  Geometric Area cm!u2!n' 
   area = 127.
   end
endcase
;print,'FLAG!  fs_subtitle'
;print,'det_sav= ',det_sav
number = det_sav
n = indgen(n_elements(det_sav))
eff_ar = fix(area * cos_sav(n) + .5)
percent = strtrim( string(fix(cos_sav(n) * 100. + .5)), 2)
eff_arst = string(eff_ar,format='(i5)')
area_str_arr = ' '+strtrim(string(number),1)+'    '+$
   eff_arst + ' (' + percent + '%)!c'
area_string = ''
for i=0,n_elements(det_sav)-1 do area_string = area_string+area_str_arr(i)

lowkev = min( edges(0, ch_sav  > 0)  )
hikev = max(edges(1, ch_sav < (n_elements(edges)-1) ))
kev_str = ' (' + strtrim (string(lowkev,form='(f8.1)'),2) + ' - ' $
          + strtrim (string(hikev,form='(f8.1)'),2) + ' keV)'
chan_string = 'Channels: '+ch_str +kev_str 
if sub_back then back_string='Background subtracted' else back_string=''
if corr_angle then corr_string='Average LAD rates weighted by effective area' $
   else corr_string=''

bl4=string(bytarr(4)+32b)
bl29=string(bytarr(29)+32b) 
subtitle1 = date + '!c' + lad_string + '!c' + area_string 
subtitle2 = '!c' + chan_string + '!c' + back_string $
            + '!c' + corr_string
;             
end
