function e_l, energy_pha
;+
; energy_loss = e_l( energy_pha )
;
;	correct for the non-linearity in the light/energy_loss
;	The pha is calibrated assuming a constant ratio in the
;	light produced per unit energy-loss.  This isn't true for\
;	NaI(Tl) scintillators like the HXT.  This procedure takes the
;	given pha_energy and recalculates it to give the true energy
;	loss.  The pha has been calibrated using lines at 59.7 and 22
;	keV so this routine must return those same values if they are
;	input.
;
;	Input- Energy_pha - energy in keV given by the HXT channel to
;		energy conversion w/o this correction.
;
;	Output- True energy loss in keV.
;
;	RAS - 93/03/26
;
;-

ecal = [22.0, 59.7] ;keV, Cd 109 and Am 251
lcal = fg_c(ecal)*ecal ;light output of calibration sources

return, crystal( $
	lcal(1) + (energy_pha -ecal(1))*(lcal(0)-lcal(1))/(ecal(0)-ecal(1)) )

end

