elisa.models.add#

Additive models.

class Band(alpha: 'Parameter' | float | None = None, beta: 'Parameter' | float | None = None, Ec: 'Parameter' | float | None = None, K: 'Parameter' | float | None = None, latex: str | None = None, method=None)[source]#

Bases: NumIntAdditive

Gamma-ray burst continuum developed by Band et al. (1993) [1].

\[\begin{split}N(E) = K \begin{cases} \bigl(\frac{E}{E_0}\bigr)^\alpha \exp\bigl(-\frac{E}{E_\mathrm{c}}\bigr), &\text{if } E < (\alpha-\beta) E_\mathrm{c}, \\\\ \bigl(\frac{E}{E_0}\bigr)^\beta \exp(\beta-\alpha) \left[ \frac{(\alpha-\beta)E_\mathrm{c}}{E_0} \right]^{\alpha-\beta}, &\text{otherwise,} \end{cases}\end{split}\]

where \(E_0\) is the reference energy fixed at 100 keV.

Parameters:
  • alpha (Parameter, optional) – The low-energy power law index \(\alpha\), dimensionless.

  • beta (Parameter, optional) – The high-energy power law index \(\beta\), dimensionless.

  • Ec (Parameter, optional) – The characteristic energy \(E_\mathrm{c}\), in units of keV.

  • K (Parameter, optional) – The amplitude \(K\), in units of ph cm⁻² s⁻¹ keV⁻¹.

  • latex (str, optional) – \(\LaTeX\) format of the component. Defaults to class name.

  • method ({'trapz', 'simpson'}, optional) – Numerical integration method. Defaults to ‘trapz’.

Attributes

Ec

Band parameter \(E_\mathrm{c}\).

K

Band parameter \(K\).

alpha

Band parameter \(\alpha\).

beta

Band parameter \(\beta\).

eval

Get side-effect free component evaluation function.

latex

\(\LaTeX\) format of the component.

method

Numerical integration method.

name

Component name.

param_names

Component's parameter names.

type

Component type is additive.

Methods

continuum(egrid, params)

Calculate the photon flux at the energy grid.

References

static continuum(egrid: JAXArray, params: NameValMapping) JAXArray[source]#

Calculate the photon flux at the energy grid.

Parameters:
  • egrid (Array) – Photon energy grid in units of keV.

  • params (dict[str, Array]) – Parameter dict for the model.

Returns:

The photon flux at egrid, in units of ph cm⁻² s⁻¹ keV⁻¹.

property Ec: Parameter#

Band parameter \(E_\mathrm{c}\).

property K: Parameter#

Band parameter \(K\).

property alpha: Parameter#

Band parameter \(\alpha\).

property beta: Parameter#

Band parameter \(\beta\).

class BandEp(alpha: 'Parameter' | float | None = None, beta: 'Parameter' | float | None = None, Ep: 'Parameter' | float | None = None, K: 'Parameter' | float | None = None, latex: str | None = None, method=None)[source]#

Bases: NumIntAdditive

Gamma-ray burst continuum developed by Band et al. (1993) [1], parametrized by the peak of \(\nu F_\nu\).

\[\begin{split}N(E) = K \begin{cases} \bigl(\frac{E}{E_0}\bigr)^\alpha \exp\left[-\frac{(2+\alpha)E}{E_\mathrm{p}}\right], &\text{if } E < \frac{(\alpha-\beta)E_\mathrm{p}}{2+\alpha}, \\\\ \bigl(\frac{E}{E_0}\bigr)^\beta \exp(\beta-\alpha) \left[ \frac{(\alpha-\beta)E_\mathrm{p}}{(2+\alpha)E_0} \right]^{\alpha-\beta}, &\text{otherwise}, \end{cases}\end{split}\]

where \(E_0\) is the reference energy fixed at 100 keV.

Warning

This model requires the low-energy power law index \(\alpha\) to be greater than -2.0.

Parameters:
  • alpha (Parameter, optional) – The low-energy power law index \(\alpha\), dimensionless.

  • beta (Parameter, optional) – The high-energy power law index \(\beta\), dimensionless.

  • Ep (Parameter, optional) – The peak energy \(E_\mathrm{p}\) of \(\nu F_\nu\), in units of keV.

  • K (Parameter, optional) – The amplitude \(K\), in units of ph cm⁻² s⁻¹ keV⁻¹.

  • latex (str, optional) – \(\LaTeX\) format of the component. Defaults to class name.

  • method ({'trapz', 'simpson'}, optional) – Numerical integration method. Defaults to ‘trapz’.

