;+
;
;  Name:
;       FIX_DISCSP2
;
;
; PURPOSE:  perform corrections on discsp data
;	    works on discsp data not in BATSE common blocks.
;
; CATEGORY: BATSE,SPEX
;
;
; CALLING SEQUENCE: fix_discsp2, discsp, sp_cos8, splivet,count_bad=count_bad, error=error
;
;
; CALLED BY:
;
;
; CALLS:
;	batse_deadtm, batse_overflow, f_div
;
; INPUTS:
;       discsp - raw discsp data, fltarr(4,8,nbins)
;	sp_cos8- 8 detector cosines for SPECs
;
; OPTIONAL INPUTS:
;	none
;
; OUTPUTS:
;       discsp - returns corrected values
;       splivet - live time array
; OPTIONAL OUTPUTS:
;	error - if set then there was a problem
;
; COMMON BLOCKS:
;	none
;
; SIDE EFFECTS:
;	none
;
; RESTRICTIONS:
;	none
;
; PROCEDURE:
;	none
;
; MODIFICATION HISTORY:
;    	ras, 21-sep-95, based on fix_discsp
;-


pro fix_discsp2, discsp, sp_cos8, splivet, count_bad=count_bad, error=error
;
;purpose:  perform array manipulations on discsp data
;
;         
;
maxspindex = n_elements(discsp(0,0,*)) -1
@fix_discsp_code.pro
