Computes spectrum for a given source.
This script computes the source spectrum by fitting a model in a given set of spectral bins. The model fit per spectral bin is performed using ctlike and the script provides the possibility to fix sources other than the source of interest (hidden parameter fix_srcs) or to fix the background model component(s) (hidden parameter fix_bkg). The script computes the source flux and its uncertainty in each spectral bin, as well as the significance of the source detection. Optionally, it also computes an upper flux limit that is particularly useful in case that the source is not significantly detected within a spectral bin (hidden parameter calc_ulim).
The script works on binned and unbinned data.
For unbinned data, the spectral binning is either defined by a FITS file containing the energy boundaries of each bin (option ebinalg=FILE) or as enumbins bins spread linearly (option ebinalg=LIN) or logarithmically (option ebinalg=LOG) from a minimum energy given by emin to a maximum energy given by emax.
For binned data, all energy bins within the counts cube that overlap with the energy range spanned by emin and emax are considered. The number of spectral bins is only approximately determined by the enumbins parameter. Naturally, the script cannot create more spectral bins than the number of energy bins that are available in the cube. Also, in case that enumbins is smaller than the number of energy bins in the cube, the script will fit several layers of the counts cube for each spectral bin. The number of layers fit is determined by the total number of energy bins divided by the enumbins parameter.
On output, the script will provide a FITS file with the fitted source spectrum in form of a binary table. Each row corresponds to a spectral bin. The columns are the mean as well as the boundaries of the spectral bin, the fitted flux and flux error, the Test Statistics value (option calc_ts=yes), the upper flux limit (option calc_ulim=yes) and the predicted number of events (only for unbinned data).
chatter = 0: no information will be logged
chatter = 1: only errors will be logged
chatter = 2: errors and actions will be logged
chatter = 3: report about the task execution
chatter = 4: detailed report about the task execution