Attributes

Ep

BandEp parameter \(E_\mathrm{p}\).

K

BandEp parameter \(K\).

alpha

BandEp parameter \(\alpha\).

beta

BandEp parameter \(\beta\).

eval

Get side-effect free component evaluation function.

latex

\(\LaTeX\) format of the component.

method

Numerical integration method.

name

Component name.

param_names

Component's parameter names.

type

Component type is additive.

Methods

continuum(egrid, params)

Calculate the photon flux at the energy grid.

References

static continuum(egrid: Array, params: dict[str, Array]) Array[source]#

Calculate the photon flux at the energy grid.

Parameters:
  • egrid (Array) – Photon energy grid in units of keV.

  • params (dict[str, Array]) – Parameter dict for the model.

Returns:

The photon flux at egrid, in units of ph cm⁻² s⁻¹ keV⁻¹.

property Ep: Parameter#

BandEp parameter \(E_\mathrm{p}\).

property K: Parameter#

BandEp parameter \(K\).

property alpha: Parameter#

BandEp parameter \(\alpha\).

property beta: Parameter#

BandEp parameter \(\beta\).

class BentPL(alpha: 'Parameter' | float | None = None, Eb: 'Parameter' | float | None = None, K: 'Parameter' | float | None = None, latex: str | None = None, method=None)[source]#

Bases: NumIntAdditive

Bent power law.

\[N(E) = 2K \left[ 1 + \left(\frac{E}{E_\mathrm{b}}\right)^\alpha \right]^{-1}\]
Parameters:
  • alpha (Parameter, optional) – The power law photon index \(\alpha\), dimensionless.

  • Eb (Parameter, optional) – The break energy \(E_\mathrm{b}\), in units of keV.

  • K (Parameter, optional) – The amplitude \(K\), in units of ph cm⁻² s⁻¹ keV⁻¹.

  • latex (str, optional) – \(\LaTeX\) format of the component. Defaults to class name.

  • method ({'trapz', 'simpson'}, optional) – Numerical integration method. Defaults to ‘trapz’.

Attributes

Eb

BentPL parameter \(E_\mathrm{b}\).

K

BentPL parameter \(K\).

alpha

BentPL parameter \(alpha\).

eval

Get side-effect free component evaluation function.

latex

\(\LaTeX\) format of the component.

method

Numerical integration method.

name

Component name.

param_names

Component's parameter names.

type

Component type is additive.

Methods

continuum(egrid, params)

Calculate the photon flux at the energy grid.

static continuum(egrid: Array, params: dict[str, Array]) Array[source]#

Calculate the photon flux at the energy grid.

Parameters:
  • egrid (Array) – Photon energy grid in units of keV.

  • params (dict[str, Array]) – Parameter dict for the model.

Returns:

The photon flux at egrid, in units of ph cm⁻² s⁻¹ keV⁻¹.

property Eb: Parameter#

BentPL parameter \(E_\mathrm{b}\).

property K: Parameter#

BentPL parameter \(K\).

property alpha: Parameter#

BentPL parameter \(alpha\).

class Blackbody(kT: 'Parameter' | float | None = None, K: 'Parameter' | float | None = None, latex: str | None = None, method=None)[source]#

Bases: NumIntAdditive

Blackbody function.

\[N(E) = \frac{C K E^2}{(kT)^4 [\exp(E/kT)-1]},\]

where \(C=8.0525\) ph.

Parameters:
  • kT (Parameter, optional) – The temperature \(kT\), in units of keV.

  • K (Parameter, optional) – The amplitude \(K = L_{39}/D_{10}^2\), where \(L_{39}\) is the source luminosity in units of 10³⁹ erg s⁻¹ and \(D_{10}\) is the distance to the source in units of 10 kpc.

  • latex (str, optional) – \(\LaTeX\) format of the component. Defaults to class name.

  • method ({'trapz', 'simpson'}, optional) – Numerical integration method. Defaults to ‘trapz’.

