icecube_tools.source.power_law module

class icecube_tools.source.power_law.BoundedPowerLaw(gamma, xmin, xmax)

Bases: object

Definition of a bounded power law distribution.

pdf ~ x^(-alpha) betweem xmin and xmax.

Thanks to H. Niederhausen (@HansN87) for this implementation.

cdf(x)

Evaluate the cumulative distribution function at x.

inv_cdf(x)

Evaluate the inverse cumulative distribution function at x.

pdf(x)

Evaluate the probability distribution function at x.

samples(nsamples)

Inverse CDF sample from the bounded power law distribution.

class icecube_tools.source.power_law.BrokenBoundedPowerLaw(x0, x1, x2, gamma1, gamma2)

Bases: object

Sampling from a broken power law.

Based on: https://github.com/grburgess/brokenpl_sample/blob/master/sample_broken_power_law.ipynb by J. M. Burgess (@grburgess).

samples(N)

Sample from the broken power law.

Parameters

N – number of samples.