Come analyze HEASARC, IRSA, and MAST data in the cloud! The Fornax Initiative is now welcoming all interested beta users.
Table models
A very simple way of fitting with user-defined models is available for a particular class of models. These are models that can be defined by a grid of spectra, with the elements of the grid covering the range of values of the parameters of the model. For instance, for a one-parameter model, a set of model spectra can be tabulated for different values of the parameter (P1, P2, P3, etc.) The correct model spectrum for a value P is calculated by interpolation on the grid. The generalization to more parameters works in the obvious way. The table is specified in the model command by the special strings atable, mtable, or etable with the filename following in brackets – see the entries in the models section of the manual. Any number of table model components can be used simultaneously.
Table model components can be much slower than most standard models if
there are significant numbers of parameters. The memory requirements
increase as where n is the number of parameters in the model. A
table model with more than 3 or 4 fitting parameters is not
recommended. Additionally, the interpolation is linear, which implies
that the second derivatives used by the default Levenberg-Marquadt
algorithm may not be accurate. If the fit does not work well it may be
worth trying the migrad (minuit library) algorithm which makes no
assumptions about the second derivative.
As with standard models, the spectra should be in terms of flux-per-bin and not flux-per-keV. Any set of energy bins can be used, and XSPEC will interpolate the model spectra onto the appropriate energy bins for the detectors in use. It is therefore a good idea to choose energy bins such that the spectrum is well-sampled over the range of interest.
It is possible to have multiple model spectra at each parameter grid point. This is useful if there are differences between data spectra that require separate model spectra. An example of this is for spectropolarimetry where there are spectra for each Stokes parameter so the table model may want to generate separate model spectra for each Stokes parameter.
The file structure for table models is a FITS format described in OGIP
memo 92-009, found at :
https://heasarc.gsfc.nasa.gov/docs/heasarc/ofwg/docs/summary/ogip_92_009_summary.html.
The HEASP C++ library and Python module available in HEAsoft can be
used to make table model files. The documentation at:
https://heasarc.gsfc.nasa.gov/docs/software/lheasoft/headas/heasp/heasp_guide.html
includes examples for both C++ and Python.
If the table has only one parameter, the ftflx2tab tool can be used to create a table file from a text file input. https://heasarc.gsfc.nasa.gov/docs/software/lheasoft/help/ftflx2tab.html