Next: 5.2.2 Example 2: Processing Up: User Examples Previous: User Examples

5.2.1 Example 1: I Don't Like `The Standard Model'

Suppose you don't like the default tex2html_wrap_inline2058 model used by SPECANAL for deconvolving the spectrum from count- to photon-space. It is simple enough to generate outputs with a different model and generate a fit at the same time. Using the basic data files generated by SPECANAL, use the IGORE routine FITIT to examine the data using a different model.

First, create a model with initial parameters using BUILDMODEL:

Igore> BUILDMODEL, ms
This prompts the user for model types and parameters. You can add multiple models through this routine. Next you must save the model to a file on disk:
Igore> status=MODEL_WRITE(`filename.mod', ms)

Next you can either create a namelist file for FITIT, or call the routine specifying keywords.

For the namelist file option:

Igore> status=fitit(file='namelistfile.NML')

For the keyword option or the namelist file, there are at the very least, three entries necessary. First, you need the filename of your model. Second, you need to specify the name of the SDB file which contains the totalled difference spectra and the response matrix. You create the model file yourself, the SDB file <fileroot>_TOT.SDB is created by SPECANAL and contains both the difference spectra and the response matrix. Finally, to save any output to files, you need to specify a FILEROOT name which becomes the prefix for the output files. Therefore your absolute minimum namelist file might look like this:

; Namelist file for FITIT
;   Minimum file model for Cygnus X-1 
; 
SDBFILE         =       "cygx-1_2_TOT.SDB" 
FILEROOT        =       "cygx-1_2_tbrem"
MODELFILE       =       "thermalbrem.mod"

Using keywords, running FITIT would look like:

Igore> status=fitit(sdbfile='cygx-1_2_tot.sdb',$
Igore> modelfile='thermalbrem.mod', fileroot=`cygx-1_2_tbrem')

When FITIT first begins running, you are prompted if you wish to read a new setup file. Answer no (N) to this prompt.

The FITIT routine would choose a set of ``reasonable'' defaults for the other parameters. Of course, IGORE's definition of reasonable and yours may vary. Let's take a look at a more detailed namelist file:

; Namelist file for FITIT
;   Thermal Bremsstrahlung model for Cygnus X-1
;
TITLE           =       "Cygnus X-1: Thermal Bremsstrahlung Model" 
SDBFILE         =       "cygx-1_2_TOT.SDB" 
MODELFILE       =       "thermalbrem.mod" 
FILEROOT        =       "cygx-1_2_tbrem"
PLOT_ERANGE(0)  =       0.01,   10.0 
PLOT_FRANGE(0)  =       0.00001,        10.0 
PLOT_CHANMOD    =       "log" 
PLOT_NCHAN      =       25 
ERANGE(0)       =       0.05,   1.0

where TITLE gives a title to present at the top of a plot; SDBFILE, FILEROOT and MODELFILE, as before, give the names of the input data file, the default output file name, and the model to be used for fitting; PLOT_ERANGE is used to expand the plotting range in energy out to 0.10 to 10.0 MeV; PLOT_FRANGE gives minimum and maximum values to plot in photon flux (tex2html_wrap_inline2064); PLOT_CHANMOD specifies that the standard spectral bins in the SDRs should be combined into PLOT_NCHAN channels of logarithmically scalled widths; and finally ERANGE specifies the minimum and maximum energy range over which to perform the model fitting.

As for output files, FITIT generates an SDB file with the photon spectrum, <fileroot>_PHOT.SDB; a text file table of the photon spectrum (suitable for installing in your own plotting routine), <fileroot>_PHOT.DAT; and a model file with the fitted results, <fileroot>.MDL. The .MDL file is in standard ASCII model file format, appropriate for input in routines such as PHOTONMODEL and FOFX. The graphs generated are in <fileroot>.ps and show a flux spectrum with residuals and parameters from the model fit.

For more details on the keywords available for customizing a FITIT run, run the IDL doc_library and ask to view the FITIT procedure.


Next: 5.2.2 Example 2: Processing Up: User Examples Previous: User Examples