BrokenPowerLawElectronDistribution#
- class sunkit_spex.legacy.emission.BrokenPowerLawElectronDistribution(*, p, q, eelow, eebrk, eehigh, norm=True)[source]#
Bases:
objectA broken or double power law electron flux distribution and integral.
This class is intended to be use with
sunpy.emission.bremsstrahlung_thin_targetandbremsstrahlung_thick_target.- Parameters:
p (
float) – Power law index below the break energyebrkq (
float) – Power law index below the break energyebrkeelow (
float) – Low energy cutoffeebrk (
float) – Break energyeehigh (
float) – High energy cutoffnorm (
bool(optional)) – True (default) distribution function is normalized so that the integral fromeelowtoeehighis 1.
References
See SSW IDl functions brm2_distrn and brm2_f_distrn.
Examples
>>> import numpy as np >>> from sunkit_spex.legacy.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:
- 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: