BrokenPowerLawElectronDistribution#

class sunkit_spex.emission.BrokenPowerLawElectronDistribution(*, p, q, eelow, eebrk, eehigh, norm=True)[source]#

Bases: object

A broken or double power law electron flux distribution and integral.

This class is intended to be use with sunpy.emission.bremsstrahlung_thin_target and bremsstrahlung_thick_target.

Parameters:
  • p (float) – Power law index below the break energy ebrk

  • q (float) – Power law index below the break energy ebrk

  • eelow (float) – Low energy cutoff

  • eebrk (float) – Break energy

  • eehigh (float) – High energy cutoff

  • norm (bool (optional)) – True (default) distribution function is normalized so that the integral from eelow to eehigh is 1.

References

See SSW IDl functions brm2_distrn and brm2_f_distrn.

Examples

>>> import numpy as np
>>> from sunkit_spex.emission import BrokenPowerLawElectronDistribution
>>> electron_dist = BrokenPowerLawElectronDistribution(p=5,q=7, eelow=10, eebrk=150,
...                                                    eehigh=500)
>>> electron_dist
BrokenPowerLawElectronDistribution(p=5, q=7, eelow=10, eebrk=150, eehigh=500, norm=True)
>>> electron_dist.flux(np.array([15.0, 50.0, 100.0, 200.0, 500.0, 1000.0]))
array([5.26752445e-02, 1.28000844e-04, 4.00002638e-06, 7.03129636e-08,
       1.15200760e-10, 0.00000000e+00])
>>> electron_dist.density(np.array([15.0, 50.0, 100.0, 200.0, 500.0, 1000.0]))
array([1.97525573e-01, 1.59341654e-03, 9.34066538e-05, 2.33416539e-06,
       2.68419888e-22, 0.00000000e+00])

Methods Summary

density(electron_energy)

Return the electron flux at the given electron energies.

flux(electron_energy)

Calculate the electron spectrum at the given energies.

Methods Documentation

density(electron_energy)[source]#

Return the electron flux at the given electron energies.

Parameters:

electron_energy (numpy.array) – Electron energies

Returns:

The electron flux as a function of electron energy

Return type:

numpy.array

flux(electron_energy)[source]#

Calculate the electron spectrum at the given energies.

Parameters:

electron_energy (numpy.array) – Electron energies

Returns:

The electron spectrum as a function of electron energy

Return type:

numpy.array