See:

  • Introduction to the Standard Analysis of LAT Data

On this page, see:

Also see:

If you plan to publish, first:

Introduction to the Standard Analysis of LAT Data

Notice: The Fermi code has not been released to the public and is for use by members of the LAT Collaboration only!

In general, it can be said that there are two types of analyses of LAT Data: a "point" source analysis (e.g., supernova remnant) and an "extended", diffuse source analysis (i.e., source is 2~3o across); for example, the Large Magellanic Cloud.

Extended Sources. Extended sources are, at a minimum, many light years across and therefore cannot vary over the course of a year (i.e., cannot get brighter or dimmer). As a result, a standard analysis consists of performing a spectral analysis; no light curve is generated.

Point Sources. In contrast, a standard analysis of point sources consists of performing both a spectral analysis and generating a light curve and, for the purposes of this discussion, we will focus on a standard point source analysis using the interactive LAT analysis tool (iLat), a python software wrapper currently installed and running on SLAC's linux batch farm and using the LAT software environment variables and tools.

The core of the iLAT wrapper uses the Automated Science Processing (ASP) scripts; Science Tools; and FTOOLS. The matplotlib (pylab) module provides plotting capabilities, and the standalone script used by the catalog pipeline is used to perform likelihood analysis.

Review Topics

Before performing a point source analysis, you may wish to review some or all of the following topics:

LAT Data Products

A LAT data analysis requires information about where the LAT was pointing and what was the observing efficiency. This data is provided by the event and spacecraft FITS files, respectively referred to as FT1 and FT2 files.

Origin of the Photon Data

These two filetypes result from the processing of the data downlinked from the Fermi spacecraft (considered to be 'Level 0' data), and are therefore regarded as 'Level 1' data.

LAT Level 1 processing involves reconstructing the interaction of the event in the LAT from the 'hits' in the various detectors, identifying the type of event (e.g., astrophysical photon), and characterizing the event's relevant physical parameters (e.g., direction, energy).

The characterization of an event results in a set of ~200 parameter values that make up the merit ntuple. Since most events are not astrophysical photons, and most of the parameters describing an event are not relevant for data analysis, only a small set of parameters for the counts have been extracted from the event data to form the event file you will normally use.

Note: The full event dataset will always be available for users who wish to examine the full set of parameters of the astrophysical counts, as well as many events that are not included in the event files.

Photon Classification

During reconstruction, the LAT team makes various cuts that will classify the events based on the probability that they result from photons, and on the quality of the reconstruction. The events will be separated into various event classes, and each class will be characterized by its own set of instrument response functions. Note that this reconstruction methodology and event class cuts have evolved, and they are likely to continue to do so.

Event Classes. There are currently three event classes:

  • The diffuse class has the smallest point spread function (PSF) and includes the smallest fraction of background counts; by being more restrictive, the diffuse class has the smallest effective area. This class is intended for the study of diffuse emission.
  • The source class is a superset of the diffuse class; by loosening the event selection cuts, the effective area is increased at the expense of including a higher fraction of background counts and photons with a larger PSF.

The trade-off between effective area, background and PSF is favorable for analyzing point sources.

  • The transient class loosens the selection cuts even further, and is thus a superset of the source class. The effective area is increased, especially below 250 MeV, at the expense of a larger PSF and additional background events.

This class is ideal for studying transients on timescales of less than an hour, such as gamma-ray bursts, because almost all the events originate in the source.

Contents of the Event (FT1) Files. For each astrophysical photon the event file contains the following information (the list does not include all possible quantities):

  • Energy
Apparent energy of the event, in MeV.
  • RA
Right Ascension (J2000) of the photon's apparent origin, in degrees
  • Dec
Declination (J2000) of the photon's apparent origin, in degrees.
  • L
Galactic longitude, in degrees.
  • B
Galactic latitude, in degrees.
  • Theta
Inclination angle, the angle from the LAT's normal to the photon's apparent origin, in degrees.
  • Phi
Azimuthal angle, the angle of the photon's apparent origin around the LAT's normal, in degrees.
  • Zenith Angle
Angle of the photon's apparent origin to the Earth-spacecraft vector, in degrees.
  • Earth Azimuth Angle
