4.1.16. File: model read from a fileΒΆ

This model reads a spectrum from a file. The user inputs a spectrum at n energy bins (n>1). The file containing the spectrum should have the follwing format:

  • first line: n

  • second line: E_1, S_1

  • third line: E_2, S_2

  • \ldots

  • last line: E_n, S_n

Here E_i is the energy of a photon in keV, and S_i is the spectrum in units of 10^{44} photons \mathrm{s}^{-1} \mathrm{keV}^{-1}. All energies E_i must be positive, and the grid must be monotonically increasing (two subsequent energies may not have the same value). Also, the spectrum S_i must be strictly positive (i.e. S_i=0 is not allowed).

SPEX then calculates the spectrum by linear interpolation in the \log E - \log S plane (this is why fluxes must be positive). For E<E_1 and E>E_n however, the spectrum is put to zero. Finally, the spectrum is multiplied by the scale factor N prescribed by the user.

The parameters of the model are:

norm : Normalisation factor N. Default value: 1.
file : The file name of the file containing the spectrum