;+
;
; NAME: 
;       RATIO_PL
;
; PURPOSE:
;
;
; CATEGORY:
;       BATSE
;
; CALLING SEQUENCE:
;
;
; CALLS:
;	none
;
; INPUTS:
;       none explicit, only through commons;
;
; OPTIONAL INPUTS:
;	none
;
; OUTPUTS:
;       none explicit, only through commons;
;
; OPTIONAL OUTPUTS:
;	none
;
; KEYWORDS:
;	none
; COMMON BLOCKS:
;	none
;
; SIDE EFFECTS:
;	none
;
; RESTRICTIONS:
;	none
;
; PROCEDURE:
;	none
;
; MODIFICATION HISTORY:
;
;-


checkvar,flare, 1325
;Get the direction cosines for LAD(DISCLA) and SPEC(DISCSP)
 det_cosines,cos_lad=cosines,fla=flare,lad_sort=lad_sort,spec_sort=spec_sort,cos_spe=spcos,/sor

 read_flare,flare,fldata

;Get the energy edges for the DISCSP at this time (fldata.(1) is the time)
 d_edges=discsp_edges(fldata.(1))
 ;print,d_edges


 sp_id=1
 edge_products,d_edges(*,1),edges_2=dedg,wid=wdedg
 ;print,dedg,wdedg

 discsp_drm=build_drm(cos=spcos(sp_id),chan_edge=dedg(*,0:1),det_type='spec',$
 e_in=e_in_spec, area=area_sp, det_id=sp_id, test_drm=2)

 det_id=1


 edge_products, (discla_edges())(0:4,det_id), edges_2=edges, width=wedg
 discla_drm=build_drm(cos=cosines(det_id),chan_edge=edges,det_type='lad', $
 e_in=e_in_lad, area=area_lad, det_id=det_id, test_drm=2)

 edge_products,e_in_spec, width=w_in_spec
 checkvar,pli, 4.0
 checkvar,a, [0.,0.,1.,pli,1000.,pli,1.,pli]
 counts_spec=area_sp*wdedg *( discsp_drm#( f_vth_bpow(e_in_spec,a)*w_in_spec))

 edge_products,e_in_lad, width=w_in_lad
 counts_lad = area_lad*wedg* (discla_drm#( f_vth_bpow(e_in_lad,a)*w_in_lad))

 print,counts_spec(0)/counts_lad(0)

end
