Models¶
- Table models:
API¶
- class naima.models.Bremsstrahlung(particle_distribution, n0=<Quantity 1. 1 / cm3>, **kwargs)[source]¶
Bremsstrahlung radiation on a completely ionised gas.
This class uses the cross-section approximation of Baring, M.G., Ellison, D.C., Reynolds, S.P., Grenier, I.A., & Goret, P. 1999, Astrophysical Journal, 513, 311.
The default weights are assuming a completely ionised target gas with ISM abundances. If pure electron-electron bremsstrahlung is desired,
n0
can be set to the electron density,weight_ep
to 0 andweight_ee
to 1.- Parameters
- n0
Quantity
float Total ion number density.
- n0
- Other Parameters
- weight_eefloat
Weight of electron-electron bremsstrahlung. Defined as \(\sum_i Z_i X_i\), default is 1.088.
- weight_epfloat
Weight of electron-proton bremsstrahlung. Defined as \(\sum_i Z_i^2 X_i\), default is 1.263.
- property We¶
Total energy in electrons used for the radiative calculation
- compute_We(Eemin=None, Eemax=None)¶
Total energy in electrons between energies Eemin and Eemax
- flux(energy, *args, **kwargs)¶
Differential flux at a given distance from the source.
- sed(photon_energy, distance=<Quantity 1. kpc>)¶
Spectral energy distribution at a given distance from the source.
- set_We(We, Eemin=None, Eemax=None, amplitude_name=None)¶
Normalize particle distribution so that the total energy in electrons between Eemin and Eemax is We
- Parameters
- We
Quantity
float Desired energy in electrons.
- Eemin
Quantity
float, optional Minimum electron energy for energy content calculation.
- Eemax
Quantity
float, optional Maximum electron energy for energy content calculation.
- amplitude_namestr, optional
Name of the amplitude parameter of the particle distribution. It must be accesible as an attribute of the distribution function. Defaults to
amplitude
.
- We
- class naima.models.BrokenPowerLaw(amplitude, e_0, e_break, alpha_1, alpha_2)[source]¶
One dimensional power law model with a break.
- Parameters
See also
Notes
Model formula (with \(A\) for
amplitude
, \(E_0\) fore_0
, \(\alpha_1\) foralpha_1
and \(\alpha_2\) foralpha_2
):\[\begin{split}f(E) = \left \{ \begin{array}{ll} A (E / E_0) ^ {-\alpha_1} & : E < E_{break} \\ A (E_{break}/E_0) ^ {\alpha_2-\alpha_1} (E / E_0) ^ {-\alpha_2} & : E > E_{break} \\ \end{array} \right.\end{split}\]
- class naima.models.EblAbsorptionModel(redshift, ebl_absorption_model='Dominguez')[source]¶
A TableModel containing the different absorption values from a specific model.
It returns dimensionless opacity values, that could be multiplied to any model.
- Parameters
- redshiftfloat
Redshift considered for the absorption evaluation.
- ebl_absorption_model{‘Dominguez’}
Name of the EBL absorption model to use (Dominguez by default).
See also
Notes
Dominguez model refers to the Dominguez 2011 EBL model. Current implementation does NOT perform an interpolation in the redshift, so it just uses the closest z value from the finely binned tau_dominguez11.npz file (delta_z=0.01).
- class naima.models.ExponentialCutoffBrokenPowerLaw(amplitude, e_0, e_break, alpha_1, alpha_2, e_cutoff, beta=1.0)[source]¶
One dimensional power law model with a break.
- Parameters
- amplitudefloat
Model amplitude at the break point
- e_0
Quantity
float Reference point
- e_break
Quantity
float Break energy
- alpha_1float
Power law index for x < x_break
- alpha_2float
Power law index for x > x_break
- e_cutoff
Quantity
float Exponential Cutoff energy
- betafloat, optional
Exponential cutoff rapidity. Default is 1.
See also
Notes
Model formula (with \(A\) for
amplitude
, \(E_0\) fore_0
, \(\alpha_1\) foralpha_1
, \(\alpha_2\) foralpha_2
, \(E_{cutoff}\) fore_cutoff
, and \(\beta\) forbeta
):\[\begin{split}f(E) = \exp(-(E / E_{cutoff})^\beta)\left \{ \begin{array}{ll} A (E / E_0) ^ {-\alpha_1} & : E < E_{break} \\ A (E_{break}/E_0) ^ {\alpha_2-\alpha_1} (E / E_0) ^ {-\alpha_2} & : E > E_{break} \\ \end{array} \right.\end{split}\]
- class naima.models.ExponentialCutoffPowerLaw(amplitude, e_0, alpha, e_cutoff, beta=1.0)[source]¶
One dimensional power law model with an exponential cutoff.
- Parameters
See also
Notes
Model formula (with \(A\) for
amplitude
, \(\alpha\) foralpha
, and \(\beta\) forbeta
):\[f(E) = A (E / E_0) ^ {-\alpha} \exp (- (E / E_{cutoff}) ^ \beta)\]
- class naima.models.InverseCompton(particle_distribution, seed_photon_fields=['CMB'], **kwargs)[source]¶
Inverse Compton emission from an electron population.
If you use this class in your research, please consult and cite Khangulyan, D., Aharonian, F.A., & Kelner, S.R. 2014, Astrophysical Journal, 783, 100
- Parameters
- particle_distributionfunction
Particle distribution function, taking electron energies as a
Quantity
array or float, and returning the particle energy density in units of number of electrons per unit energy as aQuantity
array or float.- seed_photon_fieldsstring or iterable of strings (optional)
A list of gray-body or non-thermal seed photon fields to use for IC calculation. Each of the items of the iterable can be either:
A string equal to
CMB
(default),NIR
, orFIR
, for which radiation fields with temperatures of 2.72 K, 30 K, and 3000 K, and energy densities of 0.261, 0.5, and 1 eV/cm³ will be used (these are the GALPROP values for a location at a distance of 6.5 kpc from the galactic center).A list of length three (isotropic source) or four (anisotropic source) composed of:
A name for the seed photon field.
Its temperature (thermal source) or energy (monochromatic or non-thermal source) as a
Quantity
instance.Its photon field energy density as a
Quantity
instance.Optional: The angle between the seed photon direction and the scattered photon direction as a
Quantity
float instance.
- Other Parameters
- Eemin
Quantity
float instance, optional Minimum electron energy for the electron distribution. Default is 1 GeV.
- Eemax
Quantity
float instance, optional Maximum electron energy for the electron distribution. Default is 510 TeV.
- nEedscalar
Number of points per decade in energy for the electron energy and distribution arrays. Default is 300.
- Eemin
- property We¶
Total energy in electrons used for the radiative calculation
- compute_We(Eemin=None, Eemax=None)¶
Total energy in electrons between energies Eemin and Eemax
- flux(photon_energy, distance=<Quantity 1. kpc>, seed=None)[source]¶
Differential flux at a given distance from the source from a single seed photon field
- Parameters
- photon_energy
Quantity
float or array Photon energy array.
- distance
Quantity
float, optional Distance to the source. If set to 0, the intrinsic luminosity will be returned. Default is 1 kpc.
- seedint, str or None
Number or name of seed photon field for which the IC contribution is required. If set to None it will return the sum of all contributions (default).
- photon_energy
- sed(photon_energy, distance=<Quantity 1. kpc>, seed=None)[source]¶
Spectral energy distribution at a given distance from the source
- Parameters
- photon_energy
Quantity
float or array Photon energy array.
- distance
Quantity
float, optional Distance to the source. If set to 0, the intrinsic luminosity will be returned. Default is 1 kpc.
- seedint, str or None
Number or name of seed photon field for which the IC contribution is required. If set to None it will return the sum of all contributions (default).
- photon_energy
- set_We(We, Eemin=None, Eemax=None, amplitude_name=None)¶
Normalize particle distribution so that the total energy in electrons between Eemin and Eemax is We
- Parameters
- We
Quantity
float Desired energy in electrons.
- Eemin
Quantity
float, optional Minimum electron energy for energy content calculation.
- Eemax
Quantity
float, optional Maximum electron energy for energy content calculation.
- amplitude_namestr, optional
Name of the amplitude parameter of the particle distribution. It must be accesible as an attribute of the distribution function. Defaults to
amplitude
.
- We
- class naima.models.LogParabola(amplitude, e_0, alpha, beta)[source]¶
One dimensional log parabola model (sometimes called curved power law).
- Parameters
- amplitudefloat
Model amplitude
- e_0
Quantity
float Reference point
- alphafloat
Power law index
- betafloat
Power law curvature
See also
Notes
Model formula (with \(A\) for
amplitude
and \(\alpha\) foralpha
and \(\beta\) forbeta
):\[f(e) = A \left(\frac{E}{E_{0}}\right)^ {- \alpha - \beta \log{\left (\frac{E}{E_{0}} \right )}}\]
- class naima.models.PionDecay(particle_distribution, nh=<Quantity 1. 1 / cm3>, nuclear_enhancement=True, **kwargs)[source]¶
Pion decay gamma-ray emission from a proton population.
Compute gamma-ray spectrum arising from the interaction of a relativistic proton distribution with stationary target protons using the parametrization of Kafexhiu et al. (2014).
If you use this class in your research, please consult and cite Kafexhiu, E., Aharonian, F., Taylor, A.M., & Vila, G.S. 2014, Physical Review D, 90, 123014.
- Parameters
- particle_distributionfunction
Particle distribution function, taking proton energies as a
Quantity
array or float, and returning the particle energy density in units of number of protons per unit energy as aQuantity
array or float.- nh
Quantity
Number density of the target protons. Default is \(1 \mathrm{cm}^{-3}\).
- nuclear_enhancementbool
Whether to apply the energy-dependent nuclear enhancement factor considering a target gas with local ISM abundances. See Section IV of Kafexhiu et al. (2014) for details. Here the proton-nucleus inelastic cross section of Sihver et al. (1993, PhysRevC 47, 1225) is used.
- Other Parameters
- Epmin
Quantity
float Minimum proton energy for the proton distribution. Default is 1.22 GeV, the dynamical threshold for pion production in pp interactions.
- Epmax
Quantity
float Minimum proton energy for the proton distribution. Default is 10 PeV.
- nEpdscalar
Number of points per decade in energy for the proton energy and distribution arrays. Default is 100.
- hiEmodelstr
Monte Carlo model to use for computation of high-energy differential cross section. Can be one of
Geant4
,Pythia8
,SIBYLL
, orQGSJET
. See Kafexhiu et al. (2014) for details. Default isPythia8
.- useLUTbool
Whether to use a lookup table for the differential cross section. The only lookup table packaged with naima is for the Pythia 8 model and ISM nuclear enhancement factor.
- Epmin
- property Wp¶
Total energy in protons
- compute_Wp(Epmin=None, Epmax=None)¶
Total energy in protons between energies Epmin and Epmax
- flux(energy, *args, **kwargs)¶
Differential flux at a given distance from the source.
- sed(photon_energy, distance=<Quantity 1. kpc>)¶
Spectral energy distribution at a given distance from the source.
- set_Wp(Wp, Epmin=None, Epmax=None, amplitude_name=None)¶
Normalize particle distribution so that the total energy in protons between Epmin and Epmax is Wp
- Parameters
- Wp
Quantity
float Desired energy in protons.
- Epmin
Quantity
float, optional Minimum proton energy for energy content calculation.
- Epmax
Quantity
float, optional Maximum proton energy for energy content calculation.
- amplitude_namestr, optional
Name of the amplitude parameter of the particle distribution. It must be accesible as an attribute of the distribution function. Defaults to
amplitude
.
- Wp
- class naima.models.PowerLaw(amplitude, e_0, alpha)[source]¶
One dimensional power law model.
- Parameters
- amplitudefloat
Model amplitude.
- e_0
Quantity
float Reference energy
- alphafloat
Power law index
See also
Notes
Model formula (with \(A\) for
amplitude
, \(\alpha\) foralpha
):\[f(E) = A (E / E_0) ^ {-\alpha}\]
- class naima.models.Synchrotron(particle_distribution, B=<Quantity 3.24e-06 G>, **kwargs)[source]¶
Synchrotron emission from an electron population.
This class uses the approximation of the synchrotron emissivity in a random magnetic field of Aharonian, Kelner, and Prosekin 2010, PhysRev D 82, 3002 (arXiv:1006.1045).
- Parameters
- particle_distributionfunction
Particle distribution function, taking electron energies as a
Quantity
array or float, and returning the particle energy density in units of number of electrons per unit energy as aQuantity
array or float.- B
Quantity
float instance, optional Isotropic magnetic field strength. Default: equipartition with CMB (3.24e-6 G)
- Other Parameters
- Eemin
Quantity
float instance, optional Minimum electron energy for the electron distribution. Default is 1 GeV.
- Eemax
Quantity
float instance, optional Maximum electron energy for the electron distribution. Default is 510 TeV.
- nEedscalar
Number of points per decade in energy for the electron energy and distribution arrays. Default is 100.
- Eemin
- property We¶
Total energy in electrons used for the radiative calculation
- compute_We(Eemin=None, Eemax=None)¶
Total energy in electrons between energies Eemin and Eemax
- flux(energy, *args, **kwargs)¶
Differential flux at a given distance from the source.
- sed(photon_energy, distance=<Quantity 1. kpc>)¶
Spectral energy distribution at a given distance from the source.
- set_We(We, Eemin=None, Eemax=None, amplitude_name=None)¶
Normalize particle distribution so that the total energy in electrons between Eemin and Eemax is We
- Parameters
- We
Quantity
float Desired energy in electrons.
- Eemin
Quantity
float, optional Minimum electron energy for energy content calculation.
- Eemax
Quantity
float, optional Maximum electron energy for energy content calculation.
- amplitude_namestr, optional
Name of the amplitude parameter of the particle distribution. It must be accesible as an attribute of the distribution function. Defaults to
amplitude
.
- We
- class naima.models.TableModel(energy, values, amplitude=1)[source]¶
A model generated from a table of energy and value arrays.
The units returned will be the units of the values array provided at initialization. The model will return values interpolated in log-space, returning 0 for energies outside of the limits of the provided energy array.
- Parameters
- energy
Quantity
array Array of energies at which the model values are given
- valuesarray
Array with the values of the model at energies
energy
.- amplitudefloat
Model amplitude that is multiplied to the supplied arrays. Defaults to 1.
- energy