Attributes

K

Blackbody parameter \(K\).

eval

Get side-effect free component evaluation function.

kT

Blackbody parameter \(kT\).

latex

\(\LaTeX\) format of the component.

method

Numerical integration method.

name

Component name.

param_names

Component's parameter names.

type

Component type is additive.

Methods

continuum(egrid, params)

Calculate the photon flux at the energy grid.

static continuum(egrid: Array, params: dict[str, Array]) Array[source]#

Calculate the photon flux at the energy grid.

Parameters:
  • egrid (Array) – Photon energy grid in units of keV.

  • params (dict[str, Array]) – Parameter dict for the model.

Returns:

The photon flux at egrid, in units of ph cm⁻² s⁻¹ keV⁻¹.

property K: Parameter#

Blackbody parameter \(K\).

property kT: Parameter#

Blackbody parameter \(kT\).

class BlackbodyRad(kT: 'Parameter' | float | None = None, K: 'Parameter' | float | None = None, latex: str | None = None, method=None)[source]#

Bases: NumIntAdditive

Blackbody function with normalization proportional to the surface area.

\[N(E) = \frac{C K E^2}{\exp(E/kT)-1},\]

where \(C=1.0344 \times 10^{-3}\) ph cm⁻² s⁻¹ keV⁻³.

Parameters:
  • kT (Parameter, optional) – The temperature \(kT\), in units of keV.

  • K (Parameter, optional) – The amplitude \(K = R_\mathrm{km}^2/D_{10}^2\), where \(R_\mathrm{km}\) is the source radius in km and \(D_{10}\) is the distance to the source in units of 10 kpc.

  • latex (str, optional) – \(\LaTeX\) format of the component. Defaults to class name.

  • method ({'trapz', 'simpson'}, optional) – Numerical integration method. Defaults to ‘trapz’.

Attributes

K

BlackbodyRad parameter \(K\).

eval

Get side-effect free component evaluation function.

kT

BlackbodyRad parameter \(kT\).

latex

\(\LaTeX\) format of the component.

method

Numerical integration method.

name

Component name.

param_names

Component's parameter names.

type

Component type is additive.

Methods

continuum(egrid, params)

Calculate the photon flux at the energy grid.

static continuum(egrid: Array, params: dict[str, Array]) Array[source]#

Calculate the photon flux at the energy grid.

Parameters:
  • egrid (Array) – Photon energy grid in units of keV.

  • params (dict[str, Array]) – Parameter dict for the model.

Returns:

The photon flux at egrid, in units of ph cm⁻² s⁻¹ keV⁻¹.

property K: Parameter#

BlackbodyRad parameter \(K\).

property kT: Parameter#

BlackbodyRad parameter \(kT\).

class BrokenPL(alpha1: 'Parameter' | float | None = None, Eb: 'Parameter' | float | None = None, alpha2: 'Parameter' | float | None = None, K: 'Parameter' | float | None = None, latex: str | None = None)[source]#

Bases: AnaIntAdditive

Broken power law.

\[\begin{split}N(E) = K \begin{cases} \left(\frac{E}{E_\mathrm{b}}\right)^{-\alpha_1}, &\text{if } E \le E_\mathrm{b}, \\\\ \left(\frac{E}{E_\mathrm{b}}\right)^{-\alpha_2}, &\text{otherwise}. \end{cases}\end{split}\]
Parameters:
  • alpha1 (Parameter, optional) – The low-energy power law photon index \(\alpha_1\), dimensionless.

  • alpha2 (Parameter, optional) – The high-energy power law photon index \(\alpha_2\), dimensionless.

  • Eb (Parameter, optional) – The break energy \(E_\mathrm{b}\), in units of keV.

  • K (Parameter, optional) – The amplitude \(K\), in units of ph cm⁻² s⁻¹ keV⁻¹.

  • latex (str, optional) – \(\LaTeX\) format of the component. Defaults to class name.

  • method ({'trapz', 'simpson'}, optional) – Numerical integration method. Defaults to ‘trapz’.

Attributes

Eb

BrokenPL parameter \(E_\mathrm{b}\).

K

BrokenPL parameter \(K\).

alpha1

BrokenPL parameter \(alpha_1\).

alpha2

