How to use the landau.discrete_convolution function in Landau

To help you get started, we’ve selected a few Landau examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github HiSPARC / sapphire / reconstruction_efficiency / plots.py View on Github external
figure()

    x = data.root.datasets.poisson.x.read()
    y = data.root.datasets.poisson.y.read()
    yerr = data.root.datasets.poisson.yerr.read()
    errorbar(x, y, yerr=yerr, fmt='o', label="Data")

    x = linspace(-10, 10, 101)
    f = vectorize(lambda x: 1 - exp(-.5 * x) if x >= 0 else 0.)

    for s in [0., 0.5, 1., 1.5]:
        if s == 0.:
            plot(x, f(x), label="Unconvoluted")
        else:
            g = stats.norm(scale=s).pdf
            plot(x, discrete_convolution(f, g, x),
                 label="sigma = %.2f m$^{-2}$" % s)

    xlim(0, 5)
    title("Effect of uncertainty on particle density")
    xlabel("Charged particle density (m$^{-2}$)")
    ylabel("Probability of one or more particles")
    legend(loc='best')
    savefig("plots/conv_poisson.pdf")

Landau

The Landau Project

MIT
Latest version published 4 years ago

Package Health Score

58 / 100
Full package analysis

Similar packages