def main():
    ds = DefaultSignal(id=signal_id())
    dbg = DefaultBackground(id=background_id())

    x = dbg.background_range()

    plt.plot(x, psi_fluctuations(ds, dbg))
    plt.title(r"Background + Signal \w Fluctuations", fontsize=18)
    plt.ylabel("Scales", fontsize=16)
    plt.xlabel("Mass", fontsize=16)

    plt.show()
def save_clean_plot(path, s_id, bg_id):
    ds = DefaultSignal(id=s_id)
    dbg = DefaultBackground(id=bg_id)

    x = dbg.background_range()

    plt.plot(x, psi_clean(ds, dbg))
    plt.title(r"Signal + Background")
    plt.ylabel("Amplitude")
    plt.xlabel("Mass")

    if os.path.isfile(path):
        os.remove(path)

    plt.savefig(path)
    plt.close('all')
def main():
    ds = DefaultSignal(id=signal_id())
    dbg = DefaultBackground(id=background_id())

    x = dbg.background_range()

    fig, ax = plt.subplots(figsize=(9, 7))

    plt.plot(x, psi_clean(ds, dbg))
    plt.title(r"Background + Signal", fontsize=20)
    plt.ylabel("Events/Mass Unit", fontsize=18)
    plt.xlabel("Mass", fontsize=18)
    plt.xticks(fontsize=18)
    plt.yticks(fontsize=18)

    path = 'docs/output/cwt/clean_bg_signal.jpeg'
    plt.savefig(path)
    plt.close('all')
Esempio n. 4
0
def main():
    ds = DefaultSignal(id=signal_id())
    dbg = DefaultBackground(id=background_id())
    cmor = DefaultCWTFluctuations(id=wavelet_id())

    print(cmor.wavelet)

    x = dbg.background_range()
    data = psi_fluctuations(ds, dbg)
    # data = psi_clean(ds, dbg)
    coeffs, freqs = cmor.generate_coefficients(data)

    amp = np.abs(coeffs)
    new_shape = [48, 64]
    amp_rebinned = rebin(amp, new_shape)
    amp_p_value = p_value_transformation_local(amp_rebinned, new_shape)

    plot_bg_signal_fluc(x, data)
    plot_bg_signal_og(amp, dbg, cmor)
    plot_bg_signal_rebinned(amp_rebinned, dbg, cmor)
    plot_bg_signal_rebinned_p_value(amp_p_value, dbg, cmor)