if APPLY_WINDOW == False: #we still need window for form_factor calculation window[...] = 1. #: we must create a video of windows for multiplication window_video = ((window, window), ) * NFRAMES #: determines optimal weight factor from examples.paper.form_factor import g1, bg1, bg2 from cddm.norm import weight_from_g, weight_prime_from_g bg1 = bg1(KIMAX, 0) bg2 = bg2(KIMAX, 0) delta = 0. g1 = g1(np.arange(NFRAMES), KIMAX, 0) w = weight_from_g(g1, delta) wp = weight_prime_from_g(g1, delta, bg1, bg2) def calculate(): out = None bgs = [] vars = [] for i in range(NRUN): print("Run {}/{}".format(i + 1, NRUN)) seed(i)
from examples.paper.form_factor import g1 import os.path as path SAVEFIG = True colors = ["C{}".format(i) for i in range(10)] LABELS = {0: "B'", 1: "C'", 2: "B", 3: "C", 4: "W'", 6: "W"} MARKERS = {0: "1", 1: "2", 2: "3", 3: "4", 4: "+", 6: "x"} #which method... either fast, standard, full, random or dual METHOD = "dual" #theoretical amplitude of the signal. amp = rfft2_crop(g1(0), KIMAX, KJMAX) def _g1(x, f, a, b): """g1: exponential decay""" return a * np.exp(-f * x) + b def _fit_k(x, ys, p0): for y in ys: try: popt, pcov = curve_fit(_g1, x, y, p0=p0) yield popt, np.diag(pcov) except: yield (np.nan, ) * 3, (np.nan, ) * 3
#: create window for multiplication... window = blackman(SHAPE) if APPLY_WINDOW == False: window[...] = 1. #: we must create a video of windows for multiplication window_video = ((window, ), ) * NFRAMES_STANDARD #: determines optimal weight factor from examples.paper.form_factor import g1, bg1, bg2 from cddm.norm import weight_from_g, weight_prime_from_g bg1 = bg1(KIMAX, 0) bg2 = bg2(KIMAX, 0) delta = 0. g1 = g1(np.arange(NFRAMES_STANDARD) * DT_STANDARD, KIMAX, 0) w = weight_from_g(g1, delta) wp = weight_prime_from_g(g1, delta, bg1, bg2) def calculate(): out = None bgs = [] vars = [] for i in range(NRUN): print("Run {}/{}".format(i + 1, NRUN)) seed(i)
level_size=16, binning=1) #get eefective count in aveariging... x, n = log_merge_count(clin, cmulti, binning=1) i, j = (K, 0) x = np.arange(NFRAMES) #delta parameter for weight model delta = 0. bg1 = bg1(51, 0)[..., i, j] bg2 = bg2(51, 0)[..., i, j] if CROSS else bg1 g = g1(x, 51, 0, cross=CROSS)[..., i, j] wp = weight_prime_from_g(g, delta, bg1, bg2) w = weight_from_g(g, delta) #error estimators using a simple model of independent data (delta = 0). err1 = sigma_prime_weighted(0., g + 0j, delta, bg1, bg2) #/n**0.5 err2 = sigma_prime_weighted(1., g, delta, bg1, bg2) #/n**0.5 err3 = sigma_prime_weighted(wp, g, delta, bg1, bg2) #/n**0.5 err5 = sigma_weighted(0., g, delta) #/n**0.5 err6 = sigma_weighted(1., g, delta) #/n**0.5 err7 = sigma_weighted(w, g, delta) #/n**0.5 ax1 = plt.subplot(121)
#: create window for multiplication... window = blackman(SHAPE) if APPLY_WINDOW == False: window[...] = 1. #: we must create a video of windows for multiplication window_video = ((window, ), ) * NFRAMES_RANDOM #: determines optimal weight factor from examples.paper.form_factor import g1, bg1, bg2 from cddm.norm import weight_from_g, weight_prime_from_g bg1 = bg1(KIMAX, 0) bg2 = bg2(KIMAX, 0) delta = 0. g1 = g1(np.arange(NFRAMES), KIMAX, 0, cross=False) w = weight_from_g(g1, delta) wp = weight_prime_from_g(g1, delta, bg1, bg2) def calculate(): out = None bgs = [] vars = [] for i in range(NRUN): print("Run {}/{}".format(i + 1, NRUN)) seed(i)