BrokenPL parameter \(alpha_2\).

eval

Get side-effect free component evaluation function.

latex

\(\LaTeX\) format of the component.

name

Component name.

param_names

Component's parameter names.

type

Component type is additive.

Methods

integral(egrid, params)

Calculate the photon flux integrated over the energy grid.

static integral(egrid: Array, params: dict[str, Array]) Array[source]#

Calculate the photon flux integrated over the energy grid.

Parameters:
  • egrid (Array) – Photon energy grid in units of keV.

  • params (dict[str, Array]) – Parameter dict for the model.

Returns:

The photon flux integrated over egrid, in units of ph cm⁻² s⁻¹.

property Eb: Parameter#

BrokenPL parameter \(E_\mathrm{b}\).

property K: Parameter#

BrokenPL parameter \(K\).

property alpha1: Parameter#

BrokenPL parameter \(alpha_1\).

property alpha2: Parameter#

BrokenPL parameter \(alpha_2\).

class Compt(alpha: 'Parameter' | float | None = None, Ep: 'Parameter' | float | None = None, K: 'Parameter' | float | None = None, latex: str | None = None, method=None)[source]#

Bases: NumIntAdditive

Power law with high-energy exponential cutoff, parametrized by the peak of \(\nu F_\nu\).

\[N(E) = K \left(\frac{E}{E_0}\right)^{-\alpha} \exp \left[-\frac{(2-\alpha)E}{E_\mathrm{p}}\right],\]

where \(E_0\) is the reference energy fixed at 1 keV.

Parameters:
  • alpha (Parameter, optional) – The power law photon index \(\alpha\), dimensionless.

  • Ep (Parameter, optional) – The peak energy \(E_\mathrm{p}\) of \(\nu F_\nu\), in units of keV.

  • K (Parameter, optional) – The amplitude \(K\), in units of ph cm⁻² s⁻¹ keV⁻¹.

  • latex (str, optional) – \(\LaTeX\) format of the component. Defaults to class name.

  • method ({'trapz', 'simpson'}, optional) – Numerical integration method. Defaults to ‘trapz’.

Attributes

Ep

Compt parameter \(E_\mathrm{p}\).

K

Compt parameter \(K\).

alpha

Compt parameter \(\alpha\).

eval

Get side-effect free component evaluation function.

latex

\(\LaTeX\) format of the component.

method

Numerical integration method.

name

Component name.

param_names

Component's parameter names.

type

Component type is additive.

Methods

continuum(egrid, params)

Calculate the photon flux at the energy grid.

static continuum(egrid: Array, params: dict[str, Array]) Array[source]#

Calculate the photon flux at the energy grid.

Parameters:
  • egrid (Array) – Photon energy grid in units of keV.

  • params (dict[str, Array]) – Parameter dict for the model.

Returns:

The photon flux at egrid, in units of ph cm⁻² s⁻¹ keV⁻¹.

property Ep: Parameter#

Compt parameter \(E_\mathrm{p}\).

property K: Parameter#

Compt parameter \(K\).

property alpha: Parameter#

Compt parameter \(\alpha\).

class CutoffPL(alpha: 'Parameter' | float | None = None, Ec: 'Parameter' | float | None = None, K: 'Parameter' | float | None = None, latex: str | None = None, method=None)[source]#

Bases: NumIntAdditive

Power law with high-energy exponential cutoff.

\[N(E) = K \left(\frac{E}{E_0}\right)^{-\alpha} \exp \left(-\frac{E}{E_\mathrm{c}}\right),\]

where \(E_0\) is the reference energy fixed at 1 keV.

Parameters:
  • alpha (Parameter, optional) – The power law photon index \(\alpha\), dimensionless.

  • Ec (Parameter, optional) – The e-folding energy of exponential cutoff \(E_\mathrm{c}\), in units of keV.

  • K (Parameter, optional) – The amplitude \(K\), in units of ph cm⁻² s⁻¹ keV⁻¹.

  • latex (str, optional) – \(\LaTeX\) format of the component. Defaults to class name.

  • method ({'trapz', 'simpson'}, optional) – Numerical integration method. Defaults to ‘trapz’.

Attributes

Ec

CutoffPL parameter \(E_\mathrm{c}\).

K

CutoffPL parameter \(K\).

