next up previous contents
Next: Unix Up: Adding models to XSPEC Previous: Adding models to XSPEC

Standard models

If you have a model that will be used frequently, you may want to include it among the standard models so that it will be listed after the model ? command. To do so, you first must create a subroutine that calculates the model spectrum given an input array of energy bins and an array of parameter values. The spectrum for an additive model should be in terms of photons/cmtex2html_wrap_inline12909/s (not photons/cmtex2html_wrap_inline12909/s/keV), while for a multiplicative model it is the multiplicative factor for that bin.

The five arguments in the calling sequence are EAR(0:NE), NE, PARAM(*), IFL, and PHOTAR(NE). EAR(0:NE) are input and are the boundaries for the NE energy bins. These are set by the response matrices of the detectors in use, so you should not make any assumptions about the values of EAR. PARAM(*) are input and are the values of the model parameters. IFL is an integer which specifies which dataset these energies are for, it exists to allow multi-dimensional models where the function might also depend on eg pulse-phase in a variable source. PHOTAR(NE) is the output array and should not be assumed to have any particular values on input.

To set the default parameters and tell XSPEC that your model exists, you must create a file lmodel.dat in the subdirectory in which your local model code resides. Use the file model.dat in $XANADU/spectral/xspec/src/MODEL_COMP as a template. The first line for each model gives the model name, the number of parameters, the low and high energies for which the model is valid, the name of the subroutine, and the type of model (add, mul, mix, or con). There then should be one succeeding line for each parameter. Each line contains the parameter name, a default starting value, the hard minimum, the soft minimum, the soft maximum, the hard maximum, and the initial delta.




next up previous contents
Next: Unix Up: Adding models to XSPEC Previous: Adding models to XSPEC

Keith Arnaud (kaa@genji.gsfc.nasa.gov)
Wed May 28 10:59:33 EDT 1997