Run Prerequisite
Science Tools (BinnedAnalysis)
Prerequisites
Procedure
- Run gtselect.
- Select GTIs (using gtmktime).
Note: Steps 1 and 2, enable you to eliminate photons coming from the Earth limb by applying a zenith angle cut of 105o; gtmktime also updates the Good Time Intervals (GTIs) to match the FT2 data.
For a more detailed discussion, see Agreed procedures for data preparation: Removing Earth's Albedo and Correcting GTIs.
- Create an exposure cube (using gtltcube).
Note: gtltcube outputs an expCube.fits file, a HealPix table covering the full sky of the integrated livetime as a function.
- Create a 3D Counts Map (using gtbin CCUBE option).
- Create a Binned Exposure Map (using gtexpcube).
- Create a source model XML file (using the Astro Data Viewer tool and the diffuse model recommend by the Diffuse Science Group).
- Compute Source Maps (using gtsrcmaps)
- Run gtselect as follows:
chuckp@noric05 $ gtselect
Input FT1 file[pyLike-ft1.fits]
Output FT1 file[3C454-ft1.fits]
RA for new search center (degrees) (0:360) [180] 343.6566
Dec for new search center (degrees) (-90:90) [0] 16.1494
radius of new search region (degrees) (0:180) [15]
start time (MET in s) (0:) [243756000]
end time (MET in s) (0:) [243842400]
lower energy limit (MeV) (0:) [100]
upper energy limit (MeV) (0:) [300000]
maximum zenith angle value (degrees) (0:180) [105]
Done.
chuckp@noric05 $ |
Note: Since we obtained our data from the Astro Data server and are only running gtselect to filter out any data greater than 105o, the maximum zenith angle, we could simply enter: Input FT1 file; Output FT1 file; radius of the new search region [180]; and maximum zenith angle value [105].
- Verify that the output file is now in your work directory.
2. Select GTIs (using gtmktime) |
|
chuckp@noric02 $ gtmktime
Spacecraft data file[pyLike-ft2-30s.fits]
Filter expression[IN_SAA!=T && LIVETIME>0]
Apply ROI-based zenith angle cut[yes]
Event data file[3C454-ft1.fits]
Output event file name[3C454_back-filtered.fits] |
|
Tip: Use gtvcut if you wish to view the Data SubSpace Keywords. (See gtvcut Help file; also see Data SubSpace Keywords.
3. Create Exposure Cube (using gtltcube) |
|
- Run gtltcube.
chuckp@noric05 $ gtltcube
Event data file[3C454_back-filtered.fits]
Spacecraft data file[pyLike-ft2-30s.fits]
Output file[3C454-expCube.fits]
Step size in cos(theta) (0.:1.) [0.025]
Pixel size (degrees)[1]
Working on file pyLike-ft2.fits
.....................!
chuckp@noric05 $ |
- Verify that the output file is now in your work directory.
4. Create a 3D Counts Map (using gtbin CCube option)
- Run gtbin and select the CCUBE option.
Note: For the binned likelihood analysis, a three-dimensional counts map with an energy axis is required. Since the spectra of gamma-ray sources are expected to be fairly featureless and modeled rather simply, 20 logarithmically spaced energy bands over the range 30 MeV to 200 GeV is sufficient.
chuckp@noric02 $ gtbin
This is gtbin version v2r2p3
Type of output file (CCUBE|CMAP|LC|PHA1|PHA2) [CCUBE]
Event data file name[3C454_back-filtered.fits]
Output file name[3C454-CMap-3D.fits]
Spacecraft data file name[pyLike-ft2-30s.fits]
Size of the X axis in pixels[160]
Size of the Y axis in pixels[160]
Image scale (in degrees/pixel)[0.25]
Coordinate system (CEL - celestial, GAL -galactic) (CEL|GAL) [CEL]
First coordinate of image center in degrees (RA or galactic l)[343.6566]
Second coordinate of image center in degrees (DEC or galactic b)[16.1494]
Rotation angle of image axis, in degrees[0]
Projection method e.g. AIT|ARC|CAR|GLS|MER|NCP|SIN|STG|TAN:[STG]
Algorithm for defining energy bins (FILE|LIN|LOG) [LOG]
Start value for first energy bin in MeV[100]
Stop value for last energy bin in MeV[300000]
Number of logarithmically uniform energy bins[20]
chuckp@noric02 $ |
- Verify that the output file is now in your work directory.
5. Create Binned Exposure Map
(using gtexpcube) |
|
- Run gtexpcube.
chuckp@noric02 $ gtexpcube
This is gtexpcube version N/A
Exposure cube input file name[3C454-expCube.fits]
FT1 events input file name[3C454_back-filtered.fits]
Count map input file name (NONE for manual input of map geometry)[3C454-CMap-3D.fits]
Exposure map output file name[3C454-binned-expMap.fits]
Response function to use. Run gtirfs for a list[P6_V3_DIFFUSE]
Image properties copied from file 3C454-CMap-3D.fits
How are energy layers computed from count map ebounds? (CENTER|EDGE) [CENTER]
Creating an Exposure object from file 3C454-expCube.fits
Using Aeff(s)
Combining exposure from the response function(s), specified by "P6_V3_DIFFUSE":
P6_V3_DIFFUSE::FRONT
P6_V3_DIFFUSE::BACK
Cutoff used: 6.12303e-17
Creating an Image, will write to file 3C454-binned-expMap.fits
Generating layer 0 at energy 124.615 MeV Aeff(0): 1272.78 cm^2
Generating layer 1 at energy 185.963 MeV Aeff(0): 3093.35 cm^2
Generating layer 2 at energy 277.512 MeV Aeff(0): 4417.75 cm^2
Generating layer 3 at energy 414.132 MeV Aeff(0): 5282.8 cm^2
Generating layer 4 at energy 618.009 MeV Aeff(0): 6160.57 cm^2
Generating layer 5 at energy 922.254 MeV Aeff(0): 6847.84 cm^2
Generating layer 6 at energy 1376.28 MeV Aeff(0): 7058.41 cm^2
Generating layer 7 at energy 2053.82 MeV Aeff(0): 7142.12 cm^2
Generating layer 8 at energy 3064.92 MeV Aeff(0): 7226.56 cm^2
Generating layer 9 at energy 4573.78 MeV Aeff(0): 7225.13 cm^2
Generating layer 10 at energy 6825.44 MeV Aeff(0): 7435.04 cm^2
Generating layer 11 at energy 10185.6 MeV Aeff(0): 7608.96 cm^2
Generating layer 12 at energy 15200 MeV Aeff(0): 7719.86 cm^2
Generating layer 13 at energy 22682.9 MeV Aeff(0): 7980.72 cm^2
Generating layer 14 at energy 33849.7 MeV Aeff(0): 8225.6 cm^2
Generating layer 15 at energy 50513.9 MeV Aeff(0): 8354.47 cm^2
Generating layer 16 at energy 75381.9 MeV Aeff(0): 8317.55 cm^2
Generating layer 17 at energy 112492 MeV Aeff(0): 8128.29 cm^2
Generating layer 18 at energy 167872 MeV Aeff(0): 7906.17 cm^2
Generating layer 19 at energy 250516 MeV Aeff(0): 7499.2 cm^2
chuckp@noric05 $ |
- Verify that the output file is now in your work directory.
6. Create a Source Model XML File
(using Astro Data Viewer)
A. Copy the recommended XML model for the
Galactic diffuse emission:
- From your desktop, open a new .xml file in your XML editor.
- Refer to the Diffuse Model for Analysis of LAT Data page in Confluence, then click on the Web Access link near the top of the page.
The following page will be displayed in your browser:

- Click on the latest source_model (e.g., source_model_v02.xml at the time of this writing).
- An xml file be displayed in your browser; copy this file to your new xml file and save that file as 3C454-srcModel.xml.
- Note that there are two files referenced in this copy of the diffuse model that are listed in the diffuse model page shown in step 2, above. (At the time of this writing, those files were isotropic_iem_v02.txt and gll_iem_v02.fit.)
- Select and download these files, then copy them to your work directory on SLAC Public.
B. Generate an XML model for your Source (using the ASP Data Viewer)
and add it to the new source model file that you saved in step 4.
- Launch the ASP Data Viewer.
Select XML Source Model (upper right corner):

- Enter:
- Ra (degrees): 343.6566
- Dec (degrees): 16.1494
- Radius (degrees): 10
- Select Lat Catalog: Fermi Lat Catalog 11 month v1
- Click on the Find button.
The following sources will be displayed:

Observe that Source EMS1524 has an R.A. of 343.502 and a Dec of 16.1513.
- Make sure that all of the check boxes at the left have been selected; then, from the Spectrum List, select PowerLaw2 for each of them, and then click on the Generate XML button.
An xml file will be generated for the selected source(s).
- Copy this xml source model to the xml file you saved in step 4, above.
Your source model XML file should now look similar to this 3C454-srcModel.xml example.
Tip: Be sure that the first line in your xml file is <source_library title="source library">, and that the last line is </source_library>.
- Copy your XML source model file to your work directory on SLAC Public.
7. Compute Source Maps (using gtsrcmaps)
These are model count maps of each source, i.e., multiplied by exposure and convolved with the effective PSF.
If the binned exposure map file does not exist, then gtsrcmaps will compute an all-sky map with that name, using the energy bands of the 3D counts map. This exposure map can be reused for subsequent analyses of regions that cover the same time range and that use the same energy binning.
Since source map generation for the point sources is fairly quick, and maps for many point sources may take up a lot of disk space, it may be preferable to pre-compute the source maps for these sources at this stage. gtlike will compute these on the fly if they appear in the XML definition and a corresponding map is not in the source maps FITS file. To skip generating source maps for point sources, specify "ptsrc=no" on the command line when running gtsrcmaps.
chuckp@noric05 $ gtsrcmaps
Spacecraft data file[pyLike-ft2-30s.fits]
Exposure hypercube file[3C454-expCube.fits]
Counts map file[3C454-CMap-3D.fits]
Source model file[3C454-srcModel.xml]
Binned exposure map[none] 3C454-binned-expMap.fits
Source maps output file[3C454-srcMap.fits]
Response functions[P6_V3_DIFFUSE]
Generating SourceMap for EG_v02Caught St13runtime_error at the top level: BinnedExposure::operator(): The energy 100 is not available.
Here are the relevant energies:
124.615
185.963
277.512
414.132
618.009
922.254
1376.28
2053.82
3064.92
4573.78
6825.44
10185.6
15200
22682.9
33849.7
50513.9
75381.9
112492
167872
250516
chuckp@noric05 $ ls |
- Verify that the output file is now in your work directory. Note that in this case it's not there, so we will rerun gtsrc again; this time without the Binned exposure map.
Note: If the binned exposure map file does not exist, then gtsrcmaps will compute an all-sky map with that name, using the energy bands of the 3D counts map. This exposure map can be reused for subsequent analyses of regions that cover the same time range and that use the same energy binning.
Since source map generation for the point sources is fairly quick, and maps for many point sources may take up a lot of disk space, it may be preferable to pre-compute the source maps for these sources at this stage. gtlike will compute these on the fly if they appear in the XML definition and a corresponding map is not in the source maps FITS file.
To skip generating source maps for point sources, specify gtsrcmaps ptsrc=no on the command line when running gtsrcmaps.
chuckp@noric05 $ gtsrcmaps ptsrc=no
Spacecraft data file[pyLike-ft2-30s.fits]
Exposure hypercube file[3C454-expCube.fits]
Counts map file[3C454-CMap-3D.fits]
Source model file[3C454-srcModel.xml]
Binned exposure map[3C454-binned-expMap.fits] none
Source maps output file[3C454-srcMap.fits] all-sky
Response functions[P6_V3_DIFFUSE]
Generating SourceMap for EG_v02Computing binned exposure map....................!
....................!
Generating SourceMap for GAL_v02....................!
chuckp@noric05 $ |
- Verify that the following files are now in your work directory: none and all-sky.
Note: When creating a python script to perform a binned analyis; as shown below, you will substitute these two files for 3C454-binned-expMap.fits and 3C454-srcMap.fits, respectively, when creating the BinnedObs constructor. For example,
likeObs = BinnedObs('3C454-srcMap.fits', '3C454-expCube.fits', '3C454-binned-expMap.fits', 'P6_V3_DIFFUSE')
will become:
likeObs = BinnedObs('all-sky', '3C454-expCube.fits', 'none', 'P6_V3_DIFFUSE')
You are now ready to perform a Binned pyLikelihood analysis.
Last updated by: Chuck Patterson
08/17/2009 |
|
|