Fermi Science Support Center

LAT Background Models

Many analyses of LAT data require models of Galactic diffuse and isotropic emission. Detailed discussion of how the latest Galactic diffuse emission models, which are available from this web page, have been developed is available, Acero et. al. (2016). Please refer to the binned or unbinned likelihood analysis tutorials for some examples of how to incorporate theses models into your own Fermi data analysis. Here is a list of IRFs and diffuse models to be used with the various data sets. We have provided the model files for you to download. However, the files for the most recent data release are included in the science tools installation (in the $(FERMI_DIR)/refdata/fermi/galdiffuse/ directory). As a result, it is unlikely that you will need to download each file separately.

For Pass 8, each event class and event type combination has a dedicated IRF and isotropic model. Only a subset are shown here, as examples.

Galactic interstellar
emission model
Event Selection/
IRF Name
Isotropic spectral template
(see below for usage notes)
Pass 8 Source (front+back, allPSF, allEDISP)
Pass 8 Source (front only)
Pass 8 Source (back only)
Pass 8 Clean (front+back, allPSF, allEDISP)
Pass 8 Clean (PSF0)
Pass 8 Clean (PSF1)
Pass 8 Clean (PSF2)
Pass 8 Clean (PSF3)
Pass 8 Ultraclean (front+back, allPSF, allEDISP)
Pass 8 Ultraclean (EDISP0)
Pass 8 Ultraclean (EDISP1)
Pass 8 Ultraclean (EDISP2)
Pass 8 Ultraclean (EDISP3)
Pass 8 Ultracleanveto (front+back, allPSF, allEDISP)
(see below for usage notes)

gll_iem_v05_rev1.fit (above)
replaces the previous version,
(details below)
Pass 7 Reprocessed Source (front+back)
Pass 7 Reprocessed Source (front only)
Pass 7 Reprocessed Source (back only)
Pass 7 Reprocessed Clean (front+back)
Pass 7 Reprocessed Clean (front only)
Pass 7 Reprocessed Clean (back only)
gal_2yearp7v6_v0.fits or
Pass 7 (V6) Source (front+back)
Pass 7 (V6) Source (front)
Pass 7 (V6) Source (back)
Pass 7 (V6) Clean (front+back)
Pass 7 (V6) Clean (front)
Pass 7 (V6) Clean (back)
gll_iem_v02_P6_V11_DIFFUSE.fit Pass 6 (V11) Diffuse (front+back)
Pass 6 (V11) Diffuse (front only)
Pass 6 (V11) Diffuse (back only)
gll_iem_v02.fit Pass 6 (V3) Diffuse (front+back)
Pass 6 (V3) Diffuse (front only)
Pass 6 (V3) Diffuse (back only)
Pass 6 (V3) DataClean (front+back)

The Galactic Interstellar Emission Model

The Galactic model is a spatial and spectral template. The model for the Galactic diffuse emission was developed using spectral line surveys of HI and CO (as a tracer of H2) to derive the distribution of interstellar gas in Galactocentric rings. Infrared tracers of dust column density were used to correct column densities in directions where the optical depth of HI was either over or under-estimated. The model of the diffuse gamma-ray emission was then constructed by fitting the gamma-ray emissivities of the rings in several energy bands to the LAT observations. The fitting also required a model of the inverse Compton emission calculated using GALPROP and a model for the isotropic diffuse emission. Detailed discussion of how the latest Galactic diffuse emission models, which are available from this web page, have been developed is available, Acero et. al. (2016).

Update for Pass 8: The version of the Interstellar Emission Model for the analysis of Pass 8 data is gll_iem_v06.fits, which is included in the current release (v10r00p05) of the Fermi Science Tools. This model is based on the P7REP model discussed in this document, but has been scaled to account for differences in energy dispersion between Pass 7 reprocessed data and Pass 8 data. This model is designed to be used for point source analysis, but is not appropriate for the investigation of medium or large scale diffuse structures within the LAT data. The file is valid from 58.5 MeV and 513 GeV. It cannot be used for analyses that include data outside that range.

  • More information about how the Galactic Diffuse Model was rescaled for Pass 8 Data is available here.
  • Caveats related to the use of these diffuse models are regularly updated, and are available from the LAT Caveats page.

