Commit 164fba38 authored by Philipp Oleynik's avatar Philipp Oleynik
Browse files

Integral powerlaw behaves strange in analytic (fast) mode.

parent 1863b281
......@@ -153,6 +153,13 @@ def fold_spectrum(*, bin_width = None, spectrum = None, response = None):
def generate_powerlaw(*, energy_grid = None, power_index = -2, sp_norm = 1.0):
"""
:param energy_grid:
:param power_index:
:param sp_norm:
:return:
"""
spectrum = []
for energy in energy_grid:
spectrum.append(sp_norm * np.power(energy, power_index))
......@@ -161,6 +168,15 @@ def generate_powerlaw(*, energy_grid = None, power_index = -2, sp_norm = 1.0):
def generate_integral_powerlaw(*, energy_grid = None, grid_bin_width = None,
power_index = -2, sp_norm = 1.0, fast = False):
"""
:param energy_grid:
:param grid_bin_width:
:param power_index:
:param sp_norm:
:param fast:
:return:
"""
spectrum = [] # np.power(energy_grid[-1], power_index + 1) / (power_index + 1)
if fast:
for energy in energy_grid:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment