; Local_gain_corr.pro Corrects for Local Gain Depression ; Klaus Wilhelm 03 February 1997 ; Apply deadtime correction first! (See deadtime_corr.pro) pro local_gain_corr,detector,output,input ; output (vectors or arrays): detector measurements in counts/pixel/s ; detector: 'A' or 'B' d1=0 d2=0 output_size=size(output) if output_size(0) eq 1 then d1=output_size(1) if output_size(0) eq 2 then begin d1=output_size(1) d2=output_size(2) endif rate=[0.,0.1,0.3,1.,3.,10.,30.,100.,300.] if strupcase(strtrim(detector,2)) eq 'A' then $ gain=[1.,1.,0.99,0.986,0.928,0.866,0.765,0.5,0.123] else $ gain=[1.,1.,0.99,0.986,0.928,0.866,0.765,0.5,0.123] ; Detector B data not yet available. Quicklook data show that there are only ; minor differences. Consequently, we use A values for B until updated data ; will be available. if d2 eq 0 then gain_intpol = interpol(gain,rate,output) else begin gain_intpol=fltarr(d1,d2) for i=0,d2-1 do gain_intpol(0,i) = interpol(gain,rate,output(*,i)) endelse input=output/gain_intpol return end