icecube_tools.utils.bpl_sampling module

icecube_tools.utils.bpl_sampling.bpl(x, x0, x1, x2, a1, a2)

Evaluate broken power law :param x: Points at which to evaluate :param x0: Lower limit :param x1: Break :param x2: Upper limit :param a1: Lower index :param a2: Upper index :return: Evaluated power law, casts to np.ndarray

icecube_tools.utils.bpl_sampling.integrate_pl(x0, x1, x2, a1, a2)

Integrate a broken power law. :param x0: Lower limit :param x1: Break :param x2: Upper limit :param a1: Lower index :param a2: Upper index :return: relative weights of each part (below and above the break) and total integral

icecube_tools.utils.bpl_sampling.sample_bpl(u, x0, x1, x2, a1, a2)
Parameters:
  • u – Uniform samples $el [0, 1]$

  • x0 – Lower limit

  • x1 – Break

  • x2 – Upper limit

  • a1 – Lower index

  • a2 – Upper index