def default_bgsubtraction(x, y, endpoint_size=10, endpoint_right=10): """ Return a function that linearly interpolates between the lower and upper x values of the dataset specified by x and y """ bgx = np.concatenate((x[:endpoint_size], x[-endpoint_right:])) bgy = np.concatenate((y[:endpoint_size], y[-endpoint_right:])) interp_func = rldeconvolution.extrap1d(interp1d(bgx, bgy)) return interp_func
def bgsubtract(npulses, attenuation, nframes, kaptonfactor=1.0, airfactor=1.0): darksub = dark_subtraction(npulses, nframes) airsub = airfactor * air_scatter2(npulses, attenuation, nframes) if kaptonfactor: # kaptonsub != 0 kaptonsub = kaptonfactor * kapton_only(npulses, attenuation, nframes) else: kaptonsub = 0.0 interp_func = lambda x, y: rldeconvolution.extrap1d(interp1d(x, kaptonsub + darksub + airsub)) return interp_func
def bgsubtract(npulses, attenuation, nframes, kaptonfactor=1., airfactor=1.): darksub = dark_subtraction(npulses, nframes) airsub = airfactor * air_scatter2(npulses, attenuation, nframes) if kaptonfactor: # kaptonsub != 0 kaptonsub = kaptonfactor * kapton_only(npulses, attenuation, nframes) else: kaptonsub = 0.0 interp_func = lambda x, y: rldeconvolution.extrap1d( interp1d(x, kaptonsub + darksub + airsub)) return interp_func