; deadtime_corr.pro Corrects for Deadtime Effects (Detectors A or B) ; Klaus Wilhelm 03 February 1997 ; Rev. 1 Full frame output option corrected 07 February 1997 ; Rev. 2 Conversions factors verified (W.C. and M.G.) 11 February 1997 ; To be applied before local gain depression correction ; See local_gain_corr.pro ; Deadtime effects become significant for total count rates of 50000 cnt/s and ; more. pro deadtime_corr,detector,output,input,xdl_input ; detector: 'A' or 'B' ; output: full or partial detector output. ; input: corrected detector input in same format as output. ; xdl_input as measured by fast detector output; see Fig. 6 of Appl. Opt.,35, ; 5125, 1996; is contained in header, but delayed (conversion factors: ; Detector A - x=6.988, y=6.988; B - x=7.123, y=7.087). Use is optional, ; if full detector readout is available as output. If only 120*1024 pixels are ; available (format 4) care must be taken to account for any light in 'dark' ; pixels. Check against xdl_input. output=float(output) if n_params() eq 3 then begin input_cal=findgen(5e2)*1e4 if strupcase(strtrim(detector,2)) eq 'A' then $ factor=(0.9889+1.4246e-6*input_cal)>1.0 else $ factor=(0.9750+1.3982e-6*input_cal)>1.0 output_cal=input_cal/factor input_res = interpol(input_cal,output_cal,total(output)) if strupcase(strtrim(detector,2)) eq 'A' then $ fact=(0.9889+1.4246e-6*input_res)>1.0 else $ fact=(0.9750+1.3982e-6*input_res)>1.0 endif else begin if strupcase(strtrim(detector,2)) eq 'A' then $ fact=(0.9889+1.4246e-6*xdl_input)>1.0 else $ fact=(0.9750+1.3982e-6*xdl_input)>1.0 endelse input=output*fact(0) return end