gtbary Help File
Usage: gtbary evfile scfile outfile ra dec
Performs the barycenteric correction to photon arrival times in input event file(s) using a GLAST orbit file.
Upon startup, the user is prompted for the:
- Input file whose times will be corrected.
- Orbit file to use for the correction.
- Output file (which may be the same as the input file).
- Right Ascension (RA) and Declination (Dec) of the source (pulsar) location from which to correct the photons.
Three additional ancillary files are needed by gtbary/axBary in order to perform the correction:
- JPLEPH.405
- leapsec.fits
- tai-utc.dat
The program looks for these files in the directory given by the TIMING_DIR environment variable. For the moment, these files are included in the data subdirectory of the timeSystem package.
In the event that an error occurs during the correction, the input file will be left in its original state, even if the correction is being performed in place. When debugging is enabled (by typing debug=yes on the command line), a temporary file containing the state of the correction when the error occurred will be left for investigative purposes. The temporary file name is identical to the output file name with an added suffix of .tmp.
Note: The heart of this executable is taken from axBary by Arnold Rots at SAO. Minimal modifications were made to axBary to work with GLAST orbit files. This is also equivalent to the barycorr tool in HEADAS.
Examples: gtbary
In the following example, gtbary processes the event file named:
my_pulsar_events_v3.fits
using the spacecraft data file named:
my_pulsar_spacecraft_data_v3.fits
for a pulsar located at the:
right ascension of: 85.0482
declination of -69.3319
which is the location of PSR B0540-69 in LMC.
> gtbary
This is gtbary version v4
Event data file name [] : my_pulsar_events_v3.fits
Spacecraft data file name [] : my_pulsar_spacecraft_data_v3r1.fits
Output event data file name [] : my_pulsar_events_bary_v3.fits
True RA of point source (degrees) [0.] : 85.0482
True DEC of point source (degrees) [0.] : -69.3319
===> No barycenter correction applied to HDU 0
TIMESYS is
axBary: Using JPL Planetary Ephemeris DE-405
axBary: Using JPL Planetary Ephemeris DE-405 |
When successful, gtbary creates an output file (my_pulsar_events_bary_v3.fits in the above example) that is ready to be given to a non-GLAST temporal analysis tool that is designed to analyze an event list in the HEASARC standard temporal file format.
gtbin Help File
Usage: gtbin evfile scfile outfile algorithm ebinalg emin emax enumbins denergy ebinfile tbinalg tstart tstop dtime tbinfile snratio lcemin lcemax nxpix nypix binsz coordsys xref yref axisrot proj
Bins an event list in time, energy, and/or space to produce light-curves, spectra, count cubes or count maps, respectively.
Spectra: Events can be binned into a single spectrum, resulting in a PHAI file, or into a series of spectra for different times series in a single FITS file, resulting in a PHAII file. The energy binning can be provided by a:
- user-specified file created by a previous gtbin run, or by the
- gtbindef tool (see the gtbindef help).
You may also select linear or logarithmic energy binning. Users should select the binning algorithm type using the "ebinalg" parameter (see the "PARAMETERS" section).
The time binning (when a PHAII file is created) can be provided by a:
- user-specified file created by a previous gtbin run (or by gtbindef), or by
- user-selected linear time bins or constant signal-to-noise ratio per time interval
(see the "tbinalg" parameter description below).
Light Curve: The gtbin tool has the option to generate light curves from event data, in which case the events are binned by time. Time binning can be provided by a:
- user-specified file created by a previous gtbin run, or by
- gtbindef (tbinalg=FILE).
The user can select linear time bins (tbinalg=LIN), or constant signal-to-noise ratio per time bin (tbinalg=SNR). (See the "tbinalg" parameter description below).
Count Map/Count Cube: Count maps (2-D images) and count cubes (3-D images) can also be created by gtbin. Events are binned into user-specified rectangular pixels. (See the description of the parameters "nxpix", "nypix", "binsz" in the PARAMETERS section).
Input events can be binned in sky X-Y projected coordinates (algorithm=CMAP) to produce:
- a single two-dimensional spatial count map, or
- binned in sky X-Y projected coordinates for different energy bins
(algorithm=CCUBE) to produce a three-dimensional spatial-spectral
count cube.
Many different projection methods are available:
- Aitoff [AIT], Zenithal equal- area [ZEA]
- Zenithal equidistant [ARC]
- Plate Carree [CAR], Sanson-Flamsteed [GLS]
- Mercator [MER]
- North-Celestial-Pole [NCP]
- Slant orthographic [SIN]
- Stereographic [STG]
- Gnomonic [TAN].
Note: See Calabretta & Greisen 2002, A&A, 395, 1077 for definitions of the projections. The resulting count map can then be viewed graphically, e.g., by fv or ds9.
Examples: gtbin
Parameters are passed followinb the FTOOLs model: by answering from a prompt; as a list in a command line; or by editing the parameter file. The command line option facilitates calling gtbin from a script.
To be prompted for gtbin parameter values, simply type in the command line: gtbin
Note: Not all parameters are prompted: some of the parameter are "hidden". If you want to change one of the "hidden" parameter you should specify its value in the command line. For example if you do not want to overwrite the existing output file you should type in the command line: gtbin clobber=no
Keep in mind that gtbin has several options to create different outputs, so some parameters are specific for each option. Some examples are given below to create count maps, light curves, and
spectra.
Example 1: How to create a count map (CMAP):
> gtbin
This is gtbin version v2
Type of output file <CCUBE|CMAP|LC|PHA1|PHA2> [CCUBE] : CMAP
Event data file name [_3C279_3C273_back_filtered.fits] :
Output file name [_3C279_3C273_back_cnts.fits] : _3C279_3C273_back_cnts_v2.fits
Spacecraft data file name [../FT2/SC2_FT2_v2.fits] :
Size of the X axis in pixels [120] :
Size of the Y axis in pixels [120] :
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) [193.98] :
Second coordinate of image center in degrees (DEC or galactic b) [-5.82] :
Rotation angle of image axis, in degrees [0] :
Projection method <AIT|ARC|CAR|GLS|MER|NCP|SIN|STG|TAN> [AIT] : |
In this example the algorithm used is CMAP (algorithm = CMAP), which create a counts map. The input event FITS file name is:
_3C279_3C273_back_filtered.fits
(evfile = _3C279_3C273_back_filtered.fit),
while the output FITS file name is:
_3C279_3C273_back_cnts_v2.fits
(outfile = _3C279_3C273_back_cnts_v2.fits).
The coordinate system is:
celestial (coordsys = CEL), and the center of the map is at coordinates:
RA=193.98, DEC=-5.82. The projection method is AIT (proj = AIT) and
there is not axis rotation (axisrot = 0). The size of the map is
120x120 pixels (nxpix = 120, nypix = 120) with a scale of 0.25
degrees/pixel (binsz = 0.25). The spacecraft data file is called:
SC2_FT2_v2.fits.
The previous example can be also run from the command line as shown below:
> gtbin evfile=_3C279_3C273_back_filtered.fits
scfile=../FT2/SC2_FT2_v2.fits outfile=_3C279_3C273_back_cnts.fits
algorithm=CMAP nxpix=120 nypix=120 binsz=0.25 coordsys=CEL
xref=193.98 yref=-5.82 axisrot=0 proj=AIT
Example 2: How to create a counts map with different energy bins (CCUBE MAP):
> gtbin
This is gtbin version v2
Type of output file <CCUBE|CMAP|LC|PHA1|PHA2> [CCUBE] :
Event data file name [_3C279_3C273_back_filtered.fits] :
Output file name [_3C279_3C273_back_cnts.fits] :
Spacecraft data file name [SC2_FT2_v2.fits] : ../FT2/SC2_FT2_v2.fits
Size of the X axis in pixels [120] :
Size of the Y axis in pixels [120] :
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) [193.98] :
Second coordinate of image center in degrees (DEC or galactic b) [-5.82] :
Rotation angle of image axis, in degrees [0] :
Projection method <AIT|ARC|CAR|GLS|MER|NCP|SIN|STG|TAN> [AIT] :
Algorithm for defining energy bins <FILE|LIN|LOG> [LOG] :
Start value for first energy bin in MeV [30] :
Stop value for last energy bin in MeV [200000] :
Number of logarithmically uniform energy bins [21] : |
In this example, the algorithm used is CCUBE (algorithm = CCUBE), which create a counts map for different energy bins. The input event FITS file name is:
_3C279_3C273_back_filtered.fits (evfile =
_3C279_3C273_back_filtered.fit), while the output FITS file name is:
_3C279_3C273_back_cnts.fits (outfile =
_3C279_3C273_back_cnts.fits).
In this case, the energy bins are logarithm (ebinalg = LOG) and 21 bins were selected
(enumbins = 21). The initial energy for the first bin is 30 MeV (emin = 30), while
the last energy for the last bin is 200000 MeV (emax = 200000). The coordinate system is celestial (coordsys = CEL) and the center of the map is at coordinates: RA=193.98, DEC=-5.82. The projection method is AIT (proj = AIT) and there is not axis rotation (axisrot = 0). The size of the map is 120x120 pixels (nxpix = 120, nypix = 120) with a scale of 0.25 degrees/pixel (binsz = 0.25). The spacecraft data file is called: SC2_FT2_v2.fits.
The previous example can also be run from the command line as shown below:
> gtbin evfile=_3C279_3C273_back_filtered.fits
scfile=../FT2/SC2_FT2_v2.fits outfile=_3C279_3C273_back_cnts.fits
algorithm=CCUBE ebinalg=LOG emin=30 emax=200000 enumbins=21
nxpix=120 nypix=120 binsz=0.25 coordsys=CEL xref=193.98 yref=-5.82
axisrot=0 proj=AIT
Example 3: How to create a light curve
An example of how to run gtbin to create light curves is given below:
> gtbin
This is gtbin version v2
Type of output file <CCUBE|CMAP|LC|PHA1|PHA2> [LC] :
Event data file name [_3C279_3C273_back_filtered.fits] :
Output file name [_3C279_3C273_back_lc.fits] :
Spacecraft data file name [../FT2/SC2_FT2_v2.fits] :
Algorithm for defining time bins <FILE|LIN|SNR> [LIN] :
Start value for first time bin in MET [252390000] :
Stop value for last time bin in MET [254966400] :
Width of linearly uniform time bins in MET [10000] : 20000 |
In this case:
The event FITS input file is called 3C279_3C273_back_filtered.fits
(evfile =_3C279_3C273_back_filtered.fits); the spacecraft data
file is called SC2_FT2_v2.fits (scfile = ../FT2/SC2_FT2_v2.fits);
the output file with the light curve is called _3C279_3C273_back_lc.fits
(outfile = _3C279_3C273_back_lc.fits). The algorithm used is LC,
which creates the light curve (algorithm = LC).
The time bins are linear (tbinalg = LIN) with steps of 20000 MET seconds
(dtime = 20000). The start time is 252390000 MET seconds (tstart = 252390000) and the stop time is 254966400 MET seconds (tstop = 254966400). Since the output is not animage, but rather a table of values, you may look at it with fv instead of ds9.
That last example could also be run in the command line in this way:
> gtbin evfile=_3C279_3C273_back_filtered.fits
scfile=../FT2/SC2_FT2_v2.fits outfile=_3C279_3C273_back_lc.fits
algorithm=LC tbinalg=LIN tstart=252390000 tstop=254966400
dtime=20000
Example 4: How to create a light curve with GBM data:
prompt> gtbin
This is gtbin version v1
Type of output file <CCUBE|CMAP|LC|PHA1|PHA2> [LC] : lc
Event data file name [GLG_TTE_N0_BN080104514_V01.FIT] :
GLG_TTE_N0_BN080104514_V01.FIT
Output file name [GRB_080104A_N0_lc.fit] : GRB_080104A_N0_lc.fit
Spacecraft data file name [none] :
Algorithm for defining time bins [LIN] :
Start value for first time bin [221142009] : 221142009
Stop value for last time bin [221142055] : 221142055
Width of linearly uniform time bins [0.25] : |
In this example:
The algorithm LC is selected (algorithm = LC). The event data file is called GLG_TTE_N0_BN080104514_V01.FIT (evfile = GLG_TTE_N0_BN080104514_V01.FIT)
and is a GBM data file. The output file name is GRB_080104A_N0_lc.fit (outfile =
GRB_080104A_N0_lc.fit).
A spacecraft file is not needed. The start and stop time of the bins are 221142009 and 221142055 MET seconds respectively (tstart = 221142009, tstop =221142055).
Since linear bins were selected (tbinalg = LIN), gtbin prompts for the width of the bins in seconds; here 0.25 seconds bin is selected (dtime = 0.25).
And, since the output is not an image, but rather a table of values, you may look
at it with fv.
Example 5: How to create a spectrum over a single time bin:
> gtbin
This is gtbin version v2
Type of output file <CCUBE|CMAP|LC|PHA1|PHA2> [PHA1] :
Event data file name [3c279.fits] :
Output file name [3c279_pha1.fits] :
Spacecraft data file name [../FT2/SC2_FT2_v2.fits] :
Algorithm for defining energy bins <FILE|LIN|LOG> [LOG] :
Start value for first energy bin in MeV [30] :
Stop value for last energy bin in MeV [200000] :
Number of logarithmically uniform energy bins [10] : 20 |
In this example:
The energy spectra of the quasar 3C279 is generated. Previously the tool gtselect (see the gtselect documentation) was run in order to select a small region (of 4 degrees radius) of the sky around the 3C279 coordinates (193.98, -5.82) previously to run gtbin. An energy spectra between 30 MeV (emin = 30) and 200000 MeV (emax = 200000) of 20 (enumbins = 20) logarithmic bins (ebinalg = LOG) is produced. You can see the spectra using, for example, the fv tool.
Example 6: How to create set of spectra over several time bins:
> gtbin
This is gtbin version v2
Type of output file <CCUBE|CMAP|LC|PHA1|PHA2> [PHA1] : PHA2
Event data file name [3c279.fits] :
Output file name [3c279_pha1.fits] : 3c279_pha2.fits
Spacecraft data file name [../FT2/SC2_FT2_v2.fits] :
Algorithm for defining energy bins <FILE|LIN|LOG> [LOG] :
Start value for first energy bin in MeV [30] :
Stop value for last energy bin in MeV [200000] :
Number of logarithmically uniform energy bins [20] :
Algorithm for defining time bins <FILE|LIN|SNR> [LIN] :
Start value for first time bin in MET [252390000] :
Stop value for last time bin in MET [254966400] :
Width of linearly uniform time bins in MET [20000] : |
In this example:
The energy spectra PHA2 file of the quasar 3C279 is generated. The tool gtselect (see the gtselect documentation) was run in order to select a small region (of 4 degrees radius) of the sky around the 3C279 coordinates (193.98, -5.82) previously to run gtbin. An energy spectra between 30 MeV (emin = 30) and 200000 MeV (emax = 200000) of 20 (enumbins = 20) logarithmic bins (ebinalg = LOG) is produced.
The data is also binning linearly in time (tbinalg = LIN), starting from 252390000 MET seconds (tstart = 252390000) and ending at 254966400 MET seconds (tstop = 254966400) with time bins of 20000 MET seconds (dtime = 20000). You can see the spectra produced using, for example, the fv tool.
gtbindef Help File
USAGE: gtbindef bintype binfile outfile energyunits
gtbindef creates the FITS file that is needed by the gtbin tool (see gtbin) in order to generate customized binning in energy or time of a given event file. This tool complements the gtbin tool and is used in combination with it. The output FITS file created by gtbindef, with information about the user-specified binning, will be used as input to gtbin.
Example: Use gtbindef to create a FITS file for input to gtbin in order to generate specific energy binning
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 be prompted for gtbindef parameter values, simply type (at the command line): > gtbindef
Note: Not all parameters are prompted; some are "hidden". In order to change one of the "hidden" parameters, specify its value in the command line. For example, to prevent overwriting an existing output file, type (at the command line): > gtbindef clobber=no
First, create an ASCII file as input to gtbindef. This file will have the initial and final energies for each bin. For example, suppose the input ASCII file is named energy_bins_gtbindef, and it contains:
30 50
50 100
100 300
300 1000
1000 3000
3000 10000
10000 200000
Then gtbindef can be run as follows:
> gtbindef
This is version N/A
Type of bins, E -- energy or T -- time [E] :
File containing the ascii bin definitions [] : energy_bins_gtbindef
Output file name [] : energy_bins_gtbindef.fits
Units of input energy bins: MeV, GeV, keV, or eV [MeV] : |
In this case:
An energy binning was selected (bintype = E). The name of the ASCII file is "energy_bins_gtbindef", and it is passed in the binfile parameter (binfile = energy_bins_gtbindef).
The output FITS file is energy_bins_gtbindef.fits (outfile =
energy_bins_gtbindef.fits), and the units used are MeV (energyunits =
MeV).
After running gtbindef, run gtbin to create the spectra using the selected bins. See the gtbin documentation for more information.
gtbkg Help File
Usage: gtbkg phafile outfile scfile expcube expmap irfs srcmdl target
The gtbkg tool creates a background spectrum file (PHA1), using as input several files that are created with other tools, including the:
- input spectrum file (PHA1) created by gtbin.
- live-time file, by gtltcube.
- exposure map (i.e., the same as the one created for the unbinned likelihood analysis and created by gtexpmap).
- source xml file (i.e., the same as the one used for the gtlike tool and created with ModelEditor; see the ModelEditor help).
The spectrum file that is created (in PHA1 format) contains total counts based on a Likelihood source model, and it covers the same energy bands and region-of-interest as the input PHA1 file (see the gtlike documentation for details). The model will typically contain interstellar and extragalactic diffuse components, as well as nearby point sources.
Example: gtbkg
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 be prompted for gtbkg parameter values, simply type (at the command line): gtbkg
Note: Not all parameters are prompted; some parameters are "hidden". To change a "hidden" parameter, specify its value in the command line. For example, to prevent overwriting an existing output file, type: gtbkg clobber=no
An example of how to run the tool is given below:
> gtbkg
pha file [] : 3C279_3C273_back_filtered_pha1.fits
output file [] : pha1.fits
Spacecraft file [] : SC2_FT2_v2.fits
Exposure hypercube file [] : expCube.fits
Exposure file [none] : expMap.fits
Response functions to use [HANDOFF] :
Source model file [] : src_model.xml
Target source name (excluded from background estimate) [none] :3C279
Excluding source 3C279 from background model. |
The file 3C279_3C273_back_filtered_pha1.fits was created using gtbin (option PHA1) from an original event file. The expMap.fits and the expCube.fits files were created with gtexpmap and gtltcube, respectively. 3C279 is the source excluded from the background model. The name "3C279" is the same as the one in the source model file.
To run the same example at the command line, type:
>gtbkg phafile=3C279_3C273_back_filtered_pha1.fits outfile=pha1.fits
scfile=SC2_FT2_v2.fits expcube=expCube.fits expmap=expMap.fits
irfs=HANDOFF srcmdl=src_model.xml target=3C279
Excluding source 3C279 from background model.
gtburstfit Help File
Usage: gtburstfit evfile fitguess amp time0 tau1 tau2 bckgnd
Analyzes burst light curves by applying a Bayesian algorithm to determine the optimum set of blocks to follow the burst profile shape, then optionally fitting a model to the data using the Bayesian Block definitions to determine the number of model components and initial values for the model parameters.
Blocks may also be used by gtburstfit to construct a pulse model, which gtburstfit can fit to the data. The model used to fit the data is a constant background added to a sum of terms of the form:
A * exp(tau1 / (t - time0) + (t - time0) / tau2),
where
A is the amplitude of the pulse, time0 is the time of the pulse,
tau1 is the "Rise Coefficient", and tau2 is the "Decay Coefficient" of
the pulse.
The number of these terms is determined automatically by gtburstfit by looking for peaks and valleys in the Bayesian block definitions, and using these to determine the number of peaks detected, and their approximate positions, heights and widths.
As input, gtburstfit uses a time binned data file. The original event data file can be obtained from the GLAST Science Support Center (GSSC) website, and can be binned with gtbin using the light curve (LC) option. (See the gtbin documentation.)
The gtburstfit output includes the values of the amplitude, time of the pulse, "Rise Coefficient" and "Decay Coefficient" for each pulse, background coefficient, and Chi Square of the fit. By default the tool displays a plot showing the data, the Bayesian Blocks (which were created for the data), and the results of the fit. The user may zoom in the resulting plot using the left mouse button. The right mouse button may be used to add new peaks to the model; these may be included on subsequent runs of the tool (when gui=yes and fitguess=calc only).
Example: gtburstfit
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 be prompted for gtburstfit parameter values, simply type (at the command line): gtburstfit
Note: Not all parameters are prompted; some parameters are "hidden". To change a "hidden" parameter, specify its value in the command line. For example, if you want to include a title in your plot, you may set the parameter title at the command line by entering:
gtburstfit title=MyPLOT
where
"MyPLOT" will be the title of your plot.
An example of how to run gtburstfit using the AUTO option is given below:
> gtburstfit
This is gtburstfit version N/A
Name of file containing events [] : LAT_090119205_v4_filtered_lc.fits
How will initial values for fit be determined <AUTO|MAN|CALC> [AUTO] :
After initial guess but before any fitting, reduced chi square is 0.83314586
Parameters are:
Peak 1:
Amplitude = 1.683346795914409
Time0 = 254033756.004999995231628
Tau1 = 2.020000010728836
Tau2 = 2.020000010728836
Background = 0.000863557036068
Minuit abnormal termination. (No convergence?)
After fit, reduced chi square is 0.31889256
Parameters are:
Peak 1:
Amplitude = 1.269671380418241
Time0 = 254033756.004999995231628
Tau1 = 7.261440266831805
Tau2 = 0.377458851261102
Background = 0.000471566148087
Bayesian Blocks computed for this data set are:
Interval Average Counts
[254033756.00500000, 254033757.83500001] 0.00000000
[254033757.83500001, 254033758.21500000] 1.68421035
[254033758.21500000, 254033764.00500000] 0.00172711 |
An example of how to run the tool using the MAN option is given below:
> gtburstfit
This is gtburstfit version N/A
Name of file containing events [] : LAT_090119205_v4_filtered_lc.fits
How will initial values for fit be determined <AUTO|MAN|CALC> [AUTO] : MAN
Amplitude of pulse [] : 15
Time of pulse [] : 254033755.025
Rise coefficient [] : 1
Decay coefficient [] : 1
Constant background rate [] : 0.016124874850956
After initial guess but before any fitting, reduced chi square is 2.85820198
Parameters are:
Peak 1:
Amplitude = 15.000000000000000
Time0 = 254033755.025000005960464
Tau1 = 1.000000000000000
Tau2 = 1.000000000000000
Background = 0.016124874850956
Minuit abnormal termination. (No convergence?)
After fit, reduced chi square is 0.69152648
Parameters are:
Peak 1:
Amplitude = 2.712350619170892
Time0 = 254033752.025000005960464
Tau1 = 1.174769123251601
Tau2 = 2.142269731290571
Background = 0.031573757914810 |
gtdiffrsp Help File
Usage: gtdiffrsp evfile scfile srcmdl irfs
Calculates the integral over solid angle of a diffuse source model convolved with the instrumental response function.
LAT data are modeled using maximum likelihood, and 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 very costly 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 them as an additional column for each diffuse source to the input FT1 file. Hereafter, we will refer to these quantities 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 (see the gtselect help and gtlike help for
further explanation) and then run gtdiffrsp on the filtered data. However, if your are 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.
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, simply type (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 [Pass4_v2] :
adding source Extragalactic Diffuse
adding source GalProp Diffuse
Working on...
Diffuse columns have already been computed for ps_filtered.fits...skipping it. |
In this case the columns of the FITS file containing the diffuse response information were already pre-computed, so the tool skips that step. For this particular example, columns added in the event file were:
Pass4_v2__Extragalactic, Diffuse, and Pass4_v2__GalProp 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=Pass4_v2
gtephem Help File
Usage: gtephem psrdbfile psrname reftime timeformat timesys
Computes and displays a pulsar's frequency ephemeris for a given pulsar and instant of time. This tool searches for pulsar ephemerides in a pulsar ephemerides database in GLAST D4 FITS format; computes a pulse frequency and its time derivatives at the given time, using the best ephemeris
available; and displays the result. If the given pulsar is in a binary system and its orbital parameters are found fin the pulsar ephemerides database, it accounts for binary modulation to correct time delays due to the pulsar's orbital motion.
Examples: gtephem
To find an ephemeris for a particular pulsar at a particular time, gtephem can be invoked as follows.
> gtephem
This is gtephem version v5r0p1
Pulsar ephemerides database file name [] : master_pulsardb_v2.fits
Pulsar name [ANY] : PSR B0540-69
Reference time at which to find/compute ephemeris [0.] : 54369.3
Time format for spin ephemeris epoch <MJD|GLAST> [MJD] : MJD
Time system for spin ephemeris epoch <TAI|TDB|TT|UTC> [TDB] : TDB
gtephem: User supplied time 54369.3 MJD (TDB)
gtephem: Spin ephemeris estimated at the user supplied time is:
gtephem: Validity : only at time 54369.3 MJD (TDB)
gtephem: Epoch = 54369.3 MJD (TDB)
gtephem: RA = 85.0482
gtephem: Dec = -69.3319
gtephem: Phi0 = 0.441780585795641
gtephem: F0 = 19.8339974978035
gtephem: F1 = -1.88699458167048e-10
gtephem: F2 = 0 |
If gtephem is invoked with chatter parameter set to 4 or larger, it will display spin and orbital ephemerides that is used to compute an extrapolated spin ephemeris at a particular moment in
time, together with an extrapolated ephemeris at the given time.
> gtephem chatter=4
This is gtephem version v5r0p1
Pulsar ephemerides database file name [] : master_pulsardb_v2.fits
Pulsar name [ANY] : PSR J1834-0010
Reference time at which to find/compute ephemeris [0.] : 54369.3
Time format for spin ephemeris epoch <MJD|GLAST> [MJD] : MJD
Time system for spin ephemeris epoch <TAI|TDB|TT|UTC> [TDB] : TDB
gtephem: User supplied time 54369.3 MJD (TDB)
gtephem: --------------------------
gtephem: Spin ephemeris chosen from database is:
gtephem: Validity : in range [51671 MJD (TDB), 52532 MJD (TDB))
gtephem: Epoch = 52101 MJD (TDB)
gtephem: RA = 278.571942
gtephem: Dec = -0.180347
gtephem: Phi0 = 0.122490413504243
gtephem: F0 = 1.9195541400136
gtephem: F1 = -5.27493e-17
gtephem: F2 = 0
gtephem: Orbital ephemeris chosen from database is:
gtephem: PB = 156479.326538
gtephem: PBDOT = 0
gtephem: A1 = 0.7233272
gtephem: XDOT = 0
gtephem: ECC = 0.0001612
gtephem: ECCDOT = 0
gtephem: OM = 0
gtephem: OMDOT = 0
gtephem: T0 = 52060.84100795
gtephem: GAMMA = 0
gtephem: SHAPIRO_R = 0
gtephem: SHAPIRO_S = 0
gtephem: --------------------------
gtephem: Spin ephemeris estimated at the user supplied time is:
gtephem: Validity : only at time 54369.3 MJD (TDB)
gtephem: Epoch = 54369.3 MJD (TDB)
gtephem: RA = 278.571942
gtephem: Dec = -0.180347
gtephem: Phi0 = 0.36997926235199
gtephem: F0 = 1.91955412967573
gtephem: F1 = -5.27493e-17
gtephem: F2 = 0 |
gtexpcube Help File
Usage: gtexpcube infile cmfile outfile irfs nxpix nypix pixscale coordsys xref yref axisrot proj emin emax enumbins
The gtexpcube generates an exposure map or a set of exposure maps for different energies, multiplying effective area by exposure, and integrating over solid angle. To create an exposure map with gtexpcube, you will need to generate an exposure livetime cube file. This file can be created using gtltcube (see the gtltcube documentation for a description of the livetime cubes, and additional details). Alternatively, pre-generated exposure cubes can be obtained directly from the GLAST Science Support Center (GSSC) website. Those pre-existing exposure cube files may cover the sky region of interest at different time ranges; thus, they may need to be merged before running gtexpcube. To add two livetime cubes together, you may 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 to combine the cubes before creating the maps.
You will also need to provide, as input to gtexpcube, 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 be input as well (emin in MeV, emax in MeV, and enumbins).
Optionally, a counts map FITS file generated with gtbin (see gtbin help), from which gtexpcube will match the coordinate projection and grid, could be input in gtexpcube to produce the exposure map.
The units of the exposure maps created by gtexpcube are: cm2 s1.
After creating the exposure map you can examine the results using; for example, ds9 or fv.
Examples: gtexpcube
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 gtexpcube interactively, simply type (at the command line): gtexpcube
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): gtexpcube bincalc=EDGE
In this case the energy layers are computed at the EDGE of the count map ebounds.
Example 1: To generate an exposure map using a single exposure cube, simply run the gtexpcube tool, which allows you to control the map generation parameters, including: Map center, size, scale, projection type, energy range, and number of energy bins.
The following example shows how to generate an all sky exposure map in an Aitoff projection:
> gtexpcube
This is gtexpcube version N/A
Exposure cube input file name [] : expCube_allsky_1week.fits
Count map input file name (NONE for manual input of map geometry) [NONE] :
Exposure map output file name [] : exposuremap.fits
Response function to use, e.g. HANDOFF, DC1F/DC1B, G25F/G25B, TestF/TestB [HANDO
FF] :
Size of the X axis in pixels (leave at 1 for auto full sky [1] :
Size of the Y axis in pixels (leave at 1 to copy nxpix or auto full sky) [1] :
Image scale (in degrees/pixel) [0.5] :
Coordinate system (CEL - celestial, GAL -galactic) <CEL|GAL> [CEL] : 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 <AIT|ARC|CAR|ZEA|GLS|MER|NCP|SIN|STG|TAN> [AIT] :
Start value for first energy bin [30.] :
Stop value for last energy bin [200000.] :
Number of logarithmically uniform energy bins [8] :
Creating an Exposure object from file expCube_allsky_1week.fits
Using Aeff(s)
Combining exposure from the response function(s), specified by "HANDOFF":
standard/front
standard/back
Creating an Image, will write to file exposuremap.fits
Generating layer 0 at energy 60.09 MeV Aeff(0): 1063.88 cm^2
Generating layer 1 at energy 180.63 MeV Aeff(0): 3786.07 cm^2
Generating layer 2 at energy 542.974 MeV Aeff(0): 5879.51 cm^2
Generating layer 3 at energy 1632.18 MeV Aeff(0): 7574.59 cm^2
Generating layer 4 at energy 4906.32 MeV Aeff(0): 8522.87 cm^2
Generating layer 5 at energy 14748.4 MeV Aeff(0): 8396.37 cm^2
Generating layer 6 at energy 44333.6 MeV Aeff(0): 8637.77 cm^2
Generating layer 7 at energy 133267 MeV Aeff(0): 8628.21 cm^2 |
You are prompted for an exposure cube, which in this case is called expCube_allsky_1week.fits, and it was previously created using gtltcube (see the gtltcube help). In the example the geometry was entered by hand, so "NONE" was selected in the cmfile 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 l=0, b=0. A total number of 8 energy logarithmic bins were selected starting from an energy of 30 MeV and ending in 200 GeV.
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:
>gtexpcube infile= expCube_allsky_1week.fits cmfile=NONE outfile=
exposuremap.fits irfs=HANDOFF nxpix=1 nypix=1 pixscale=0.5
coordsys=GAL xref=0 yref=0 axisrot=0 emin=30 emax=200000 enumbins=8
Example 2:
To generate an exposure map using a count map as input you should first create that count map using the gtbin tool (see the gtbin documentation). The following example details how to run the tool by inputting a count map:
> gtexpcube
This is gtexpcube version N/A
Exposure cube input file name [expCube_allsky_1week.fits] :
Count map input file name (NONE for manual input of map geometry)
[NONE] : allsky_cnts.fits
Exposure map output file name [exposuremap.fits] : exposuremap_v2.fits
Response function to use, e.g. HANDOFF, DC1F/DC1B, G25F/G25B,
TestF/TestB [HANDOFF] :
Image properties copied from file allsky_cnts.fits
Creating an Exposure object from file expCube_allsky_1week.fits
Using Aeff(s)
Combining exposure from the response function(s), specified by "HANDOFF":
standard/front
standard/back
Creating an Image, will write to file exposuremap_v2.fits
Generating layer 0 at energy 60.09 MeV Aeff(0): 1063.88 cm^2
Generating layer 1 at energy 180.63 MeV Aeff(0): 3786.07 cm^2
Generating layer 2 at energy 542.974 MeV Aeff(0): 5879.51 cm^2
Generating layer 3 at energy 1632.18 MeV Aeff(0): 7574.59 cm^2
Generating layer 4 at energy 4906.32 MeV Aeff(0): 8522.87 cm^2
Generating layer 5 at energy 14748.4 MeV Aeff(0): 8396.37 cm^2
Generating layer 6 at energy 44333.6 MeV Aeff(0): 8637.77 cm^2
Generating layer 7 at energy 133267 MeV Aeff(0): 8628.21 cm^2 |
All the binning parameters (in energy and space) are taken directly from the count map (in this case, named allsky_cnts.fits). The user then enters name of the livetime cube file (previously created with gtltcube), the names of the irfs file, and the name of the output exposure FITS file.
gtexpmap Help File
Usage: gtexpmap evfile scfile expcube outfile irfs srcrad nlong nlat nenergies
Calculates exposure maps for unbinned likelihood analysis. This tool creates exposure maps that are needed to compute the predicted number of photons within a given Region-of-Interest (ROI)
for diffuse components in your source model. They are used only for unbinned likelihood analysis. They differ significantly from conventional exposure maps, which are the integrals of effective area over time. The exposure calculation used in unbinned likelihood analysis consists of an integral of the total response (effective area times energy dispersion times point spread function) over the entire ROI. See the gtlike help and the workbook for more details regarding the
likelihood analysis.
The LAT point spread function is relatively broad at low energies. At 100 MeV, 68% of the counts will lie within 3.5 degrees of the source. (See GLAST LAT Performance.) As a consequence, the PSF tails of nearby point sources and diffuse components will overlap significantly with the emission from your sources of interest. To fit your sources accurately, you will also need to simultaneously model the nearby point sources and diffuse components; this will typically require an ROI centered on your sources that is several times the characteristic PSF size in order to have sufficient data to constrain all of the components in your model.
The source model should include any sources that can contribute significantly to the ROI, and again because of the size of the PSF, this implies a "Source Region", centered on the ROI, with a radius that is larger than the ROI radius by several PSF length scales. For example, when fitting a single point source, an ROI with a radius of 10 degrees and a Source Region radius of 20 degrees would be appropriate. Note that since the size of the LAT PSF goes roughly as E^{-0.8}, if
you are considering only higher energy photons (e.g., > 1 GeV), smaller ROI and Source Region radii of just a few degrees may be used.
All of the sources in the Source Region should be included in the source model file that is input to gtlike. (See the gtlike and ModelEditor help). The positions and spectral models of these sources can either be obtained from a catalog, such as the Third EGRET catalog, or via a source detection step. The diffuse components will typically include the Galactic diffuse emission and an isotropic extragalactic component, but may also include discrete diffuse components such as SNRs or the LMC.
The exposure map used in the likelihood analysis must extend over the entire Source Region, and it is specific to the ROI. The radius of the Source Region is an input to gtexpmap and is given by the srcrad parameter (in degrees). The radius of the ROI is set when the event data are extracted using the gtselect tool, and this information is written to the FITS header of the filtered file (see the gtselect help).
Since we expect that most analyses will consider photon energies down to 100 MeV, we recommend a Source Region radius that is at least 10 degrees larger than the ROI radius, and you will receive a warning message when you run gtexpmap if this is not the case.
The spatial and energy gridding (nlong, nlat, and nenergies parameters) for the Source Region must also be provided in gtexpmap. Half-degree pixels are a nominal choice for gtexpmap, and
that means nlong=120 and nlat=120 if 30 degrees radius was chosen for the srcrad parameter. Smaller pixels should result in a more accurate evaluation of the diffuse source fluxes, but they will also make the exposure map calculation itself more time consuming, scaling roughly
with the number of pixels in your map. The energy range of the exposure map is determined by the selections made with gtselect to produce the filtered event file, and that energy range is divided into a number of logarithmically spaced bins given by the nenergies parameter. These maps are used to integrate the spectra of the diffuse components in order to determine the predicted counts from these sources. If the spectra of the diffuse components are fairly featureless (i.e., mostly power-laws, with no sharp spectral features such as cut-offs or spectral lines), then 4 or 5 energy bins per decade are probably sufficient.
As input, gtexpmap also needs the livetime spent at each inclination angle at every point in the Source Region. This can be provided by the livetime cube maps, which have the information about the livetime as a function of sky position and off-axis angle. These maps could be created by gtltcube (see the gtltcube help) or obtained from the GSSC. If the livetime cube file is not provided gtexpmap will calculate these livetimes from the spacecraft file, but it is nonetheless
recommended to pre-compute the livetime cubes before running gtexpmap, as doing so from the spacecraft file will take a substantial amount of execution time. Since gtltcube produces a FITS file covering the entire sky, the output of this tool can be used for generating exposure maps for ROIs in other parts of the sky that have the same time interval selections. Note that the livetime cube is calculated on a spatial healpix grid (HEALPix is an acronym for Hierarchical Equal Area isoLatitude Pixelization), while the exposure map is calculated on a longitude-latitude grid.
Examples: gtexpmap
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 be prompted for gtexpmap parameter values, simply enter (at the command line): gtexpmap
Note: "Hidden" parameters are not prompted. If you want to overwrite one of the "hidden" parameters, specify the values in the command line. For example, if you do not want to overwrite the output file, set the clobber parameter "clobber=no" ( e.g., gtexmap clobber=no).
An example of how to run gtexpmap is given below:
> gtexpmap
The exposure maps generated by this tool are meant
to be used for *unbinned* likelihood analysis only.
Do not use them for binned analyses.
Event data file [ps1_55d_filtered.fits] :
Spacecraft data file [SC2_FT2_v2.fits] :
Exposure hypercube file [expCube_55days_SC.fits] :
output file name [expMap.fits] :
Response functions [Pass4_v2] :
Radius of the source region (in degrees) [30] :
Number of longitude points <2 - 1000> [120] :
Number of latitude points <2 - 1000> [120] :
Number of energies <2 - 100> [20] :
Computing the ExposureMap using expCube_55days_SC.fits |
In this case, the source region was selected with gtselect, (see gtselect help) to be 20 degrees, and the ROI was selected as 30 degrees. The livetime cube was provided (expCube_55days_SC.fits) and the exposure map generated has 120 longitude and latitude points, and 20 energy bins.
The previous example can also be run from the command line as shown below:
> gtexpmap evfile=ps1_55d_filtered.fits scfile=SC2_FT2_v2.fits
expcube= expCube_55days_SC.fits outfile=expMap.fits irfs=Pass4_v2
srcrad=30 nlong=120 nlat=120 nenergies=20
gtfindsrc Help File
Usage: gtfindsrc evfile scfile outfile irfs expcube expmap srcmdl target coordsys ra dec l b optimizer ftol atol
Optimizes a point source location using the likelihood test-statistic. This tool finds point source locations using an unbinned likelihood analysis. This is accomplished by using the multidimensional
minimization routine downhill simplex method (see Numerical Recipes, Chapter 10), which finds the best test-statistic (TS) for different positions around an initial guess until the convergence tolerance for a positional fit is reached. For each position where the given source is analyzed, a TS value is obtained using the same procedure as by gtlike (see the gtlike help for more details). For that reason the tools gtltcube and gtexpmap (which respectively produce the livetime cub and the exposure maps for the unbinned analysis) have to be run prior to running this tool. It is also highly recommended to run gtdiffrsp before running this tool (see the gtdiffrsp help for further explanation). The outputs are given in an ASCII file where the initial, intermediate, and the final values are given for the best fit position, the TS, and the circle radius. If the default value of "chatter" is given (chatter=2) the tool also outputs to the screen a summary with the best fit position and the error circle radius (in decimal degrees).
Examples: gtfindsrc
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 gtfindsrc from a script.
To be prompted for gtfindsrc parameter values, enter (at the command line): gtfindsrc
Note: "Hidden" parameters are not prompted. If you want to change one of the "hidden" parameters, specify the values in the command line. For example, if you want to have a better accuracy (than the default, posacc = 0.001) for the best fit position, enter (at the command line): gtfindsrc posacc=0.0001
An example of how to run the tool is given below:
> gtfindsrc
Event file [events] :
Spacecraft file [FT2.fits] :
Output file for trial points [test] :
Response functions to use [Pass4_v2] :
Livetime cube file [expCube.fits] :
Unbinned exposure map [expMap.fits] :
Source model file [src_model.xml] :
Building source model from src_model.xml
-log-likelihood of input source model: 4059.27
Target source name [point_src1] :
Optimizer <LBFGS|MINUIT|DRMNGB> [MINUIT] :
Tolerance for -log(Likelihood) at each trial point [1e-08] :
Covergence tolerance for positional fit [0.001] :
Best fit position: 50.4522, -37.2381
Error circle radius: 0.116836 |
This example can also be run from the command line as follows:
>gtfindsrc evfile=events scfile=FT2.fits outfile=test irfs=Pass4_v2
expcube=expCube.fits expmap=expMap.fits srcmdl=src_model.xml
target=point_src1 optimizer=MINUIT ftol=1e-8 atol=0.001
gtltcube Help File
Usage: gtltcube evfile scfile outfile dcostheta binsize
Calculates integrated livetime as a function of sky position and off-axis angle.
The LAT instrument response functions are a function of the angle between the direction to a source and the instrument z-axis. (This angle is commonly referred to as the inclination or "off-axis angle".) The number of counts that are detected for a source of a given intensity thus depends on how long that source spends at a various inclination angles over the course of an observation. The number of counts will also depend on the "livetime", i.e., the accumulated time during which the LAT is actively taking event data. To facilitate the calculation of model counts by gtlike and other analysis tools, the gtltcube tool computes the livetime as a function of inclination and location on the sky for a specified observation period.
The livetimes are therefore a function of the three dimensional space comprising the sky position and inclination angle, and accordingly the data product produced by gtltcube is called a "livetime cube". However, as a practical matter, the livetime cannot be provided as a continuous function of inclination angle or position on the sky. Thus the Science Analysis Environment (SAE) livetime cubes are defined on a HEALPix grid on the sky and in inclination angle bins. HEALPix is an
acronym for Hierarchical Equal Area isoLatitude Pixelization of a sphere. This pixelization produces a subdivision of a spherical surface in which each pixel covers the same surface area as every other pixel. The pixel centers occur on a discrete number of rings of constant latitude, and the number of constant-latitude rings depends on the resolution of the HEALPix grid.
gtltcube uses the spacecraft pointing history file, along with the time range and GTI selections in the event file, to compute livetime cubes that cover the entire sky. Therefore, the same output file can be used for analyzing different regions of the sky over the same time range.
Users can generate their own livetime cubes using gtltcube tool, or – whenever possible in order to save calculation time – obtain pre-computed livetime cubes from the GLAST Science Support Center (GSSC) website.
Since livetime cubes are additive, the livetime cube for a given epoch days can be calculated by adding the livetime cubes for non-overlapping time ranges that it comprises. The gtltsum tool can be used to add two or more livetime cubes together. (See the gtltsum help.)
Example: gtltcube
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 be prompted for gtltcube parameter values, enter (at the command line): gtltcube
Note: "Hidden" parameters are not prompted. If you want to change one of the "hidden" parameters, specify the values in the command line. For example, if you do not want to overwrite the output file, enter (at the command line): gtltcube clobber=no
An example of how to run gtltcube is given below:
> gtltcube
Event data file [ps_filtered.fits] :
Spacecraft data file [SC2_FT2_v2.fits] :
Output file [expCube.fits] :
Step size in cos(theta) <0. - 1.> [0.025] :
Pixel size (degrees) [1] :
Working on file SC2_FT2_v2.fits |
The above example can also be run from the command line as follows:
>gtltcube evfile=ps_filtered.fits scfile=SC2_FT2_v2.fits
outfile=expCube.fits dcostheta=0.025 binsize=1
gtltsum Help File
Usage: gtltsum infile1 infile2 outfile
Adds together livetime cubes produced by gtltcube.
The gtltcube tool facilitates multi-epoch analyses by summing the livetime contributions from each of two or more user specific input files and merges their GTI extensions. It checks to ensure that the input data sets are based on compatible HEALPix projection before they are summed. This is the only consistency check that is made between files. The input livetime cube files could be generated by gtltcube (see the gtltcube help), or obtained from the GLAST Science Support Center (GSSC).
Example: gtltsum
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 be prompted for gtltsum parameter values, simply enter (at the command line): gtltsum
Note: "Hidden" parameters are not prompted. If you want to override one of the "hidden" parameters, specify the values in the command line. For example, if you do not want to overwrite the output file, set the clobber parameter "clobber=no" ( e.g., gtltsum clobber=no).
An example of how to run the tool is given below:
> gtltsum
Livetime cube 1 or list of files [] : expCube_000001.fits
Livetime cube 2 [none] : expCube_000002.fits
Output file [] : expCube.fits |
The above example can also be run from the command line as follows:
>gtltsum infile1=expCube_000001.fits infile2=expCube_000002.fits
outfile= expCube.fits
gtmktime Help File
Synopsis:
Create Good Time Intervals (GTIs) based on selections made on the spacecraft data file variables.
Usage: gtmktime scfile filter evfile outfile
The gtmktime tool is used to update the Good Time Intervals (GTI) extension and make cuts based on spacecraft parameters contained in the Pointing and Livetime History FITS file.
A Good Time Interval is a time range when the data can be considered valid. The GTI extension contains a list of these GTIs for the file. The sum of the entries in the GTI extension of a file corresponds to the time when the data in the file is "good". In the case of the LAT data, the GTIs are the list of times that the LAT was collecting data over the time range you selected. The Science Analysis Environment (SAE) tools use the GTIs for the exposure calculation.
The gtmktime tool reads the spacecraft data file and, based on specified cuts, creates a set of GTIs. These are then combined (logical and) with the existing GTIs in the event file, and all events outside this new set of GTI are removed from the file. New GTIs are then written to the GTI extension of the new file. The gtmktime tool will be most commonly applied to event data; and, by default, the event data will be filtered according to the GTIs that are created. This
tool may also be used to update GTIs in other tabular files such as those created by gtltcube. (See the gtltcube help.)
Cuts can be made on any field in the spacecraft data file. The default is to select times when the spacecraft is not in the Southern Atlantic Anomaly (SAA), i.e. "IN_SAA!=T". Cuts are made using C-style relational syntax; for example:
! (not), && (and), || (or), != (different), >, <, >=, <=, abs(), cos(), sin(), etc.
Other kinds of cuts on the data could be made using the gtselect tool. See the gtselect documentation for further explanation.
Example: gtmktime
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 be prompted for gtmktime parameter values, simply enter (at the command line): gtmktime
Note: "Hidden" parameters are not prompted. If you want to override one of the "hidden" parameters, specify the values in the command line. For example, if you do not want to overwrite the output file, set the clobber parameter "clobber=no" ( e.g., gtmktime clobber=no).
In the following example the _3C279_3C273_back_events_0000.fits data file is used, along with the spacecraft data file called FT2.fits. All events that fall in time ranges outside of the SAA are selected out:
> gtmktime
Spacecraft data file [test_scData_0000.fits] : FT2.fits
Filter expression [IN_SAA!=T] :
Event data file [test_events_0000.fits] : _3C279_3C273_back_events_0000.fits
Output event file name [filtered.fits] : _3C279_3C273_back_filtered.fits |
The output event FITS file is called: _3C279_3C273_back_filtered.fits.
The same example can be run in the command line as follows:
gtmktime scfile=FT2.fits filter=IN_SAA!=T
evfile=_3C279_3C273_back_events_0000.fits
outfile=_3C279_3C273_back_filtered.fits
gtmodel Help File
Usage: gtmodel srcmaps srcmdl outfile irfs
Creates a model counts map based on a binned likelihood fit.
The gtmodel tool is used to facilitate comparisons between the data and model predictions. It is recommended to read the gtlike help for more explanations. gtmodel creates a model map of a region based on the fit parameters. This map is effectively an infinite-statistics counts map
of the region-of-interest based on your model fit. The gtmodel application reads in the fitted model, applies the proper scaling to the source maps, and adds them together to get the final map. Before running this tool you should run gtsrcmaps. (See the gtsrcmaps help for
more information.)
Example: gtmodel
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 be prompted for gtmodel parameter values, simply enter (at the command line): gtmodel
Note: "Hidden" parameters are not prompted. If you want to change one of the "hidden" parameters, specify the values in the command line. For example, if you do not want to overwrite the output file, enter (at the command line): gtmodel clobber=no
An example of how to run the tool is given below:
> gtmodel
Source maps (or counts map) file [] : srcMaps.fits
Source model file [] : src_model.xml
Output file [] : model_map.fits
Response functions [HANDOFF] : Pass4_v2 |
The above example can also be run from the command line as follows:
>gtmodel srcmaps=srcMaps.fits srcmdl=src_model.xml
outfile=model_map.fits irfs=Pass4_v2
gtobssim Help File
Generate photon events from astrophysical sources and process those
photons according to the specified instrument response functions.
Usage: gtobssim infile srclist scfile evroot simtime startdate
use_ac ra dec radius irfs seed
Point sources may be modeled in several different ways. The simplest are steady sources that can have power-law, broken power-law, or monoenergetic spectra. More complex spectral shapes for steady sources may be provided via an ASCII file that has 2 columns; one giving the energy, and the other giving the differential photon spectrum (dN/dE). Several time-varying point source models have been implemented: including a periodic source with a sinusoidal light curve; a phenomenological GRB source; a pulsar source that uses a template file for the light curve; and a simple transient source with top-hat light curve. These sources have power-law spectra; and in the case of the GRB source, a broken power-law spectrum can also be given. A more general transient point source is available that allows for spectral variation as a function of time. The light curve and spectral parameters as a function of time provided by an ASCII file or FITS binary table. Note that since gtlike does not allow for any time-dependence in its source models, not all of the sources that one can specify for gtobssim have corresponding models for use with gtlike.
Several options are available for modeling diffuse sources: a 2D Gaussian projected on the sky with power-law spectrum; an isotropic source covering the whole sky with power-law spectrum; a 2D "MapSource", for which the spatial distribution of photons is given by a FITS image, and the spectrum over the entire map is a power-law; a "MapCube" source, for which the incident photons are generated from a 3D FITS image that has sky coordinates and energy as its axes; and a source that allows one to give a 2D map for the spatial distribution, and a 2 column ASCII file for the spectrum over the entire map.
By default, gtobssim uses a simplified scanning mode and orbit solution for determining the instrument pointing and livetime history, and it outputs the computed pointing history to a FITS file. Alternatively, you may provide a FITS file of these data that has been created using gtorbsim (see gtorbsim help), or one that corresponds to an actual observation or that has been used by another simulation.
The source model is specified via an xml file that contains the xml definitions for the various point and diffuse source components. This file could be made using templates, or using the ModelEditor tool (see ModelEditor help), which is a GUI-driven application included in the SAE. This tool is invoked at the command line, and its use is fairly intuitive. ModelEditor was first designed to generate source model files for gtlike, but it was later updated to accommodate models that are supported in both gtlike and gtobssim. Due in part to the aforementioned difference in how gtlike and gtobssim treat time-varying sources, the formats of the xml files for these two tools differ substantially and thus cannot be interchanged. However, for the models supported in both gtobssim and in gtlike, ModelEditor gives you the option to save them in either format.
As the source model file may contain more sources than you want to simulate for a given task, you will need to provide an ASCII file with the desired list of sources for that specific task as an input to gtobssim.
In addition to the files mentioned above, you also need to provide the total simulation "exposure" time, the simulation start date, and the appropriate response function to use. You will also be prompted for a random seed number for the task.
Examples: gtobssim
Parameters are passed following the FTOOLs model (i.e., they can be passed as answers to a prompt, or listed in a command line). To be prompted for gtobssim parameter values, enter (at the command line): gtobssim
Note: "Hidden" parameters are not prompted. If you want to change one of the "hidden" parameters, specify the values in the command line, or click advanced in the GUI. For example, if you would like to change the minimum energy value for the events in the simulation, enter (at the command line): gtobssim emin=100
In this case, the minimum energy of the event will be set to 100 MeV instead of 30 MeV (the default value).
Some, but not all, examples of sources that can be simulated by gtobssim are listed below:
Example 1: A Power Law source:
An easy example that you may wish to try is to simulate a point source with a power-law spectra. An example using parameters that are appropriate for 3C 279 is shown below:
<source_library title="example_3C279"> <source name="_3C279" flux="3.48e-4"> <spectrum escale="MeV"> <particle name="gamma"> <power_law emin="20.0" emax="200000." gamma="1.96"/> </particle> <celestial_dir ra="193.98" dec="-5.82"/> </spectrum> </source> </source_library> |
It is strongly recommended to produce these source model files directly using ModelEditor. (See ModelEditor help.)
In this case 3C 279 (Ra=193.98, Dec=-5.82) is simulated with a photon spectral index of 1.96 and an integrated flux between 20 MeV and 200000 MeV of 3.48e-4 m^-2s^-1. The parameter escale specifies the units of energy used elsewhere in the source specification. It can have values of MeV or GeV. (default: GeV)
The file passed as the srclist parameters should contain the entry _3C279.
Note: The xml parser does not allow source names that begin with a number; so in this case, an underscore "_" has been prepended to the name. Spaces should also be avoided in the source names.
An example of inputs parameters is given below:
>gtobssim
File of flux-style source definitions [src_sim.xml] :
File containing list of source names [sources.dat] :
Pointing history file [../../SC2_FT2_v2.fits] :
Prefix for output files [mysource] : 3C279
Simulation time (seconds) [2592000] :
Simulation start date [2008-12-31] :
Apply acceptance cone? [yes] :
RA of cone center (degrees) <-360 - 360> [195.555759] : 193.98
Dec of cone center (degrees) <-90 - 90> [57.066813] : -5.82
Acceptance cone radius (degrees) <0 - 180> [40] :
Response functions [Pass4_v2] :
Random number seed [29304] :
added source "_3C279"
Generating eve |
In this case the simulation started on 2008-12-31 and lasted for 1 month (2592000 seconds). The Pointing history file used was SC2_FT2_v2.fits. The Response Function used was
Pass4_v2. The number of events generated was 15, and two files were created: 3C279_events_0000.fits (the fits file with the events); and 3C279_srcIds.txt (an ASCII file containing the list of source ID numbers in the resulting event file (in the MC_SRC_ID column). The minimum and maximum energy values for the simulation are the default values in this case. If you enter emin=30 in the command line as input, the resulting events will have an energy larger that 30 MeV. Keep in mind that the expected integrated flux between 20 MeV and 200000 MeV will be the one that is in the source model file: 3.48e-4 m^-2s^-1.
The above example can also be run from the command line as follows:
>gtobssim infile= src_sim.xml srclist= sources.dat
scfile=../../SC2_FT2_v2.fits evroot=mysource simtime=2592000
startdate=2008-12-31 use_ac=yes ra=193.98 dec=-5.82 radius=40 irfs=
Pass4_v2 seed=29304
2) Diffuse components
To produce a realistic model you should also include the simulation of the Galactic and xtragalactic diffuse emission.
Example 2a) Galactic diffuse
To simulate the Galactic diffuse emission you may use the "MapSource" SpectrumClass component. For the MapSource model, the photons are generated using a 2D FITS image as a template. A single power-law spectrum is used for the entire map. A sample xml source file is
given below:
<source_library title="galactic_back">
<source name="Galactic_Diffuse"> <spectrum escale="MeV"> <SpectrumClass name="MapSource"
params="17.,2.1,EGRET_diffuse_gal.fits,30.,2e5"/>
<use_spectrum frame="galaxy"/> </spectrum> </source> </source_library> |
In the example above, the total photon flux from the map is 17 photon/m^2/s; the photon spectral index is 2.1; the minimum photon energy is 30 MeV; and the maximum photon energy is 2x10^5 MeV. The FITS file, EGRET_diffuse_gal.fits is the EGRET interstellar emission model (Hunter et al. 1997, ApJ 481, 205), which is available in the SAE distribution in "extFiles/v0r7/galdiffuse" directory. The file is a 2-dimensional array of the integrated intensities (>100 MeV) on a 30' grid in Galactic coordinates. EGRET_diffuse_gal.fits does not contain extragalactic diffuse emission.
You can generate the same source model using directly the ModelEditor tool (see ModelEditor help).
An example of input parameters to simulate the all-sky diffuse background is given below for a
1-day simulation starting 2008-12-31 and with Pass4_v2 as response function:
>gtobssim
File of flux-style source definitions [src_sim.xml] :
File containing list of source names [sources.dat] :
Pointing history file [../../SC2_FT2_v2.fits] :
Prefix for output files [galactic_back] :
Simulation time (seconds) [86400] :
Simulation start date [2008-12-31] :
Apply acceptance cone? [no] :
Response functions [Pass4_v2] :
Random number seed [29304] :
added source "Galactic_Diffuse"
Generating events for a simulation time of 86400 seconds...
Done. |
Two files were created: galactic_back_events_0000.fits (the fits file with the events) and galactic_back_srcIds.txt (an ASCII file with the source ID information). This example generated 29827 events.
Another way to simulate the diffuse emission is to use the MapCube source, which is a generalization of MapSource source. A MapCube FITS file comprises a data cube of separate maps specified for arbitrary energies. This allows for spectral variations across a diffuse source.
MapCube was used to generate the interstellar gamma rays from the Milky Way using a cube generated from gamma-ray intensities calculated by the GALPROP software. The example below is for the GP_gamma.fits model of the interstellar emission of the Milky Way.
<source_library title="galactic_back">
<source name="Galactic_Diffuse">
<spectrum escale="MeV">
<SpectrumClass name="MapCube" params="12.59,GP_gamma.fits"/>
<use_spectrum frame="galaxy"/>
</spectrum>
</source>
</source_library> |
The MapCube source has only 2 parameters, total photon flux from the map, integrated over the energy range of the cube (#/m^2/s); and the FITS filename. Note that MapCube requires that the input FITS file contains a binary table extension called 'ENERGIES' that defines the energy of each of the spatial planes in the cube. The units of the map are differential intensity (e.g., photons cm^-2 s^-1 MeV^1 sr^-1), although the integral value is renormalized by whatever total photon flux is specified in the specification of the source. Note that GP_gamma.fits does not contain extragalactic diffuse emission. See the next section for an example of how to simulate the extragalactic background. This file is available in the SAE distribution in
"extFiles/v0r7/galdiffuse" directory.
The input example below is for the GP_gamma.fits model of the interstellar emission of the Milky Way:
>gtobssim
File of flux-style source definitions [src_sim.xml] : src_sim2.xml
File containing list of source names [sources.dat] :
Pointing history file [../../SC2_FT2_v2.fits] :
Prefix for output files [galactic_back] : galactic_back_GP
Simulation time (seconds) [86400] :
Simulation start date [2008-12-31] :
Apply acceptance cone? [no] :
Response functions [Pass4_v2] :
Random number seed [29304] :
added source "Galactic_Diffuse"
Generating events for a simulation time of 86400 seconds....
Done. |
Two files were created: galactic_back_GP_events_0000.fits and galactic_back_GP_srcIds.txt. This input generated 36952 events.
The above example can also be run from the command line as follows:
>gtobssim infile= src_sim.xml srclist=sources.dat
scfile=../../SC2_FT2_v2.fits evroot= galactic_back_GP simtime=86400
startdate=2008-12-31 use_ac=no irfs=Pass4_v2 seed=29304
Example 2b) Extragalactic Emission
The source model file below implements the extragalactic diffuse inferred by EGRET (Sreekumar et al. ApJ 494 pag 523 1998). The flux has units of photons m^-2 s^-1 integrated between emin and emax. The photon spectral index is gamma, i.e., dN/dE = const*E^-gamma.
<source_library title="extragalactic_back">
<source name="Extragalactic_Diffuse" flux="0.545">
<spectrum escale="MeV">
<particle name="gamma">
<power_law emin="30." emax="100000." gamma="2.1"/>
</particle>
<solid_angle mincos="-0.4" maxcos="1."/>
</spectrum>
</source>
</source_library>
|
This source model file could be obtained using directly ModelEditor (see Model Editor help). For this example, the ASCII srclist file should read: Extragalactic_Diffuse
An example of how to run gtobssim to simulate these sources is given below:
>gtobssim
File of flux-style source definitions [src_sim2.xml] : src_sim.xml
File containing list of source names [sources.dat] :
Pointing history file [../../SC2_FT2_v2.fits] :
Prefix for output files [galactic_back_GP] : extragalactic_back
Simulation time (seconds) [86400] :
Simulation start date [2008-12-31] :
Apply acceptance cone? [no] :
Response functions [Pass4_v2] :
Random number seed [29304] :
added source "Extragalactic_Diffuse"
Generating events for a simulation time of 86400 seconds....
Done. |
Two files were created: extragalactic_back_events_0000.fits and extragalactic_back_srcIds.txt. This source generated 12136 events in the 1-day observation.
The above example can also be run from the command line as follows:
>gtobssim infile=src_sim.xml srclist=sources.dat
scfile=../../SC2_FT2_v2.fits evroot= extragalactic_back simtime=86400
startdate=2008-12-31 use_ac=no irfs= Pass4_v2 seed=29304
Example 3) Broken Power-Law spectra
An example of an xml source file to simulate a point source with a broken power-law spectra is given below:
<source_library title="example_mysource">
<source name="mysource" flux="5e-4">
<spectrum escale="MeV">
<particle name="gamma">
<power_law emin="20.0" emax="200000."
gamma="1.80" ebreak="1000" gamma2="2.30"/>
</particle>
<galactic_dir l="120" b="60"/>
</spectrum>
</source>
</source_library> |
The total integrated flux between 20 and 200000 MeV is 5e-4m^-2s^-1. The photon spectral index is 1.80 between 20 MeV and 1000 MeV (the break in the spectra) and 2.30 between 1000 MeV and 200000 MeV. The ASCII data file for this source should read: mysource
An example of input parameters is given below:
>gtobssim
File of flux-style source definitions [src_sim.xml] :
File containing list of source names [sources.dat] :
Pointing history file [../../SC2_FT2_v2.fits] :
Prefix for output files [3C279] : mysource
Simulation time (seconds) [2592000] :
Simulation start date [2008-12-31] :
Apply acceptance cone? [yes] :
RA of cone center (degrees) <-360 - 360> [193.98] : 195.555759
Dec of cone center (degrees) <-90 - 90> [-5.82] : 57.066813
Acceptance cone radius (degrees) <0 - 180> [40] :
Response functions [Pass4_v1] : Pass4_v2
Random number seed [29304] :
added source "mysource"
Generating events for a simulation time of 2.592e+06 seconds....
Done. |
In this case the simulation started on 2008-12-31 and lasted for 1 month (2592000 seconds). The Pointing history file used was SC2_FT2_v2.fits. The Response Function used was Pass4_v2. The number of events generated was 24. Two files were created mysource_events_0000.fits and mysource_srcIds.txt.
The above example can also be run from the command line as follows:
>gtobssim infile= src_sim.xml srclist= sources.dat
scfile=../../SC2_FT2_v2.fits evroot=mysource simtime=2592000
startdate=2008-12-31 use_ac=yes ra=195.555759 dec=57.066813 radius=40
irfs=Pass4_v2 seed=29304
Example 4) Gaussian source
In this case, the incident photons are distributed as a 2D Gaussian projected on the sky. An example of source model is given below:
<source_library title="example_gaussian">
<source name="gaussian_source">
<spectrum escale="MeV">
<SpectrumClass name="GaussianSource"
params="0.1, 2.1, 120., 60., 1.0, 1.0, 0.0, 30., 2e5"/>
<use_spectrum frame="galaxy"/>
</spectrum>
</source>
</source_library> |
The parameters are:
Total flux in units of m^-2 s^-1
Photon spectral index such that dN/dE~E^-/Gamma
Source centroid J2000 right ascension in degrees.
Source centroid J2000 declination in degrees.
Semi-major axis of the 68% CL contour in degrees (default: 1).
Semi-minor axis of the 68% CL contour in degrees (default: 1).
Position angle of the major axis measured wrt North in degrees (default: 0)
Minimum photon energy in MeV (default: 30).
Maximum photon energy in MeV (default: 1e5) |
This source model file could be obtained using directly ModelEditor (see ModelEditor help). The ASCII data file for this source should read: gaussian_source
An example of inputs parameters is given below:
>gtobssim
File of flux-style source definitions [src_sim.xml] :
File containing list of source names [sources.dat] :
Pointing history file [../../SC2_FT2_v2.fits] : ../SC2_FT2_v2.fits
Prefix for output files [extragalactic_back] : gaussian
Simulation time (seconds) [86400] : 2592000
Simulation start date [2008-12-31] :
Apply acceptance cone? [no] : yes
RA of cone center (degrees) <-360 - 360> [266.404996] : 120
Dec of cone center (degrees) <-90 - 90> [-28.936172] : 60
Acceptance cone radius (degrees) <0 - 180> [40] :
Response functions [Pass4_v2] :
Random number seed [29304] :
added source "gaussian_source"
Generating events for a simulation time of 2.592e+06 seconds....
Done. |
In this case the simulation started on 2008-12-31 and lasted for 1 month (2592000 seconds). The pointing history file used was SC2_FT2_v2.fits. The number of events generated was 6053, and two files were created gaussian_events_0000.fits and gaussian_srcIds.txt.
The above example can also be run from the command line as follows:
>gtobssim infile= src_sim.xml srclist= sources.dat
scfile=../SC2_FT2_v2.fits evroot= gaussian simtime=2592000
startdate=2008-12-31 use_ac=yes ra=120 dec=60 radius=40 irfs=Pass4_v2
seed=29304
Example 5) Periodic source
It is possible to simulate a point source with sinusoidal light curve. The example below corresponds to the simulation of a periodic source in the center of the Galaxy:
<source_library title="example_periodic">
<source name="periodic_source">
<spectrum escale="MeV">
<SpectrumClass name="PeriodicSource"
params="0.1, 2.1, 1e3, 1, 0.75, 30., 2e5"/>
<galactic_dir l="0" b="0"/>
</spectrum>
</source>
</source_library> |
The parameters are:
Average flux in units of m^-2 s^-1.
Photon spectral index such that dN/dE ~E^-\Gamma
Source period in seconds.
Amplitude of the sinusoidal modulation (default: 0.5).
Phase offset specified on the unit interval (default: 0).
Minimum photon energy in MeV (default: 30)
Maximum photon energy in MeV (default: 1e5) |
The ASCII data file for this source should read: periodic_source
An example of inputs parameters is given below:
>gtobssim
File of flux-style source definitions [src_sim.xml] :
File containing list of source names [sources.dat] :
Pointing history file [../SC2_FT2_v2.fits] :
Prefix for output files [gaussian] : periodic
Simulation time (seconds) [2592000] :
Simulation start date [2008-12-31] :
Apply acceptance cone? [yes] :
RA of cone center (degrees) <-360 - 360> [120] : 266.404996
Dec of cone center (degrees) <-90 - 90> [60] : -28.936172
Acceptance cone radius (degrees) <0 - 180> [40] :
Response functions [Pass4_v2] :
Random number seed [29304] :
added source "periodic_source"
Generating events for a simulation time of 2.592e+06 seconds....
Done. |
In this case the simulation started on 2008-12-31 and lasted for 1 month (2592000 seconds). The pointing history file used was SC2_FT2_v2.fits. Pass4_v2 was used as response Function. Two files were created periodic_events_0000.fits and periodic_srcIds.txt.
The above example can also be run from the command line as follows:
>gtobssim infile=src_sim.xml srclist=sources.dat
scfile=../SC2_FT2_v2.fits evroot=periodic simtime=2592000
startdate=2008-12-31 use_ac=yes ra=266.404996 dec=-28.936172
radius=40 irfs= Pass4_v2 seed=29304
Example 6) Pulsar Source
To simulate a pulsar you need to create an ASCII template file containing the light curve. The file should consist of two columns: phase and intensity. The phase intervals must be uniformly spaced. The phase scale and absolute intensities are arbitrary and rescaled using the period and flux parameter values.
The following is an example of the source file for a pulsar. In this case, the Crab pulsar; it is simulated with the template named: CrabTemplate.dat.
<source_library title="example_pulsar">
<source name="Crab_Pulsar">
<spectrum escale="MeV">
<SpectrumClass name="Pulsar"
params="1e3,2.,0.033,0,0,CrabTemplate.dat,0,30,1e5"/>
<celestial_dir ra="83.57" dec="22.01"/>
</spectrum>
</source>
</source_library> |
The parameters are:
Average flux in units of m^-2 s^-1.
Photon spectral index such that dN/dE~E-\gamma
Pulsar period in seconds.
Time derivative of the pulsar period in ss^-1
Reference epoch in MET seconds.
Filename of the ASCII light curve template. The file should consist of
two columns, phase and intensity. The phase intervals must be
uniformly spaced. The phase scale and absolute intensities are
arbitrary and rescaled using the period and flux parameter values.
Phase offset in the unit interval (default: 0).
Minimum photon energy in MeV (default: 30).
Maximum photon energy in MeV (default: 1e5) |
The ASCII data file for this source should read: Crab_pulsar
An example of inputs parameters is given below:
>gtobssim
File of flux-style source definitions [src_sim.xml] :
File containing list of source names [sources.dat] :
Pointing history file [../SC2_FT2_v2.fits] :
Prefix for output files [periodic] : crab
Simulation time (seconds) [2592000] :
Simulation start date [2008-12-31] :
Apply acceptance cone? [yes] :
RA of cone center (degrees) <-360 - 360> [266.404996] : 83.57
Dec of cone center (degrees) <-90 - 90> [-28.936172] : 22.01
Acceptance cone radius (degrees) <0 - 180> [40] :
Response functions [Pass4_v2] :
Random number seed [29304] :
added source "Crab_Pulsar"
Generating events for a simulation time of 2.592e+06 seconds....
Done. |
In this case the simulation started on 2008-12-31 and lasted for 1 month (2592000 seconds). The Pointing history file used was SC2_FT2_v2.fits. Pass4_v2 was used as Response Function. The number of events generated was 71, and two files were created crab_events_0000.fits and crab_srcIds.txt.
The above example can also be run from the command line as follows:
>gtobssim infile=src_sim.xml srclist=sources.dat
scfile=../SC2_FT2_v2.fits evroot=crab simtime=2592000
startdate=2008-12-31 use_ac=yes ra=83.57 dec=22.01 radius=40 irfs=
Pass4_v2 seed=29304
Example 7) SimpleTransient
This allows the user to simulate a point source with a single active interval during which it has a constant flux and power-law spectrum. An example of source model is given below:
<source_library title="example_simpletransient">
<source name="simple_transient">
<spectrum escale="MeV">
<SpectrumClass name="SimpleTransient"
params="100., 2.,1000,3500, 30., 2e5"/>
<celestial_dir ra="83." dec="22."/>
</spectrum>
</source>
</source_library> |
The parameters are:
Flux while in the active state in units of m^-2 s^-1,
Photon spectral index such that dN/dE~E^-Gamma
Start time of the active state in MET seconds.
Stop time of the active state in MET seconds.
Minimum photon energy in MeV (default = 30)
Maximum photon energy in MeV (default = 1e5) |
The ASCII data file for this source should read: simple_transient. An example of input parameter is given below:
>gtobssim
File of flux-style source definitions [src_sim.xml] :
File containing list of source names [sources.dat] :
Pointing history file [../../SC2_FT2_v2.fits] :
Prefix for output files [simpleT] :
Simulation time (seconds) [86400] :
Simulation start date [2008-12-31] :
Apply acceptance cone? [yes] :
RA of cone center (degrees) <-360 - 360> [83] :
Dec of cone center (degrees) <-90 - 90> [22] :
Acceptance cone radius (degrees) <0 - 180> [40] :
Response functions [Pass4_v2] :
Random number seed [293049] : |
In this case the simulation started on 2008-12-31. The Pointing history file used was SC2_FT2_v2.fits. Pass4_v2 was used as Response Function. The number of events generated was 10, and two files were created simpleT_events_0000.fits and simpleT_srcIds.txt.
The above example can also be run from the command line as follows:
>gtobssim infile=src_sim.xml srclist=sources.dat
scfile=../../SC2_FT2_v2.fits evroot=simpleT simtime=86400
startdate=2008-12-31 use_ac=yes ra=83 dec=22 radius=40
irfs=Pass4_v2 seed=29304
8) SpectralTransient
It is possible to simulate a transient source giving the light curve data as template. Here you have an example of source model:
<source_library title="example_spectraltransient">
<source name="spectral_transient">
<spectrum escale="MeV">
<SpectrumClass name="SpectralTransient"
params="flux=1e-1, tstart=0., tstop=1e4, templateFile=testTemplate.dat,
emin=20, emax=2e5, lc=0, z=0, useLogParabola=0"/>
<celestial_dir ra="193.4" dec="-5.82"/>
</spectrum>
</source>
</source_library> |
The parameters are:
Mean flux during the active state in units of m^-2s^-1
Start time of the active state in MET seconds.
Stop time of the active state in MET seconds.
Filename of the light curve template. May be ASCII or FITS.
Minimum photon energy in MeV (default: 20).
Maximum photon energy in MeV (default: 2e5).
Light curve number, if FITS file (default: 0).
Redshift used for EBL attenuation calculation (default: useLogParabola (default = 0) |
The ASCII data file for this source should read: spectral_transient
An example of inputs parameters is given below:
>gtobssim
File of flux-style source definitions [src_sim.xml] :
File containing list of source names [sources.dat] :
Pointing history file [../../SC2_FT2_v2.fits] :
Prefix for output files [simpleT] : spectraT
Simulation time (seconds) [2592000] :
Simulation start date [2008-12-31] :
Apply acceptance cone? [yes] :
RA of cone center (degrees) <-360 - 360> [83] : 193.4
Dec of cone center (degrees) <-90 - 90> [22] : -5.82
Acceptance cone radius (degrees) <0 - 180> [40] :
Response functions [Pass4_v2] :
Random number seed [29304] :
added source "spectral_transient"
Generating events for a simulation time of 2.592e+06 seconds....
Done. |
In this case the simulation started on 2008-12-31 and lasted for 1 month (2592000 seconds). The pointing history file used was SC2_FT2_v2.fits. Pass4_v2 was used as Response Function. The number of events generated was 61, and two files were created spectraT_events_0000.fits and spectraT_srcIds.txt.
The above example can also be run from the command line as follows:
>gtobssim infile=src_sim.xml srclist=sources.dat
scfile=../../SC2_FT2_v2.fits evroot=spectraT simtime=2592000
startdate=2008-12-31 use_ac=yes ra=193.4 dec=-5.82 radius=40
irfs=Pass4_v2 seed=29304
gtophase
Example: gtophase
gtorbsim
Example: gtorbsim
gtpsearch
Example: gtpsearch
gtpsf
Example: gtpsf
gtpspec
Example: gtpspec
gtptest
Example: gtptest
gtpulsardb
Example: gtpulsardb
gtrspgen
Example: gtrspgen
gtselect
Example: gtselect
gtsrcid
Example: gtsrcid
gtsrcmaps
Example: gtsrcmaps
gttsmap
Example: gttsmap
gtvcut
Example: gtvcut
Last updated by: Chuck Patterson
03/31/2008 |
|
|