npts = burst_meta['npts'] bg_height = 1047.2220 bg_slope = 0.025935641 start = 44.965676 ampl = 2823.6814 tau1 = 8.1735936 tau2 = 2.2154609 taupk = 48.006471 time = (np.linspace((-nlasc), (npts - nlasc), num=npts) * 0.064) - 2 background = bg_height + bg_slope * time background = 0 * time norris_model = burst.draw_norris(time, start, ampl, tau1, tau2, background) residuals = four_channel_data - norris_model def chirplet_model(time, start, ampl, tau1, tau2, background): phi = 0.5 f_0 = 0.28 f_d = -0.01 # anti-chirping stretch lam = np.exp(2 * np.sqrt(tau1 / tau2)) inten = ampl * lam * np.exp(-tau1 / (time - start) - (time - start) / tau2) model = inten * (np.cos((2. * np.pi * f_0 * (time - start)) + (np.pi * f_d * ((time - start) * (time - start))) + phi)) for i in range(len(time)): if time[i] <= start: