gtdiffrsp Help File

Usage: gtdiffrsp evfile scfile srcmdl irfs

LAT data are modeled using a maximum likelihood method. The unbinned likelihood function is defined in terms of the expected photon distribution for a given source model. That distribution is the convolution of the source model with the instrument response. In particular, the contribution to the log-likelihood associated with an individual photon is computed as the integral of the source model, with the instrument response evaluated at the observed photon direction, energy, and arrival time.

For point sources, the spatial component is a delta-function, so this integral is relatively easy to do. However, for diffuse sources such as the Galactic interstellar component, this integral is computationally intensive since, in principle, it must be performed over the whole sky. Therefore, if possible, it is useful to precompute these quantities.

In the likelihood calculations, it is assumed that the spatial and spectral parts of a source model factor in such a way that the integral over spatial distribution of a source can be performed independently of the spectral part; in this case, the integral over the instrument response can be precomputed for each diffuse model component.

The gtdiffrsp tool will perform these integrals and add the results (as an additional column for each diffuse source) to the input FT1 file. Hereafter, these quantities will be referred to as the "diffuse responses".

If the diffuse responses are not pre-computed using gtdiffrsp for a given source, gtlike will throw an exception and report the missing column. The name of each column is a combination of the name of the diffuse source and the name of the response function. (See the example below.) You may use the FTOOL fdelcol to delete columns if you want to restore the modified file. (See fdelcol help more information.)

For large datasets, in order to save calculation time for the likelihood analysis, you may wish to first pre-select the data to be analyzed using gtselect and gtlike and then run gtdiffrsp on the filtered data. However, if you're analyzing several regions-of-interest from the same data, it may be more advantageous to run gtdiffrsp on the entire dataset, *then* make your selections for each ROI using gtselect.

You may overwrite the columns produced by gtdiffrsp using the clobber=yes parameter.

BE ADVISED that gtdiffrsp is computationally intensive and, depending on the size of your event files, can take hours to run!

Examples: gtdiffrsp

Parameters are passed following the FTOOLs model (i.e., they can be passed interactively by: answering a prompt; as a list in a command line; or by editing the parameter file). This allows calling gtdiffrsp from a script.

To be prompted for gtdiffrsp parameter values, enter (at the command line): gtdiffrsp

Note: Not all parameters are prompted; some are "hidden". If you want to change one of the "hidden" parameters, specify its value in the command line. For example, if you do not want to overwrite the existing output file, enter (at the command line): gtdiffrsp clobber=no

An example of how to run the tool is given below:

> gtdiffrsp
Event data file [events] : ps_filtered.fits
Spacecraft data file [FT2.fits] :
Source model file [src_model.xml] :
Response functions to use [P6_V3_DIFFUSE] :

The Extragalactic and GalProp sources (i.e., the Galactic emission modeled by the GALPROP program) were part of the source model file for this example. This procedure must be carried out for all event files to be included in an analysis, and is facilitated by the ability to pass the list of files (in an ASCII file) at the "Event data file" prompt.

The previous example could also be run from the command line as follows:

gtdiffrsp evfile=ps_filtered.fits scfile=FT2.fits srcmdl=src_model.xml irfs=P6_V3_DIFFUSE


Owned by: J. Chiang

 

Last updated by: Chuck Patterson 01/19/2011