burstbkgevt reads the background rate from a lightcurve and background spectra and generates an event file to span the interval sampled by the lightcurve where the energy channels to each event are assigned based on the background spectra. The event file may be used to extract the background spectrum within the burst interval.
The input lightcurve needs to have a time column, a background rate, and an error column. By default
the task searches for columns named TIME, BKGRATE and ERROR, otherwise the parameters
timecol, ratecol and errcol maybe used to specify the names
of the columns. The lightcurve header must contain the keywords PHALCUT and PHAHCUT to specify the
minimun and maximum channels over which the background rates where derived. If they are not found,
the tasks assumes that the rates are derived from the all channels in the input spectra.
The output lightcurve from burstfinder is compatible to the input lightcurve
of burstbkgevt.
The spectral files are used to derive the channel number associated to an event. The task accepts up to two spectra that are input using parameters prespec and postspec. They may represent the pre-burst and post-burst background spectra and they are average within the task. A single spectrum may be input by setting either parameter to NONE (or blank). The spectral file has to have two columns with integer values corresponding to CHANNEL and COUNTS and must contain the full original channel range for a given detector.
The task assigns the number of events based on the bin rate and its error of the input lightcurve. If the user provides a positive value for the parameter stdv, this fixed value replaces the error column, and can be used if there is no error column. The error is also scaled by a multiplying factor stdv_mult. The time of each event is assigned randomly within the time bin. The channel for each event is assigned by randomly chosing from the weighted spectra and weight and the channel corresponding to that weight.
The output is an event file with the name outroot_simback.evt. If the input light curve has a GTI extension, this is copied to the output event file.
Use a lightcurve cgbm_20180411_sgm_083733_1h_user.lc which contains columns TIME, BKGRATE, and ERROR to define the time-dependent component of modeled events. Use a pre-burst spectra file cgbm_20180411_sgm_083733_1h_pre.pi and a post-burst spectra file cgbm_20180411_sgm_083733_1h_post.pi to define the spectral shape of the modeled background events. These spectra files contain columns CHANNEL and COUNTS.
Record the results in cgbm_20180411_sgm_083733_1h_simback.evt, which has columns TIME and PI (the default value for destcol) and include HISTORY keywords to record the parameters used to generate the output FITS file. The GTI in cgbm_20180411_sgm_083733_1h_user.lc (if any) is copied to the output event file. Record a log file cgbmbackevt_20180411_sgm_083733_1h.log. If the log file exists, clobber it.
burstbkgevt infile="cgbm_20180411_sgm_083733_1h_user.lc" prespec="cgbm_20180411_sgm_083733_1h_pre.pi" postspec="cgbm_20180411_sgm_083733_1h_post.pi" outroot="cgbm_20180411_sgm_083733_1h" ratecol="BKGRATE" errcol="ERROR" chancol="CHANNEL" cntcol="COUNTS" chatter=3 history=yes logfile="\!cgbmbackevt_20180411_sgm_083733_1h.log"