;+
;NAME:
;	hxs_ph_dead
;PURPOSE:        
;       Deadtime correction factor for HXS-PH as a function of the observed count rate. 
;	Taken from DTCF_PH_HXS, rewritten to
;	accept vectors.  The correction is not exact
;       when the deadtime-corrected count of total PH exceeds about 35,000
;       counts/sec. In addition, spectral distorsion occurs when the deadtime-
;       corrected count of total PH exceeds about 21,000 counts/sec. It is due
;       to instrument limitation.
;CALLING SEQUENCE:
;	subs = dtcf_ph_hxs(float)
;INPUTS:
;	total hxs pha count rate (/sec)
;	float - ( HXS-PH(SUM( 0-31ch.) ) [counts/sec]
;Outputs:
;	returns deadtime correction factor from 1 (input=0/sec) to infinity
;HISTORY:
;	;FOR DTCF_PH_HXS
;	26-Jun-93  (K.Suga) First written.
;       25-nov-93  Revised by J.Sato,K.Morimoto and M.Yoshimori
;	;hxs_ph_dead, 25-May-94, ras
;-
;
function hxs_ph_dead,ht

ht = float( ht )

wlt = where( ht lt 8400., nlt)
wgt = where( ht ge 8400., ngt)

dtcf = ht*0.0

if nlt ge 1 then $
  dtcf(wlt) =  poly( ht(wlt), [1.0059, -5.2422e-5, 7.2780e-8, -1.4251e-11, 1.0407e-15, 9.9369e-21])
if ngt ge 1 then $
  dtcf(wgt) =  poly( (ht-7480.)(wgt), [2.2276, 7.0923e-4, -1.0117e-6, 1.6301e-9, -7.6686e-13, 1.6471e-16])

return,dtcf
end
