elisa.models.conv#

Convolution models.

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

Bases: NormConvolution

Normalize an additive model by energy flux between emin and emax.

\[N'(E) = \mathcal{F}_\mathrm{en} \left[\int_{E_\mathrm{min}}^{E_\mathrm{max}} EN(E)\,dE\right]^{-1} N(E)\]

Warning

The normalization of one of the additive components must be fixed to a positive value.

Warning

The flux is calculated by trapezoidal rule, and is accurate only if enough numbers of energy grids are used.

Parameters:
eminfloat or int

Minimum energy of the band to calculate the flux, in units of keV.

emaxfloat or int

Maximum energy of the band to calculate the flux, in units of keV.

FParameter, optional

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

latexstr, optional

\(\LaTeX\) format of the component. Defaults to class name.

ngridint, optional

The energy grid number to use. The default is 1000.

elogbool, optional

Whether to use logarithmically regular energy grids. The default is True.

Attributes

F

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

elog

Whether to use logarithmically regular energy grids.

emax

Maximum value of photon energy grid

emin

Minimum value of photon energy grid

eval

Get side-effect free component evaluation function.

latex

\(\LaTeX\) format of the component.

name

Component name.

ngrid

Photon energy grid number.

param_names

Component's parameter names.

type

Component type.

Methods

convolve(egrid, params, model_fn, flux_egrid)

Convolve a model function.

static convolve(egrid: JAXArray, params: NameValMapping, model_fn: Callable[[JAXArray], JAXArray], flux_egrid: JAXArray) JAXArray[source]#

Convolve a model function.

Parameters:
egridndarray

Photon energy grid in units of keV.

paramsdict

Parameter dict for the convolution model.

model_fncallable()

The model function to be convolved, which takes the energy grid as input and returns the model flux over the grid.

flux_egridndarray

Photon energy grid used to calculate flux in units of keV.

Returns:
valuendarray

The re-normalized model over egrid, in units of ph cm⁻² s⁻¹ keV⁻¹.

property F: Parameter#

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

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

Bases: NormConvolution

Normalize an additive model by photon flux between emin and emax.

\[N'(E) = \mathcal{F}_\mathrm{ph} \left[\int_{E_\mathrm{min}}^{E_\mathrm{max}} N(E) \, dE\right]^{-1} N(E)\]

Warning

The normalization of one of the additive components must be fixed to a positive value.

Warning

The flux is calculated by trapezoidal rule, and is accurate only if enough numbers of energy grids are used.

Parameters:
eminfloat or int

Minimum energy of the band to calculate the flux, in units of keV.

emaxfloat or int

Maximum energy of the band to calculate the flux, in units of keV.

FParameter, optional

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

latexstr, optional

\(\LaTeX\) format of the component. Defaults to class name.

ngridint, optional

The energy grid number to use. The default is 1000.

elogbool, optional

Whether to use logarithmically regular energy grids. The default is True.

Attributes

F

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

elog

Whether to use logarithmically regular energy grids.

emax

Maximum value of photon energy grid

emin

Minimum value of photon energy grid

eval

Get side-effect free component evaluation function.

latex

\(\LaTeX\) format of the component.

name

Component name.

ngrid

Photon energy grid number.

param_names

Component's parameter names.

type

Component type.

Methods

convolve(egrid, params, model_fn, flux_egrid)

Convolve a model function.

static convolve(egrid: Array, params: dict[str, Array], model_fn: Callable[[Array], Array], flux_egrid: Array) Array[source]#

Convolve a model function.

Parameters:
egridndarray

Photon energy grid in units of keV.

paramsdict

Parameter dict for the convolution model.

model_fncallable()

The model function to be convolved, which takes the energy grid as input and returns the model flux over the grid.

flux_egridndarray

Photon energy grid used to calculate flux in units of keV.

Returns:
valuendarray

The re-normalized model over egrid, in units of ph cm⁻² s⁻¹ keV⁻¹.

property F: Parameter#

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

class ZAShift(z: 'Parameter' | float | None = None, latex: str | None = None)[source]#

Bases: ConvolutionComponent

Redshifts an additive model.

Consider a source with an emission area of radius \(R\) at redshift \(z\). Given the flux function \(N(E)\) [ph s⁻¹ cm⁻² keV⁻¹] at the radius \(R\), the observed number of photons \(n\) between the energy range \(e_1\) [keV] and \(e_2\) [keV] during an exposure time of \(\Delta t\) [s] is calculated as follows:

\[\begin{split}n &= \frac{R^2}{{D_\mathrm{c}}^2} \frac{\Delta t}{1+z} \int_{e_1(1+z)}^{e_2(1+z)} N(E) \, \mathrm{d}E \\\\ &= \frac{R^2}{{D_\mathrm{c}}^2} \frac{\Delta t}{1+z} \int_{E_1}^{E_2} N(E) \, \mathrm{d}E,\end{split}\]

where \(E_1 = e_1 (1+z)\) [keV], \(E_2 = e_2 (1+z)\) [keV] and \(D_\mathrm{c}\) is the comoving distance of the source at redshift \(z\).

Note that the \(\frac{R^2}{{D_\mathrm{c}}^2}\) factor is absorbed into the normalization of \(N(E)\) in practice.

Parameters:
zParameter, optional

Redshift \(z\), dimensionless.

latexstr, optional

\(\LaTeX\) format of the component. Defaults to class name.

Attributes

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.

z

ZAShift parameter \(z\).

Methods

convolve(egrid, params, model_fn)

Convolve a model function.

static convolve(egrid: Array, params: dict[str, Array], model_fn: Callable[[Array], Array]) Array[source]#

Convolve a model function.

Parameters:
egridndarray

Photon energy grid in units of keV.

paramsdict

Parameter dict for the convolution model.

model_fncallable()

The model function to be convolved, which takes the energy grid as input and returns the model value over the grid.

Returns:
jax.Array

The convolved model value over egrid.

property z: Parameter#

ZAShift parameter \(z\).

class ZMShift(z: 'Parameter' | float | None = None, latex: str | None = None)[source]#

Bases: ConvolutionComponent

Redshifts a multiplicative model.

Consider a source at redshift \(z\). Given the dimensionless model function \(M(E)\), the observed value between the energy range \(e_1\) [keV] and \(e_2\) [keV] is calculated as follows:

\[\begin{split}m &= \frac{1}{(e_2 - e_1)(1+z)} \int_{e_1(1+z)}^{e_2(1+z)} M(E) \, \mathrm{d}E \\\\ &= \frac{1}{E_2 - E_1} \int_{E_1}^{E_2} M(E) \, \mathrm{d}E,\end{split}\]

where \(E_1 = e_1 (1+z)\) [keV] and \(E_2 = e_2 (1+z)\) [keV].

Parameters:
zParameter, optional

Redshift \(z\), dimensionless.

latexstr, optional

\(\LaTeX\) format of the component. Defaults to class name.

Attributes

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.

z

ZMShift parameter \(z\).

Methods

convolve(egrid, params, model_fn)

Convolve a model function.

static convolve(egrid: Array, params: dict[str, Array], model_fn: Callable[[Array], Array]) Array[source]#

Convolve a model function.

Parameters:
egridndarray

Photon energy grid in units of keV.

paramsdict

Parameter dict for the convolution model.

model_fncallable()

The model function to be convolved, which takes the energy grid as input and returns the model value over the grid.

Returns:
jax.Array

The convolved model value over egrid.

property z: Parameter#

ZMShift parameter \(z\).

class VAShift(v: 'Parameter' | float | None = None, latex: str | None = None)[source]#

Bases: ConvolutionComponent

Velocity shifts an additive model.

Consider a source with an emission area of radius \(R\), moving with speed \(v\) along line of sight. Given the flux function \(N(E)\) [ph s⁻¹ cm⁻² keV⁻¹] at the radius \(R\), the observed number of photons \(n\) between the energy range \(e_1\) [keV] and \(e_2\) [keV] during an exposure time of \(\Delta t\) [s] is calculated as follows:

\[\begin{split}n &= \Delta t \int_{fe_1}^{fe_2} N(E) \, \mathrm{d}E \\\\ &= \Delta t \int_{E_1}^{E_2} N(E) \, \mathrm{d}E,\end{split}\]

where \(E_1 = f e_1\) [keV], \(E_2 = f e_2\) [keV], and \(f = 1 - v/c\).

Parameters:
vParameter, optional

Velocity \(v\), in units of km s⁻¹.

latexstr, optional

\(\LaTeX\) format of the component. Defaults to class name.

Attributes

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.

v

VAShift parameter \(v\).

Methods

convolve(egrid, params, model_fn)

Convolve a model function.

property v: Parameter#

VAShift parameter \(v\).

static convolve(egrid: Array, params: dict[str, Array], model_fn: Callable[[Array], Array]) Array[source]#

Convolve a model function.

Parameters:
egridndarray

Photon energy grid in units of keV.

paramsdict

Parameter dict for the convolution model.

model_fncallable()

The model function to be convolved, which takes the energy grid as input and returns the model value over the grid.

Returns:
jax.Array

The convolved model value over egrid.

class VMShift(v: 'Parameter' | float | None = None, latex: str | None = None)[source]#

Bases: ConvolutionComponent

Velocity shifts a multiplicative model.

Consider a source moving with speed \(v\) along line of sight. Given the dimensionless model function \(M(E)\), the observed value between the energy range \(e_1\) [keV] and \(e_2\) [keV] is calculated as follows:

\[\begin{split}m &= \frac{1}{f (e_2 - e_1)} \int_{f e_1}^{f e_2} M(E) \, \mathrm{d}E \\\\ &= \frac{1}{E_2 - E_1} \int_{E_1}^{E_2} M(E) \, \mathrm{d}E,\end{split}\]

where \(E_1 = f e_1\) [keV], \(E_2 = f e_2\) [keV], and \(f = 1 - v/c\).

Parameters:
vParameter, optional

Velocity \(v\), in units of km s⁻¹.

latexstr, optional

\(\LaTeX\) format of the component. Defaults to class name.

Attributes

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.

v

VMShift parameter \(v\).

Methods

convolve(egrid, params, model_fn)

Convolve a model function.

property v: Parameter#

VMShift parameter \(v\).

static convolve(egrid: Array, params: dict[str, Array], model_fn: Callable[[Array], Array]) Array[source]#

Convolve a model function.

Parameters:
egridndarray

Photon energy grid in units of keV.

paramsdict

Parameter dict for the convolution model.

model_fncallable()

The model function to be convolved, which takes the energy grid as input and returns the model value over the grid.

Returns:
jax.Array

The convolved model value over egrid.