Background Methods

If spex_bk_sep is 0, spex_bk_order is a scalar.

If spex_bk_sep is set, then spex_bk_order is an array of integers, one for each spex_bk_eband energy band.

The allowed values for spex_bk_order are:
0 - 0Poly, 0th order polynomial
1 - 1Poly, 1st order polynomial
2 - 2Poly, 2nd order polynomial
3 - 3Poly, 3rd order polynomial
4 - Exp, exponential
5 - High E Profile, use the ratio to the profile in the highest energy band
6 - This E Profile, use the ratio to the profile in this energy band

Note that once spex_bk_sep has been set, even after unsetting spex_bk_sep, spex_bk_order will remain a vector in order to remember your settings, even though only the first element will be used.

When spex_bk_sep is set, use this_band and this_order to get and set the order for each band:

order1 = o -> get(this_band=1, /this_order)

o -> set, this_band=1, this_order=2

spex_bk_ratio - This parameter is deprecaded. spex_bk_order = 5 now means use the ratio to the high-energy band profile, but now that option can be applied to any energy band. Previously, it was either set or not set for all bands.

When one of the two Profile methods (spex_bk_order = 5 or 6) is selected for an energy band, the time profile of the background for the highest energy band or the current energy band is used to define the shape of the background for all raw energy bins within that energy band. For each energy bin, the background time profile is computed by multiplying the smoothed profile by the ratio of the rate in that energy to the smoothed profile in the time intervals selected for that energy.
More specifically:
1. The background profile is computed by interpolating across gaps in the time intervals selected.
2. This profile is smoothed using the smoothing width specified by the spex_bk_sm_width parameter (the profile is convolved with a Savitzky-Golay smoothing filter of the width selected).
3. For each data energy bin (the raw bins, not the broader energy bands you have selected), the data in the time intervals selected for the energy band containing this bin are averaged and divided by the average of the smoothed profile in those times.
4. The background time profile for this energy bin is computed by multiplying the smoothed profile by that ratio.
5. The errors on the background are the square root of the counts in the time intervals used to calculate the ratio.