Standard models



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

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/cm/s (not photons/cm/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. When you have created your model subroutine, move it to the XSPEC local functions subdirectory (local/spectral/xspec/src/functions).

To set the default parameters and tell XSPEC that your model exists, you must edit the file lmodel.dat in the local model subdirectory (local/spectral/xspec/src/model). The file lmodel.dat.EXAMPLE can be used 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, and the name of the subroutine in the functions subdirectory. 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: No Title Previous: Adding models to



Keith Arnaud (kaa@genji.gsfc.nasa.gov)
Mon Sep 18 14:36:38 EDT 1995