PLEASE NOTE: The Galactic interstellar emission model for Pass 8 is nearly the same as for Pass 7. The model as been adjusted to account for the different effects of energy dispersion in the two different data sets. The interstellar emission model is a large file. For some computers this can produce memory-related issues when running tools that use this model, such as gtlike, gtsrcprob, gtdiffrsp, and gtsrcmaps.

Isotropic Spectral Templates

An isotropic spectral template provides the spectral form from a fit to the all-sky emission (|b|>30 deg) that is not represented in the Galactic diffuse model and therefore includes both extragalactic diffuse gamma rays and remaining residual (misclassified) cosmic-ray emission. LAT data contain a significant background contribution, so these models are necessary for most analyses. The isotropic spectral template should be used with the same Galactic diffuse model, event class, and event type selection that were used to derive it. The full set of isotropic models are in the $(FERMI_DIR)/refdata/galdiffuse directory. The three columns in each isotropic template are: the central energy (in MeV) for the band, the differential flux in that band (in ph/cm2/s/MeV/sr), and the 1-sigma uncertainty on the differential flux. The uncertainty is not used for likelihood analysis by the Science Tools.

Updating your XML files

Both the isotropic and Galactic diffuse models are provided within the Science Tools release in the "$(FERMI_DIR)/refdata/fermi/galdiffuse" directory. It is necessary for your XML model to properly represent the source name (as is used in the LAT events files) as well as the proper path and filename for the model files.

NOTE: It is important that you keep the "source name" tags consistent within your XML models. The Pass 8 data files have been delivered without the diffuse response columns having been populated. As a result, you will need to run the gtdiffrsp tool before performing any unbinned analysis method (such as gtfindsrc or gtsrcprob). If you change the "source name" in the XML file, the tool calculating the exposure will not be able to tell that gtdiffrsp has been run, and will recalculate the diffuse responses, significantly increasing your processing time.

An example of the correct XML for these models is:

<source_library title="source library">

<source name="iso_P8R2_SOURCE_V6_v06" type="DiffuseSource">
<spectrum file="$(FERMI_DIR)/refdata/fermi/diffuseModels/iso_P8R2_SOURCE_V6_v06.txt" type="FileFunction">
<parameter free="1" max="1000" min="1e-05" name="Normalization" scale="1" value="1" />
<spatialModel type="ConstantValue">
<parameter free="0" max="10.0" min="0.0" name="Value" scale="1.0" value="1.0"/>

<source name="gll_iem_v06" type="DiffuseSource">
<spectrum type="ConstantValue">
<parameter free="1" max="10.0" min="0.0" name="Value" scale="1.0" value= "1.0"/>
<spatialModel file="$(FERMI_DIR)/refdata/fermi/diffuseModels/gll_iem_v06.fit" type="MapCubeFunction">
<parameter free="0" max="1000.0" min="0.001" name="Normalization" scale= "1.0" value="1.0"/>


The easiest way to generate XML models that use the new diffuse models is to run the user contributed tool "make3FGLxml.py" (available here). You will also need the current LAT catalog file, and (optionally) the current archive of extended sources. A sample call that includes one extended source is:

prompt> make3FGLxml.py $(PATH_TO_CATALOG)/gll_psc_v16.fit $(PATH_TO_DATA_FILE)/data_filename.fits --outputxml model_filename.xml
--galfile $(FERMI_DIR)/refdata/fermi/galdiffuse/gll_iem_v06.fit --galname gll_iem_v06
--isofile $(FERMI_DIR)/refdata/fermi/galdiffuse/iso_P8R2_SOURCE_V6_v06.txt
--isoname iso_P8R2_SOURCE_V6_v06 --extDir $(LATEXTDIR)/Templates
This is make3FGLxml version 01.
Creating file and adding sources from 3FGL
Extended source CenA Lobes in ROI, make sure $(LATEXTDIR)/Templates/CenALobes.fits is the correct path to the extended template.
Added 311 point sources and 1 extended sources
If using unbinned likelihood you will need to rerun gtdiffrsp for the extended sources or rerun the makeModel function with optional argument psForce=True

This tool has a number of options available to you. Review the usage notes for more information.

