4.1.18. Gain: Modify the energy scale of the model to compensate instrumental gain errors

This multiplicative, operative model allows to stretch the energy scale of the spectral model to which it is applied. The number of photons is conserved, but the energy E of each photon is changed to E^{\prime} with the relation:

E^{\prime} = E (1 + z(x)),

where x can be either energy E, wavelength \lambda, or the logarithm of energy or wavelength. The function z(x) is a Chebychev polynomial with up to 10 terms, defined in the energy interval E_1 to E_2 (always given as energy in keV, even when the user chooses to use x as logarithmic value or wavelength.

The user also has an option to produce an ascii-file named ‘spexgain.asc’ in the directory where SPEX is running. This contains three columns: the original energy E in keV, the modified energy E^{\prime} in keV, and the factor z(x) at that energy. This output is only produced when the parameter out=1 is set.

Warning

although the model does not put constraints upon the amplitudes of the Chebychev polynomials (they are in principle fittable parameters), the user must take care that their values are not too extreme. For extreme values, the modified energies E^{\prime} may not be a monotonous function of their index, which may lead to unreliable or wrong results. When the flag “out=1” is turned on, the user gets a warning when this condition occurs (turning the mode on during spectral fitting may produces repeated error warnings for each evaluation where this condition occurs, so be warned).

Warning

z(x) is only evaluated between the energies E_1 and E_2. Outside this range, we put z(x)=0. Note that this may lead to some discontinuities at the energies E_1 or E_2. For this reason, their derfault values are put to very small resp. very high values.

The parameters of the model are:

n : The maximum number of polynomial terms that is desired. Default value is 1, maximum is 10. Note that for n less than 10, all Chebychev terms larger than n are ignored, even if the corresponding scaling parameter is non-zero.
wav : Wheter to use an energy grid (wav=0, default) or a wavelength grid (wav=1) for the evaluation of the Chebychev polynomials.
log : Wheter to use a linear grid (log=0, default) or a logarithmic grid (log=1) for the evaluation of the Chebychev polynomials.
e1 : The Chebychev polynomials are evaluated only between energy E_1 and E_2 (both in keV). Default value: E_1=10^{-20}. Outside this range we force z(x)=0.
e2 : The Chebychev polynomials are evaluated only between energy E_1 and E_2 (both in keV). Default value: E_2=10^{20}.
out : Whether output of the gain correction (out=1) is desired or not (out=0, default).
p0 : first chebychev term (a constant). Note that due to the definition of chebychev polynomials, the gain is half of this; for example, p0=0.1 leads toa 5% gain correction. Default value: 0.
p1 : next chebychev term (linear). Default value 0.
p2 : next chebychev term (linear). Default value 0.
\ldots p9 : 9th order chebychev term. Default value 0.