This page describes the Spectral and Spatial Models available for use in gtlike.

Two types of sources can be defined, PointSource and DiffuseSource. Each type of source model is comprised of a spectral and a spatial model component, where each component is made up of several parameters.

Each model parameter has a range of valid values that can be specified, and is described by a set of attributes. The actual value of a given parameter that is used in the calculation is the *value* attribute multiplied by the *scale* attribute. The *value* attribute is what the optimizers see. Using the *scale* attribute is necessary to ensure that the parameters describing the objective function, -log(likelihood) for this application, all have values lying roughly within an order-of-magnitude of each other. The *free* attribute determines whether the parameter will be allowed to be fixed or free in the fitting process.

**NOTE:** Free flag attributes are currently disabled for spatial model parameters since fitting for these parameters has not been implemented (primarily due to the enormous overhead associated with computing the energy-dependent response functions for each source component).

Several spectral functions are available for use with gtlike. For point source spectral models, the units are . For diffuse sources, the units are .

The available point source spectral models are:

- PowerLaw
- BrokenPowerLaw
- PowerLaw2
- BrokenPowerLaw2
- SmoothBrokenPowerLaw
- LogParabola
- ExpCutoff
- BPLExpCutoff
- PLSuperExpCutoff
- PLSuperExpCutoff2
- PLSuperExpCutoff3
- ConstantValue
- Gaussian
- BandFunction
- DMFitFunction
- FileFunction

Example: XML Model Definition

This function has the form:

where the parameters in the XML definition have the following mappings:

- Prefactor =
- Index =
- Scale =

Example: XML Model Definition

This function has the form:

where

- Prefactor =
- Index1 =
- Index2 =
- BreakValue =

Example: XML Model Definition

This function uses the integrated flux as a free parameter rather than the Prefactor:

where

- Integral =
- Index =
- LowerLimit =
- UpperLimit =

**NOTE:** The UpperLimit and LowerLimit parameters are always treated as fixed and, as should be apparent from this definition, the flux given by the Integral parameter is over the range (LowerLimit, UpperLimit). Use of this model allows the errors on the integrated flux to be evaluated directly by likelihood, obviating the need to propagate the errors if one is using the PowerLaw form.

Example: XML Model Definition

Similar to PowerLaw2, the integral flux is the free parameter rather than the Prefactor:

where

and

- Integral =
- Index1 =
- Index2 =
- BreakValue =
- LowerLimit =
- UpperLimit =

Example: XML Model Definition

where

- Prefactor =
- Index1 =
- Scale =
- Index2 =
- BreakValue =
- beta =

Example: XML Model Definition

This is typically used for modeling Blazar spectra.

where

- norm =
- alpha =
- beta =
- Eb =

Note: Eb is a scale parameter that should be set near the lower energy range of the spectrum being fit and is usually fixed, see Massaro et al., A&A (2004) 413, 489.

Example: XML Model Definition

An exponentially cut-off power-law used for modeling blazar spectra subject to absorption by the extragalactic background light (EBL).

where

- Prefactor =
- Index =
- Scale =
- Ebreak =
- P1 =
- P2 =
- P3 =

Example: XML Model Definition

An exponentially cut-off broken power-law.

where

- Prefactor =
- Index1 =
- Index2 =
- BreakValue =
- Eabs =
- P1 =

Example: XML Model Definition

For modeling pulsars. Note that the PLSuperExpCutoff spectral shape in the 4FGL corresponds to PLSuperExpCutoff2 in the Fermitools (see next entry).

where

- Prefactor =
- Index1 =
- Scale =
- Cutoff =
- Index2 =

Example: XML Model Definition

For modeling pulsars.

where

- Prefactor =
- Index1 =
- Scale =
- Exponential Factor =
- Index2 =

Example: XML Model Definition

For modeling pulsars.

\[{dN \over dE} = N_0 \left( {E \over E_0}\right)^{\gamma_0 + bc} exp\left( c \left( 1 - \left({E \over E_0}\right)^b \right) \right)\]

where

- Prefactor = \(N_0\)
- IndexS = \(\gamma_0\)
- Scale = \(E_0\)
- Expfactor2 = \(c\)
- Index2 = \(b\)

Note:

- \(N_0\) is the normalization (flux density) at \(E_0\).
- \(\gamma_0\) is the local spectral index at \(E_0\).

These features are shared by the LogParabola functional.

Example: XML Model Definition

A constant-valued function, independent of energy.

where

- Value =

Example: XML Model Definition

A Gaussian function that can be used to model an emission line.

where

- Prefactor =
- Mean =
- Sigma =

Example: XML Model Definition

This function is used to model GRB spectra.

where

- norm =
- alpha =
- beta =
- Ep =

This function is used to fit for putative dark matter signals (as described in Jeltema & Profumo 2008)

Example: XML Model Definition

The functional form for the flux is:

*<σ _{v}> N_{0} (B_{r} F_{(M,C0)} + (1 - B_{r} F_{(M,C1)}))*

where the values of F(M,C) are tabulated in the file $FERMI_DIR/refdata/fermi/Likelihood/gammamc_dif.dat

The XML parameters are:

- norm =
*N*, the J-factor. (Units are GeV_{0}^{2}/cm^{5}) - sigmav =
*<σ*, the thermally averaged cross section, i.e., the thing we care about (Units are cm_{v}>^{3}s^{-1}) - mass =
*M*, the mass of the DM particle (Units are GeV) - bratio =
*B*, branching ratio into decay channel0 (and 1- the branching ratio into decay channel1)_{r} - channel0 =
*C*, primary decay channel_{0} - channel1 =
*C*, secondary decay channel (optional)_{1}

The decay channels take integer codes, the map is:

- 1 : "e+e-"
- 2 : "mu+mu-"
- 3 : "tau+tau-"
- 4 : "bb-bar"
- 5 : "tt-bar"
- 6 : "gluons"
- 7 : "W+W-"
- 8 : "Z Z"
- 9 : "cc-bar"
- 10 : "cosmo bb-bar"
- 11 : "cosmo gam-gam"

Example: XML Model Definition

A function defined using an input ASCII file with columns of energy and differential flux values. The energy units are assumed to be MeV and the flux values are assumed to for a point source and for a diffuse source. The sole parameter is a multiplicative normalization.

where

- Normalization =

**NOTE:** Free flag attributes are currently disabled for spatial model parameters since fitting for these parameters has not been implemented (primarily due to the enormous overhead associated with computing the energy-dependent response functions for each source component).

Four spatial models are available:

**SkyDirFunction**- describes a direction on the sky and is used for point sources or radial models.**ConstantValue**- provides a constant value regardless of what argument value it takes. (In the current context, ConstantValue is used to model the isotropic diffuse emission. As a function, however, ConstantValue is fairly general and can even be used in a spectral model; as it is when the spatial model is a MapCubeFunction.)**SpatialMap**- uses a FITS image file as a template for determining the distribution of photons on the sky. (XML Example)**MapCubeFunction**- used for diffuse sources that are modeled by a 3 dimensional FITS map (two sky coordinates and energy), thereby allowing arbitrary spectral variation as a function of sky position. (XML Example)

Last updated by: Nestor Mirabal - 02/14/2018