Fermi Science Support Center

Model Selection

The models used by the Science Tools are stored in XML files. XML (short for eXtensible Markup Language) is a language to define and store data; HTML used to define webpages is a form of XML. XML files are ASCII files full of 'tags' delimited by the < and > symbols.

For historic reasons the Science Tools use two XML formats, one used for parameter fitting (e.g., by the likelihood tool) and the other for source simulation. The likelihood XML format includes parameter uncertainties but does not allow time dependence while the simulation format does; in addition, the simulation format includes source models that are not in the likelihood format.

Creating and Editing Source Models

You could master the syntax to create a model XML file, and indeed occasionally you might find it convenient to edit an existing XML file. However, a GUI-driven tool called ModelEditor is included in the Science Tools. This tool is invoked at the command line, and its use is fairly intuitive. ModelEditor can read and write XML files of both formats. Here we point out fundamental features of this tool, focusing on the creation of likelihood XML files.

While you might want to define each source in your Source Region, it is easier to start with a catalog for this region. Prior to the release of the first-year catalog, the obvious choice is the 3EG (3rd EGRET) catalog. Under 'File' choose 'Extract...' This will open a GUI that allows you to define your Source Region (RA, Dec and radius in degrees), the flux limit, the file with the catalog (the 3EG catalog is the default) and the output file. Remember, the Source Region should be larger than the Region of Interest, the region for which there are counts. You will then be presented with a GUI with a list of selected sources. Selecting a source presents you with the source properties: a position and a spectral model. You can edit these values; for example, the catalog may have assumed the spectrum was a simple power law, but you would like to try a power law with an exponential cutoff. You save the model for a particular source by clicking the 'Set components' button.

Using the pull-down menu you can delete a selected source or add either a diffuse or point source.

The entire source model need not be in the same XML file. The tools accept lists of source XML files, both at the command line and by reading in simple ASCII files listing the XML files.

The model parameters (in the likelihood XML format) have a number of attributes:

  • value—the parameter's value; may be an initial guess or the result of a fit
  • scale—a scale factor for the parameter
  • name—name given to the parameter
  • max—parameter's maximum value
  • min—parameter's minimum value
  • free—whether the parameter should be fit: 0 means the parameter value should be fixed, 1 that it should be fit

Therefore, if the 'value' is '4.3' and the 'scale' is '1e-9,' the actual parameter value is 4.3x10-9.

Spatial Models

You have a choice of four models:

  • SkyDirFunction—a point source
  • ConstantValue—a diffuse source with a constant flux per steradian
  • SpatialMap—a spatially varying diffuse source. The map of the source is provided by a file. The default is the map of the Galactic Diffuse Emission.
  • MapCubeFunction—a 3 dimensional FITS map (two sky coordinates and energy) used to map diffuse emission, thereby allowing arbitrary spectral variation as a function of sky position

Spectral Models

The units for the spectral models are cm-2 s-1 MeV-1 for point sources and cm-2 s-1 MeV-1 sr-1 for diffuse sources. All energies are in MeV.

You have a choice of the following models:

  • PowerLaw—simple power law

    N(E) = N0 (E/E0)γ

    • N0—Prefactor
    • γ—spectral index
    • E0—energy scale
  • BrokenPowerLaw—two component power law

    N(E) = N0 (E/Eb)γ1   ;    E<Eb
    = N0 (E/Eb)γ2   ;    E>Eb

    • N0—Prefactor
    • γ1—low energy spectral index
    • γ2—high energy spectral index
    • Eb—break energy
  • PowerLaw2—simple power law with the integral number of counts between two energies as the normalization

    N(E) = (γ+1)N Eγ/[Emaxγ+1 -Eminγ+1]

    • N—Integral number of counts between Emax and Emin
    • γ—spectral index
    • Emin—low end of energy range (always a fixed quantity)
    • Emax—high end of energy range (always a fixed quantity)
  • BrokenPowerLaw2—two component power law, with the integral number of counts between two energies as the normalization

    N(E) = N0(N,Emin,Emax12) (E/Eb)γ1   ;    E<Eb
    = N0(N,Emin,Emax12) (E/Eb)γ2   ;    E>Eb
    N0(N,Emin,Emax12) is the normalization necessary for N counts between Emin and Emax

    • N—total number of counts between Emin and Emax
    • γ1—low energy spectral index
    • γ2—high energy spectral index
    • Eb—break energy
    • Emin—lower energy limit for number of counts
    • Emax—upper energy limit for number of counts
  • LogParabola—curving function used to model blazars

    N(E) = N0 (E/Eb)(α+βln(E/Eb))

    • N0—Prefactor
    • α—spectral index
    • β—index
    • Eb—break energy
  • ExpCutoff—power law with a modified exponential cutoff. This function can be used both for simple exponential cutoffs and to model the absorption by the extragalactic background light (EBL).

    N(E) = N0(E/E0)exp[-(E-Eb)/p1-p2ln(E/Eb)-p3ln2(E/Eb)]   ;    E > Eb
    N(E) = N0(E/E0)   ;    E < Eb

    • N0—Prefactor
    • γ—spectral index
    • E0—pivot energy
    • Eb—break energy
    • p1—exponential energy scale
    • p2—parameter
    • p3—parameter
  • BPLExpCutoff—an exponentially cut-off broken power law

    N(E) = N0 (E/Eb)γ1   ;    E<Eb and E<Eabs
    = N0 (E/Eb)γ1exp[-(E-Eabs)/E]   ;    E<Eb and E>Eabs
    = N0 (E/Eb)γ2   ;    E>Eb and E<Eabs
    = N0 (E/Eb)γ2exp[-(E-Eabs)/E]   ;    E>Eb and E>Eabs

    • N0—Prefactor
    • γ1—low energy spectral index
    • γ2—high energy spectral index
    • Eb—break energy
    • Eabs—energy of cutoff onset
    • E0—exponential energy scale
  • Gaussian—function that can model an emission line.

    N(E) = [N0(2π)-1/2/σ]exp[-(E-E0)2/2σ2]

    • N0—Prefactor
    • E0—center energy
    • σ—width
  • ConstantValue—constant-value function.

    N(E) = N0

    • N0—Prefactor
  • BandFunction—function used to model gamma-ray burst spectra

    N(E) = N0 (E/Epiv)α exp[-E(2+α)/Ep]   ;    E<(α-β)Ep/(2+α)
    = N0 [Ep(α-β)/(α+2)Epiv](α-β)exp[β-α](E/Epiv)β   ;    E>(α-β)Ep/(2+α)
    Epiv

    • N0—normalization
    • α—low energy spectral index
    • β—high energy spectral index
    • Ep—'peak' energy, energy of peak of νfν spectrum
  • FileFunction—tabulated function, F(E), with free-floating normalization. The function is provided in an ASCII file with two columns. The first column is the energy in MeV, and the second is the flux (cm-2 s-1 MeV-1 for a point source, cm-2 s-1 MeV-1 sr-1 for a diffuse source)

    N(E) = N0F(E)

    • N0—Prefactor

Diffuse Emission Models

Proper fitting of the source analysis requires simultaneous modeling of the background contribution as well. Both the galactic and extragalactic diffuse emission contribute to this background, and they are modeled separately. Model definitions currently recommended by the LAT team for proper source analysis are described here. These contributions are incorporated in the XML model file in addition to the source models.


» Forward to Calculating Livetime and Exposure
» Back to Choosing the Data to Analyze—Regions of Interest and Source Regions
» Back to the beginning of the likelihood section
» Back to the beginning of the Cicerone