Angle of the photon's apparent origin around the Earth-spacecraft vector, in degrees.
  • Time
Mission elapsed time (MET), in seconds.
  • Analysis Class
Classification of the event.
Note: Additional information can be added to a FITs file, either as a keyword or an additional column, as long as its name differs from that of an existing type of data. Thus, additional information may be contained in event files.

Contents of the Spacecraft (FT2) Files. Spacecraft files contain the following information for 30 second intervals (some intervals may be shorter):

  • Start and Stop Time
Beginning and end of the interval in MET.
  • Stop Time
End of the interval in Mission Elapsed Time
  • Positions
Position and orientation of the spacecraft and the LAT at the beginning of the interval in various coordinates.
  • McIlwain Parameters
Two parameters that describe the strength and gradient of the Earth's magnetic field at the spacecraft at the beginning of the interval.
  • SAA Flag
Indicates whether the LAT is off because Fermi is in the high radiation field of the South Atlantic Anomaly.
  • LAT Mode
LAT's operational mode during the interval.
  • Livetime
Detector's livetime for the time interval.

Other Files. In analyzing the LAT data you will use other files, some of which the tools access without your intervention, some of which are intermediate products of the analysis:

  • Instrument Response Functions (IRFs)
The LAT's response will be characterized by a number of functions with empirically determined parameters. [See: Event Classes and Instrument Response Functions (IRFs).]
  • Diffuse Emission Map
The LAT will detect point sources on top of the bright diffuse emission from the Galaxy and extragalactic sources. The LAT team will provide one or more models of this diffuse emission, and the user will be able to substitute his/her own.
  • Pulsar Ephemerides
A database of ephemerides of the pulsars that the LAT might detect.
  • Livetime Cubes

Over a specified time range, a livetime cube provides the livetime the LAT observed a region of the sky at a given inclination angle. (See Precomputation of Likelihood Quantities.)

Because the computation of these data is very time consuming, they are provided for specific time ranges.

  • Source Definition
Trial and fitted source models are stored in XML files..
  • Binned Spectra
The LAT photon data can be binned into spectra stored in the common PHA format; this will be common for gamma-ray burst analysis.
  • Bin Definitions
Grids used to bin spectra in time and energy can be input through FITS files.
  • Response Matrices
To analyze binned spectra, the IRFs must be integrated over space and stored in the common 'RSP' format.

 

 

FT1 & FT2 Files/Formats

Starting with the signals from different components of the LAT resulting from interactions of charged particles, the LAT team has reconstructed the paths of the electron-positron pair produced when a gamma ray interacts with a tungsten atom in the LAT, and then calculated the gamma ray's arrival time, incident energy, and origin. The resulting data are stored as FITS files.

FITS File Format

The Flexible Image Transport System (FITS) file format was originally developed to provide a standard image file format, but has been expanded to provide standards for many different file types used in astronomy. The files consist of a series of one or more 'Header and Data Units' (HDUs), each of which contains an ASCII header followed by a binary table.

The ASCII header describes the contents of the binary table (e.g., the column names and units); thus, FITS files are largely self-defining. Headers have rows of text consisting of 8 character keywords followed first by the value of the keyword and then by a comment describing the keyword.

The first ('primary') HDU is reserved for images, and often has no binary table and only a simple header (called the primary header) identifying the file (e.g., name, date of creation, mission). Subsequent HDUs are called 'extensions', which tend to contain copious information pertaining to that extension.

There are standard FITS file formats; for example, PHA for a binned spectrum. These standard file formats have required extensions, and required keywords in the headers of these extensions. Similarly, there are standard extensions (with standard keywords)—such as EBOUNDS for storing an energy grid—that can be used in mission-specific file formats.

Note: Fermi FITS files are defined in the Science Data Products File Format Document (GLAST-GS-DOC-0001 in the Fermi ground system document system) and can be found in the project's Science Data Products File Format Document.

 

FTOOLS

FTOOLS (fcopy, fdump, fmodhead, fplot, and fverify) allow you to examine, copy and manipulate FITS files. The tool 'fv' is a powerful GUI-based utility that should satisfy most needs to examine and modify FITS files. 'fv' will display images, but 'ds9' was designed specifically to display and manipulate images.

 

