;+
; Name:
;	FSDEF
;
; Purpose:
; Set defaults for Fsplot operator communications.
;
; Input: 
;	none
;
; History:
; Shelby Kennard                          7Feb1991
; mod. 7/20/92 by akt to increase number of times we can accumulate to 
; 15000 points, Also, to save time when entering fsplot, don't define those
; big arrays in common fs_saveaccum if they've already been defined.  Also
; changed default for bdb/fdb files to fdb except if user is ANNE. (Before
; default was BDB unless user was BATSE.)
;
; mod. 7/7/94 by Amy Skowronek to start channel arrays at 0 to reflect
; new numbering scheme, 0-(n-1) instead of 1-n. 
; mod. 8/18/94 by AES to use getenv instead of trnlog
; Version 3, RAS, 27-Mar-1996, change call to SETUP_BATSE_ARRAYS
; Mod 9/8/97 by AES, added /gif keyword to work with gif writer
; Version 5, richard.schwartz@gsfc.nasa.gov, 2-feb-1998. Use xdevice().
;************************************************************
;-
pro fsdef,x,gif=gif
@fscom
@fs_saveaccum
@fs_saveplot
;
; Initialize op/com values.
;
; If sys$login = [ANNE] set file type to BDB.
;
;test = trnlog("sys$login",trans,/full)
;if strpos(trans(0), 'ANNE') gt 0 then begin
if getenv('USER') eq 'ANNE' then begin
   dd_type = 0
   usefdb = 0
endif else begin
   dd_type = 1
   usefdb = 1
endelse
;
ddata_accumed = 0
cdata_accumed = 0
spdata_accumed = 0
dd_type_plotted = -1
data_plotted = 0
outprint = 0
sec_st = 0.d0
sec_to = 300.d0
sec_en = sec_st + sec_to
ch_arr = [0,1]                ;changed to 0,1 - now refer to channels 0-(n-1)
det_arr = [1,2]              
sam_av = 1
aspord = 1

cont_ch_arr = [1]             ;changed from 2 to 1 to reflect channels 0-(n-1)
cont_det_arr = [1,2]          
cont_sam_av = 1
cont_aspord = 1
dsp_ch_arr = [0,1]            ;changed from 1,2 
dsp_det_arr = [1]             
dsp_sam_av = 1
dsp_sensord = 1
goes_ch_arr = [1]
goes_sam_av = 1

histogram = 1
yaxis = 0
reltotrig = 0 
fiducmark = 0 
xmin = 0.0
xmax = 0.0
ymin = 0.0
ymax = 0.0
xmulti = 1
ymulti = 1
!p.multi = [0,xmulti,ymulti]
checkvar, noplotfile, 1
save_bangp = replicate(!p, 2)
save_bangx = replicate(!x, 2)
save_bangy = replicate(!y, 2)
maxindex = 0
;Was
;setup_arrays
;setup_batse_arrays   ; setup up discla, seconds, etc arrays in fs_saveaccum
sub_back = 0
corr_angle = 0
div_area = 0
overlay_scale = 1.
noscreen = 0  
last_color = -1   ; last color used in overlaid plots (init to none)
; Initialize postscript device to landscape
savedev = !d.name
pfont = !p.font
;set_plot, 'ps'
;device, /landscape
if not keyword_set(gif) then set_hard, /landscape
if not keyword_set(gif) then set_plot, xdevice(savedev)
!p.font = pfont
winset = 1

end
