gtexpcube2 Help

Note: gtexpcube2 replaces the gtexpcube application from the map_tools package, and is available in ScienceTools-09-20-00 and higher.

It is strongly recommended that the old gtexpcube application not be used for Likelihood analysis any longer. (See ScienceTools-09-20-00 New Feature Summary in confluence.)

If, for some reason, your work requires that you use an older version, please refer to the archived versions of the old gtexpcube Help and gtexpcube parameters documentation.

Usage: gtexpcube2 infile cmap outfile irfs nxpix nypix binxz coordsys xref yref axisrot proj ebinalg emin emax enumbins ebinfile

The gtexpcube2 tool provides an alternative method for producing binned exposure map, which is normally done automatically by gtsrcmaps (see the gtsrcmaps help). gtexpcube2 generates an exposure map or a set of exposure maps for different energies, multiplying effective area by exposure, and integrating over solid angle. Generating an exposure map with gtexpcube2 requires that you generate an exposure livetime cube file, which can be created using gtltcube. (See gtltcube parameters and gtltcube Help for a description of the livetime cubes, and additional details).

Alternatively, pregenerated exposure cubes can be obtained directly from SLAC's Data Portal. These preexisting exposure cube files may cover the sky region of interest at different time ranges; thus, they may need to be merged before running gtexpcube2. To add two livetime cubes together, use the gtltsum tool (see the gtltsum help for more information). You can also create an exposure map from each livetime cube, and then add the resulting exposure maps; but map generation is CPU-intensive, and it is recommended that you combine the cubes before creating the maps.

As input to gtexpcube2, you will also need to provide: the number of pixels in horizontal and vertical dimensions (i.e., the nxpix and nypix parameters, respectively); the image scale in degrees/pixel (pixscale parameter); the response function (irfs parameter); as well as the horizontal and vertical positions of the center of the image (xref and yref parameters, respectively, in either Galactic or Celestial coordinates according to the coordsys parameter, which can be GAL or CEL). The energy binning parameters should also be input (emin in MeV, emax in MeV, and enumbins).

Optionally, you can produce the exposure map by inputting to gtexpcube2 a counts map FITS file generated with gtbin (see gtbin help), from which gtexpcube2 will match the coordinate projection and grid.

The units of the exposure maps created by gtexpcube2 are: cm2 s1.

After creating the exposure map you can examine the results using; for example, ds9 or fv.

Examples: gtexpcube2

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).

To run gtexpcube2 interactively, enter (at the command line): gtexpcube2
You will then be prompted for parameter values.

Note: Not all parameter are prompted;some are "hidden". If you want to change one of the "hidden" parameters, specify the values in the command line. For example, if you want to change the bincalc parameter, enter (at the command line): gtexpcube2 bincalc=CENTER
In this case the energy layers are computed at the CENTER of the count map ebounds.

Observe that, in the following examples, the interface to gtexpcube2 differs somewhat from the old gtexpcube:

  • Example 1. Used for nominal cases; provides a geometry that matches the counts cube.
prompt> gtexpcube2
Livetime cube file[ltcube_phi4.fits]
Counts map file[cmap.fits]
Output file name[bexpmap_phi4.fits]
Response functions to use[P6_V8_DIFFUSE]
Computing binned exposure map.....................!

Note: The livetime cube (ltcube_phi4.fits) is created using gtltcube phibins=4. If the phi-dependence is missing from the livetime cube, the phi-averaged effective area tabulation will be used.

  • Example 2: Used for specialized cases (e.g., the catalog pipeline); provides an "all-sky" exposure cube. Allows you to specify the geometry when you explicitly set the input counts map to "none".
prompt> gtexpcube2
Livetime cube file[ltcube_phi4.fits]
Counts map file[none]
Output file name[bexpmap_allsky_phi4_nocmap.fits]
Response functions to use[P6_V3_DIFFUSE]
Size of the X axis in pixels[720]
Size of the Y axis in pixels[360]
Image scale (in degrees/pixel)[0.5]
Coordinate system (CEL - celestial, GAL -galactic) (CEL|GAL) [GAL]
First coordinate of image center in degrees (RA or galactic l)[0]
Second coordinate of image center in degrees (DEC or galactic b)[0]
Rotation angle of image axis, in degrees[0]
Projection method e.g. AIT|ARC|CAR|GLS|MER|NCP|SIN|STG|TAN[AIT]
Start energy (MeV) of first bin[100]
Stop energy (MeV) of last bin[300000]
Number of logrithmically-spaced energy bins[3]
Computing binned exposure map.....................!

You are prompted for a Livetime cube file, which in this case is called ltcube_phi4.fits, and it was previously created using gtltcube phibins=4. In the example the geometry was entered by hand, so "none" was selected in the Counts map file parameter. After that, the output FITS file name and the irfs was specified. A map of the entire sky was created, with 0.5 degree bins centered on Galactic Coordinates 1=0, b=0. A total number of 3 energy logarithmic bins were selected starting from an energy of 100 MeV and ending in 300 GeV.

Note: Once the output exposure FITS file has been generated, it can be viewed with a FITS viewer such as ds9 or fv. It contains a data structure with layers corresponding to the number of bins specified.

The previous example can also be run in the command line as follows:

>gtexpcube2 infile= ltcube_phi4.fits cmap=none outfile=
bexpmap_allsky_phi4_nocmap.fits irfs=P6_V3_DIFFUSE nxpix=1 nypix=1 pixscale=0.5 coordsys=GAL xref=0 yref=0 axisrot=0 emin=100 emax=300000 enumbins=3

Once the output exposure FITS file has been generated, it can be viewed with a FITS viewer such as ds9 or fv. It contains a data structure with layers corresponding to the number of bins specified.

  • Example 3. Ignore phi-dependence.
prompt> gtexpcube2 ignorephi=yes
Livetime cube file[ltcube_phi4.fits]
Counts map file[cmap.fits]
Output file name[bexpmap_phi4.fits]
Response functions to use[P6_V8_DIFFUSE]
Computing binned exposure map.....................!
  • Example 4. Enable ebinalg=FILE; ebinalg=LOG is the default.
prompt> gtexpcube2 ebinalg=FILE
Livetime cube file[ltcube_phi4.fits]
Counts map file[none]
Output file name[bexpmap_test.fits]
Response functions to use[P6_V3_DIFFUSE]
Size of the X axis in pixels[360]
Size of the Y axis in pixels[180]
Image scale (in degrees/pixel)[1]
Coordinate system (CEL - celestial, GAL -galactic) (CEL|GAL) [GAL]
First coordinate of image center in degrees (RA or galactic l)[0]
Second coordinate of image center in degrees (DEC or galactic b)[0]
Rotation angle of image axis, in degrees[0]
Projection method e.g. AIT|ARC|CAR|GLS|MER|NCP|SIN|STG|TAN[AIT]
Name of FITS file containing the energy bin definition[ebins.fits]
Computing binned exposure map..................!

Owned by: Jim Chiang

 

Last updated by: Chuck Patterson 03/30/2011