alpha

CutoffPL parameter \(\alpha\).

eval

Get side-effect free component evaluation function.

latex

\(\LaTeX\) format of the component.

method

Numerical integration method.

name

Component name.

param_names

Component's parameter names.

type

Component type is additive.

Methods

continuum(egrid, params)

Calculate the photon flux at the energy grid.

static continuum(egrid: Array, params: dict[str, Array]) Array[source]#

Calculate the photon flux at the energy grid.

Parameters:
  • egrid (Array) – Photon energy grid in units of keV.

  • params (dict[str, Array]) – Parameter dict for the model.

Returns:

The photon flux at egrid, in units of ph cm⁻² s⁻¹ keV⁻¹.

property Ec: Parameter#

CutoffPL parameter \(E_\mathrm{c}\).

property K: Parameter#

CutoffPL parameter \(K\).

property alpha: Parameter#

CutoffPL parameter \(\alpha\).

class Gauss(El: 'Parameter' | float | None = None, sigma: 'Parameter' | float | None = None, K: 'Parameter' | float | None = None, latex: str | None = None, method=None)[source]#

Bases: NumIntAdditive

Gaussian line profile.

\[N(E) = \frac{K}{\sqrt{2\pi} \sigma} \exp\left[ -\frac{\left(E - E_\mathrm{l}\right)^2}{2 \sigma^2} \right].\]
Parameters:
  • El (Parameter, optional) – The line energy \(E_\mathrm{l}\), in units of keV.

  • sigma (Parameter, optional) – The line width \(\sigma\), in units of keV.

  • K (Parameter, optional) – The total photon flux \(K\) of the line, in units of ph cm⁻² s⁻¹.

  • latex (str, optional) – \(\LaTeX\) format of the component. Defaults to class name.

  • method ({'trapz', 'simpson'}, optional) – Numerical integration method. Defaults to ‘trapz’.

Attributes

El

Gauss parameter \(E_\mathrm{l}\).

K

Gauss parameter \(K\).

eval

Get side-effect free component evaluation function.

latex

\(\LaTeX\) format of the component.

method

Numerical integration method.

name

Component name.

param_names

Component's parameter names.

sigma

Gauss parameter \(\sigma\).

type

Component type is additive.

Methods

continuum(egrid, params)

Calculate the photon flux at the energy grid.

static continuum(egrid: Array, params: dict[str, Array]) Array[source]#

Calculate the photon flux at the energy grid.

Parameters:
  • egrid (Array) – Photon energy grid in units of keV.

  • params (dict[str, Array]) – Parameter dict for the model.

Returns:

The photon flux at egrid, in units of ph cm⁻² s⁻¹ keV⁻¹.

property El: Parameter#

Gauss parameter \(E_\mathrm{l}\).

property K: Parameter#

Gauss parameter \(K\).

property sigma: Parameter#

Gauss parameter \(\sigma\).

class Lorentz(El: 'Parameter' | float | None = None, sigma: 'Parameter' | float | None = None, K: 'Parameter' | float | None = None, latex: str | None = None)[source]#

Bases: AnaIntAdditive

Lorentzian line profile.

\[N(E) = \frac{K/\mathcal{F}}{(E - E_\mathrm{l})^2 + (\sigma/2)^2},\]

where

\[\mathcal{F}=\int_0^{+\infty} \frac{1}{(E - E_\mathrm{l})^2 + (\sigma/2)^2} \ \mathrm{d}E.\]
Parameters:
  • El (Parameter, optional) – The line energy \(E_\mathrm{l}\), in units of keV.

  • sigma (Parameter, optional) – The FWHM line width \(\sigma\), in units of keV.

  • K (Parameter, optional) – The total photon flux \(K\) of the line, in units of ph cm⁻² s⁻¹.

  • latex (str, optional) – \(\LaTeX\) format of the component. Defaults to class name.

Attributes

El

Lorentz parameter \(E_\mathrm{l}\).

K

Lorentz parameter \(K\).

eval

Get side-effect free component evaluation function.

latex

\(\LaTeX\) format of the component.

name

Component name.

param_names

Component's parameter names.

sigma

Lorentz parameter \(\sigma\).

type

Component type is additive.

Methods

integral(egrid, params)