Event Classes and Instrument Response Functions (IRFs)

IRFs describe LAT performance in terms of transformation probability from a true physical quantity (i.e., energy and direction of photons) to the corresponding measured quantity. It is important to note that the IRFs depend not only on the instrument itself, but also on the reconstruction algorithms, the background rejection algorithm, and on the selection of events.

At the time this tutorial was written, the latest Instrument Response Function set was P6_v2 (Glast Release v15r0). Pass_6 provides the default cuts for three event classes:

  • Transient
  Used primarily for analysis of Gamma-ray Bursts; cuts eliminate background.
  • Source
  Least used; cuts eliminate energies <100MeV.
  • Diffuse
  Used for most analyses; cuts provide an effective balance between collection area and residual background rate.

Important! You must set the irf according to the evtclass selection (e.g., setirfs P6_V1_DIFFUSE).

Refer to: LAT IRFs (Instrument Response Functions)

Also see: Summary of response function sets page in Confluence for the latest information on event classes

 

Data Selection

Data selection precedes data exploration. The fundamental LAT data are simple event lists, and data selection involves making cuts on the event lists. Data selections can be made when extracting the LAT event list from the database, and further selections are made using the gtselect tool. Thus, you can extract data for a source spanning a large time range, and use gtselect to break this event list into a series of shorter time ranges. You can extract LAT events from a large spatial area that includes a gamma-ray burst, and after localizing the burst, you can select the counts from a smaller area centered on the burst.

gtselect – When selecting data, cuts are made using the gtselect tool when extracting data from event lists. This tool enables you to extract data for a long span of time and divide the event list into a series of shorter time ranges. LAT events can also be extracted from a large spatial area that includes a GRB. After localizing the burst, counts can then be selected from a smaller area centered on the burst. (See gtselect.)

Note: After selection, use 'fv' and 'ds9' to display count plots as a function of position, time, or energy. When the number of counts becomes excessive, use gtbin to bin the data in time energy, or space; then use fv and ds9 to plot the resulting FITS files.

gtbin – Bins GBM or LAT events list in time, energy, and/or space to produce light curves, spectra, count cubes, or count maps, respectively. (See gtbin.)

 

Lightcurves

Lightcurves depict source intensity as the detected count rate, not as photon or energy flux. The gtbin tool lightcurve (LC) option requires the name of the input and output files, and then presents three time binning options:

  • Linear (LIN) – requires start and stop times in MET.
  • Constant signal-to-noise (SNR) ratio – requires start and stop times in MET, plus SNR value.
  • Specified time bins (FILE) – requires name of the input FITS file containing the time binning. (Note: Use gtbindef to convert an ASCII file with the times into a properly formatted FITS file.)

The gtbin FITS file output contains the lightcurve, which can now be plotted.

For examples, see

 

Count Maps

Binned count maps for LAT data depict the number of counts in spatial pixels:

  • gtbin's 'CMAP' option provides a count map in one energy band, i.e., the energy band is selected when creating the event file input to gtbin, and all events are binned in a single event file.
  • gtbin's 'CCUBE' option is used to bin multiple energy bands.

Both the CMAP and CCUBE options require you to specify the:

  • range of time for which the event file is to be created, and
  • rectilinear spatial grid, including the:
    • number of pixels in each direction,
    • pixel size,
    • coordinate system,
    • center of the grid, and the
    • type of projection.

    Note: Ten projections are provided (see Calabretta & Greisen 2002, A&A, 395, 1077); AIT for 'Aitoff' is suggested.

For the CCUBE option, you must also specify the energy bands to be used:

  • Linear binning (LIN) – minimum and maximum energies, and the number of bins.
  • Logarithmic (LOG) – minimum and maximum energies, and the number of bins; the software will calculate the bin edges. (probable default)
  • User specified energy bins (FILE) – name of the FITS file with the energy binning.

Note: Use gtbindef to convert an ASCII file with the energy bands into the properly formatted FITS file.

Output map files can be viewed by fv or ds9.

For examples, see:


Last updated by: Chuck Patterson 09/08/2010