compute_broken_power_law#

sunkit_spex.photon_power_law.compute_broken_power_law(energy_edges: Unit('keV'), norm_energy: Unit('keV'), norm_flux: Unit('ph / (keV s cm2)'), break_energy: Unit('keV'), lower_index: Unit(dimensionless), upper_index: Unit(dimensionless))[source]#

Analytically evaluate a photon-space broken power law and bin the flux.

The broken power law is assumed to take the following form,

\[\begin{split}f(E \le E_b) = N_1 \left( \frac{E}{E_0} \right)^{-\gamma_1} \\ f(E > E_b) = N_2 \left( \frac{E}{E_0} \right)^{-\gamma_2}\end{split}\]

where \(E\) is the energy, \(N_1\) and \(N_2\) are the normalizations below and above the break, \(E_0\) is the normalization energy, \(E_b\) is the break energy, and \(\gamma_1\) and \(\gamma_2\) are the upper and lower power law indices.

Only one normalization flux and energy are given. Continuity is enforced at the break energy so that the normalization is correct at the chosen energy.

The values of \(\gamma_1\) and \(\gamma_2\) are assumed to be positive, but the functional form includes negative signs.

Parameters:
  • energy_edges (astropy.units.Quantity) – 1D array of energy edges defining the energy bins.

  • norm_energy (astropy.units.Quantity) – Energy at which the normalization is applied, i.e. \(E_0\).

  • norm_flux (astropy.units.Quantity) – Normalization flux for the photon power law. The norm_flux corresponds to either \(N_1\) or \(N_2\) depending on if the energy is below or above the break.

  • break_energy (astropy.units.Quantity) – Break energy of the broken power law. The energy bin containing the break energy will be a combination of the lower and upper power laws.

  • lower_index (astropy.units.Quantity) – Lower power law index.

  • upper_index (astropy.units.Quantity) – Upper power law index.

Returns:

Photon broken power law, where the flux in each energy bin is equal to the broken power law analytically averaged over each bin.

Return type:

astropy.units.Quantity