Calculate the photon flux integrated over the energy grid.

static integral(egrid: Array, params: dict[str, Array]) Array[source]#

Calculate the photon flux integrated over the energy grid.

Parameters:
  • egrid (Array) – Photon energy grid in units of keV.

  • params (dict[str, Array]) – Parameter dict for the model.

Returns:

The photon flux integrated over egrid, in units of ph cm⁻² s⁻¹.

property El: Parameter#

Lorentz parameter \(E_\mathrm{l}\).

property K: Parameter#

Lorentz parameter \(K\).

property sigma: Parameter#

Lorentz parameter \(\sigma\).

class OTTB(kT: 'Parameter' | float | None = None, K: 'Parameter' | float | None = None, latex: str | None = None, method=None)[source]#

Bases: NumIntAdditive

Optically-thin thermal bremsstrahlung.

\[N(E) = K \left(\frac{E}{E_0}\right)^{-1} \exp\left(-\frac{E}{kT}\right) \exp\left(\frac{E_0}{kT}\right),\]

where \(E_0\) is the reference energy fixed at 1 keV.

Parameters:
  • kT (Parameter, optional) – The electron energy \(kT\), in units of keV.

  • K (Parameter, optional) – The amplitude \(K\), in units of ph cm⁻² s⁻¹ keV⁻¹.

  • latex (str, optional) – \(\LaTeX\) format of the component. Defaults to class name.

  • method ({'trapz', 'simpson'}, optional) – Numerical integration method. Defaults to ‘trapz’.

Attributes

K

OTTB parameter \(K\).

eval

Get side-effect free component evaluation function.

kT

OTTB parameter \(kT\).

latex

\(\LaTeX\) format of the component.

method

Numerical integration method.

name

Component name.

param_names

Component's parameter names.

type

Component type is additive.

Methods

continuum(egrid, params)

Calculate the photon flux at the energy grid.

static continuum(egrid: Array, params: dict[str, Array]) Array[source]#

Calculate the photon flux at the energy grid.

Parameters:
  • egrid (Array) – Photon energy grid in units of keV.

  • params (dict[str, Array]) – Parameter dict for the model.

Returns:

The photon flux at egrid, in units of ph cm⁻² s⁻¹ keV⁻¹.

property K: Parameter#

OTTB parameter \(K\).

property kT: Parameter#

OTTB parameter \(kT\).

class OTTS(Ec: 'Parameter' | float | None = None, K: 'Parameter' | float | None = None, latex: str | None = None, method=None)[source]#

Bases: NumIntAdditive

Optically-thin thermal synchrotron [1].

\[N(E) = K \exp\left[-\left(\frac{E}{E_\mathrm{c}}\right)^{1/3}\right].\]
Parameters:
  • Ec (Parameter, optional) – The energy scale \(E_\mathrm{c}\), in units of keV.

  • K (Parameter, optional) – The amplitude \(K\), in units of ph cm⁻² s⁻¹ keV⁻¹.

  • latex (str, optional) – \(\LaTeX\) format of the component. Defaults to class name.

  • method ({'trapz', 'simpson'}, optional) – Numerical integration method. Defaults to ‘trapz’.

Attributes

Ec

OTTS parameter \(E_\mathrm{c}\).

K

OTTS parameter \(K\).

eval

Get side-effect free component evaluation function.

latex

\(\LaTeX\) format of the component.

method

Numerical integration method.

name

Component name.

param_names

Component's parameter names.

type

Component type is additive.

Methods

continuum(egrid, params)

Calculate the photon flux at the energy grid.

References

static continuum(egrid: Array, params: dict[str, Array]) Array[source]#

Calculate the photon flux at the energy grid.

Parameters:
  • egrid (Array) – Photon energy grid in units of keV.

  • params (dict[str, Array]) – Parameter dict for the model.

Returns:

The photon flux at egrid, in units of ph cm⁻² s⁻¹ keV⁻¹.

property Ec: Parameter#

OTTS parameter \(E_\mathrm{c}\).

property K: Parameter#

OTTS parameter \(K\).

class PLEnFlux(emin, emax, alpha: 'Parameter' | float | None = None, F: 'Parameter' | float | None = None, latex: str | None = None)[source]#

Bases: PLFluxNorm