REMINDER: Unlike previous data releases, for the initial Pass 8 data release the diffuse responses have not been pre-calculated. As a result, you will need to run the gtdiffrsp tool as part of any unbinned likelihood analysis.

Disabling Energy Dispersion

For certain data set, the user may chose to enable the handling of energy dispersion effects at low energies. In these cases, you will need to disable the energy dispersion correction for any model components that have already been corrected for energy dispersion or were fit to the data without taking energy dispersion into account. This includes the Galactic diffuse model and the isotropic templates, as well as any point-like or extended sources for which the spectral parameters are fixed to the 3FGL values.

The method for disabling energy dispersion handling for a specific source, is to add an attribute to the XML model for that source. This attribute, apply_edisp="false", should be included in the <spectrum> tag of the model for the source which should NOT have the energy dispersion corrections applied.

An example of the correct XML for a source with energy dispersion handling disabled is:

<source name="gll_iem_v06" type="DiffuseSource">
<spectrum type="ConstantValue" apply_edisp="false">
<parameter free="1" max="10.0" min="0.0" name="Value" scale="1.0" value= "1.0"/>
<spatialModel file="$(FERMI_DIR)/refdata/fermi/diffuseModels/gll_iem_v06.fit" type="MapCubeFunction">
<parameter free="0" max="1000.0" min="0.001" name="Normalization" scale= "1.0" value="1.0"/>

Including Extended Sources in your Model

Performing an integration over a spatial map requires a different technique than is used for point sources. As a result, you will need to include an attribute in the XML code for an extended source, telling the Science Tools to use the map-based integration method. This attribute, map_based_integral="true", should be included in the <spatialModel> tag of the model for the extended source.

An example of the correct XML for an extended source model is:

<source_library title="source library">

<source name="W44" type="DiffuseSource">
<spectrum normPar="norm" type="LogParabola">
<parameter free="1" max="100000" min="1e-05" name="norm" scale="1e-11" value="2.891247798"/>
<parameter free="1" max="5" min="0" name="alpha" scale="1" value="2.399924084"/>
<parameter free="1" max="5" min="-1" name="beta" scale="1" value="0.2532196784"/>
<parameter free="0" max="300000" min="20" name="Eb" scale="1" value="1737.352167"/>
<spatialModel file="$(LATEXTDIR)/Templates/W44.fits" map_based_integral="true" type="SpatialMap">
<parameter free="0" max="1000" min="0.001" name="Prefactor" scale="1" value="1"/>


Using the Earth Limb Template

The Third LAT catalog required an additional all-sky component to account for emission from the earth limb that was not completely removed from the data at energies below 300 MeV. These are gamma-rays that are in the broad tails of the PSF and so pass the 100 degree zenith angle cut. The spatial template was derived from residuals in the 50–68 MeV energy range and assumed that the spatial shape is independent of energy. The very soft spectral template was derived by adding the limb template to the model. The template is specific to the 4-year data set because the residual earth limb emission depends on the orientation of the LAT.

NOTE: For Pass 8 data analysis, the LAT team recommends using a 90° zenith cut to remove Earth limb photons, rather than using the Limb template. This has also changed their recommendation for how to apply the zenith cut to your data. See the Data Preparation section of the Cicerone for the latest recommendations.

The Earth limb template is the only all-sky model component to use files for both the spatial and spectral models. In general, if you follow the zenith angle recommendations from the LAT team, you will not need to include the Earth Limb template in your analysis. This template is intended for use only for analysis of the 4-year Pass 7 reprocessed dataset used in the Third LAT catalog. To include the Earth limb in your analysis, download the model files from the Third LAT catalog data products page. Add the following source to your XML model, and ensure the path information to each model component is correct.

<source name="EarthLimb" type="DiffuseSource">
<spectrum file="$(PATH_TO_FILES)/limb_4years.txt" type="FileFunction">
<parameter free="1" max="1000" min="1e-05" name="Normalization" scale="1" value="1" />
<spatialModel file="$(PATH_TO_FILES)/limb_4years.fits" type="SpatialMap">
<parameter free="0" max="1000.0" min="0.001" name="Normalization" scale= "1.0" value="1.0"/>