Power law function with energy flux used as normalization.

\[\begin{split}N(E) &= \mathcal{F}_\mathrm{en} \left[ \int_{E_\mathrm{min}}^{E_\mathrm{max}} \left(\frac{E}{E_0}\right)^{-\alpha} \, E \, \mathrm{d}E \right]^{-1} \left(\frac{E}{E_0}\right)^{-\alpha}\\ &= \mathcal{F}_\mathrm{en} (2 - \alpha) \left[ \left(\frac{E_\mathrm{max}}{E_0}\right)^{2 - \alpha} - \left(\frac{E_\mathrm{min}}{E_0}\right)^{2 - \alpha} \right]^{-1} \left(\frac{E}{E_0}\right)^{-\alpha},\end{split}\]

where \(E_0\) is the reference energy fixed at 1 keV.

Parameters:
  • emin (float or int) – Minimum energy of the band to calculate the flux, in units of keV.

  • emax (float or int) – Maximum energy of the band to calculate the flux, in units of keV.

  • alpha (Parameter, optional) – Power law photon index \(\alpha\), dimensionless.

  • F (Parameter, optional) – Energy flux \(\mathcal{F}_\mathrm{en}\), in units of erg cm⁻² s⁻¹.

  • latex (str, optional) – \(\LaTeX\) format of the component. Defaults to class name.

Attributes

F

PLEnFlux parameter \(\mathcal{F}_\mathrm{en}\).

alpha

PLEnFlux parameter \(\alpha\).

eval

Get side-effect free component evaluation function.

latex

\(\LaTeX\) format of the component.

name

Component name.

param_names

Component's parameter names.

type

Component type is additive.

Methods

integral(egrid, params)

Calculate the photon flux integrated over the energy grid.

property F: Parameter#

PLEnFlux parameter \(\mathcal{F}_\mathrm{en}\).

property alpha: Parameter#

PLEnFlux parameter \(\alpha\).

class PLPhFlux(emin, emax, alpha: 'Parameter' | float | None = None, F: 'Parameter' | float | None = None, latex: str | None = None)[source]#

Bases: PLFluxNorm

Power law function with photon flux used as normalization.

\[\begin{split}N(E) &= \mathcal{F}_\mathrm{ph} \left[ \int_{E_\mathrm{min}}^{E_\mathrm{max}} \left(\frac{E}{E_0}\right)^{-\alpha} \, \mathrm{d}E \right]^{-1} \left(\frac{E}{E_0}\right)^{-\alpha}\\ &= \mathcal{F}_\mathrm{ph} (1 - \alpha) \left[ \left(\frac{E_\mathrm{max}}{E_0}\right)^{1 - \alpha} - \left(\frac{E_\mathrm{min}}{E_0}\right)^{1 - \alpha} \right]^{-1} \left(\frac{E}{E_0}\right)^{-\alpha},\end{split}\]

where \(E_0\) is the reference energy fixed at 1 keV.

Parameters:
  • emin (float or int) – Minimum energy of the band to calculate the flux, in units of keV.

  • emax (float or int) – Maximum energy of the band to calculate the flux, in units of keV.

  • alpha (Parameter, optional) – Power law photon index \(\alpha\), dimensionless.

  • F (Parameter, optional) – Photon flux \(\mathcal{F}_\mathrm{ph}\), in units of ph cm⁻² s⁻¹.

  • latex (str, optional) – \(\LaTeX\) format of the component. Defaults to class name.

Attributes

F

PLPhFlux parameter \(\mathcal{F}_\mathrm{ph}\).

alpha

PLPhFlux parameter \(\alpha\).

eval

Get side-effect free component evaluation function.

latex

\(\LaTeX\) format of the component.

name

Component name.

param_names

Component's parameter names.

type

Component type is additive.

Methods

integral(egrid, params)

Calculate the photon flux integrated over the energy grid.

property F: Parameter#

PLPhFlux parameter \(\mathcal{F}_\mathrm{ph}\).

property alpha: Parameter#

PLPhFlux parameter \(\alpha\).

class PowerLaw(alpha: 'Parameter' | float | None = None, K: 'Parameter' | float | None = None, latex: str | None = None)[source]#

Bases: AnaIntAdditive

Power law function.

\[N(E) = K \left(\frac{E}{E_0}\right)^{-\alpha},\]

where \(E_0\) is the reference energy fixed at 1 keV.

Parameters:
  • alpha (Parameter, optional) – Power law photon index \(\alpha\), dimensionless.

  • K (Parameter, optional) – Amplitude \(K\), in units of ph cm⁻² s⁻¹ keV⁻¹.

  • latex (str, optional) – \(\LaTeX\) format of the component. Defaults to class name.

Attributes

K

PowerLaw parameter \(K\).

alpha

PowerLaw parameter \(\alpha\).

eval

Get side-effect free component evaluation function.

latex

\(\LaTeX\) format of the component.

name

Component name.

param_names

Component's parameter names.

type

Component type is additive.

Methods

integral(egrid, params)

Calculate the photon flux integrated over the energy grid.

static integral(egrid: Array, params: dict[str, Array]) Array[source]#

Calculate the photon flux integrated over the energy grid.

Parameters:
  • egrid (Array) – Photon energy grid in units of keV.

  • params (dict[str, Array]) – Parameter dict for the model.

Returns:

The photon flux integrated over egrid, in units of ph cm⁻² s⁻¹.

property K: Parameter#

PowerLaw parameter \(K\).

property alpha: Parameter#

PowerLaw parameter \(\alpha\).

class SmoothlyBrokenPL(alpha1: 'Parameter' | float | None = None, Eb: 'Parameter' | float | None = None, alpha2: 'Parameter' | float | None = None, rho: 'Parameter' | float | None = None, K: 'Parameter' | float | None = None, latex: str | None = None, method=None)[source]#

Bases: NumIntAdditive

Smoothly broken power law.

\[N(E) = K \left( \frac{E}{E_0} \right) ^ {-\alpha_1} \left\{ 2\left[ 1 + \left(\frac{E}{E_\mathrm{b}} \right)^{\left( \alpha_2 - \alpha_1 \right) / \rho} \right] \right\}^{-\rho},\]

where \(E_0\) is the reference energy fixed at 1 keV.

Parameters:
  • alpha1 (Parameter, optional) – The low-energy power law index \(\alpha_1\), dimensionless.

  • Eb (Parameter, optional) – The break energy \(E_\mathrm{b}\), in units of keV.

  • alpha2 (Parameter, optional) – The high-energy power law index \(\alpha_2\), dimensionless.

  • rho (Parameter, optional) – The smoothness parameter \(\rho\), dimensionless.

  • K (Parameter, optional) – The amplitude \(K\), in units of ph cm⁻² s⁻¹ keV⁻¹.

  • latex (str, optional) – \(\LaTeX\) format of the component. Defaults to class name.

  • method ({'trapz', 'simpson'}, optional) – Numerical integration method. Defaults to ‘trapz’.

Attributes

Eb

SmoothlyBrokenPL parameter \(E_\mathrm{b}\).

K

SmoothlyBrokenPL parameter \(K\).

alpha1

SmoothlyBrokenPL parameter \(alpha_1\).

alpha2

SmoothlyBrokenPL parameter \(alpha_2\).

eval

Get side-effect free component evaluation function.

latex

\(\LaTeX\) format of the component.

method

Numerical integration method.

name

Component name.

param_names

Component's parameter names.

rho

SmoothlyBrokenPL parameter \(\rho\).

type

Component type is additive.

Methods

continuum(egrid, params)

Calculate the photon flux at the energy grid.

static continuum(egrid: Array, params: dict[str, Array]) Array[source]#

Calculate the photon flux at the energy grid.

Parameters:
  • egrid (Array) – Photon energy grid in units of keV.

  • params (dict[str, Array]) – Parameter dict for the model.

Returns:

The photon flux at egrid, in units of ph cm⁻² s⁻¹ keV⁻¹.

property Eb: Parameter#

SmoothlyBrokenPL parameter \(E_\mathrm{b}\).

property K: Parameter#

SmoothlyBrokenPL parameter \(K\).

property alpha1: Parameter#

SmoothlyBrokenPL parameter \(alpha_1\).

property alpha2: Parameter#

SmoothlyBrokenPL parameter \(alpha_2\).

property rho: Parameter#

SmoothlyBrokenPL parameter \(\rho\).