next up previous contents
Next: About this document ... Up: Manual for Cora line Previous: Graph   Contents


Usage with IDL

In addition to the program written in ANSI C an IDL version is delivered. This version is the predecessor of the presented program. Using the IDL version might be useful when, e.g., the reduction software used to obtain the final spectrum is written in IDL or when further actions with either the spectrum or the fit results are planned.

The IDL package contains the main program fit_main.pro, a file containing all functions and routines fit_procs.pro, an include file fit.inc with COMMON blocks and style settings, and a short script do.pro customizing the application.

Before using the IDL routines, they must be compiled with


IDL> .compile fit_procs
IDL> .compile fit_main

For the case that the spectrum was prepared in IDL it can be written into a file with the correct format using the procedure writefile:


IDL> writefile,wave,sp,err,bkgd,bkgderr,fname
where wave contains the wavelength vector, sp the spectrum, err the errors of the spectrum, bkgd the instrumental background, and bkgderr the errors of the background. All these vectors must have identical dimensions. The name of the resulting file, e.g., spectrum.dat, is indicated with the variable fname.

A parameter file must be provided; it can be created with the GUI (cf. Sec. 5.2.1) or the command-line program cora_inp (Sect. 5.1.3), it is compatible with the parameter file used by the C program. The parameter file can be edited by hand or during the IDL session, the GUI can be run parallel for editing the parameter-file.

After compilation the program is started with


IDL> fit_main,[dtime=exposure time,]'spectrum.dat','fit.inp'[,psfile=psfile] .
Terms in [..] can be omitted, the default names 'spectrum.dat', 'fit.inp' can be replaced by any name corresponding to correct and existing names of the spectrum and the parameter file.

The last two parameters, listed in the last line of the parameter file, can be used to make IDL plot a graph of the likelihood curve in dependence of the iterated variables. This is useful in order to get an impression of the shape of each likelihood curve and thus the degree of the minimization problem. The parameter nlik represents the number of points calculated for such a graph, and with the second parameter, ispline, Spline interpolation can be activated ($ispline=1$) or deactivated ($ispline=0$).

Format parameters controlling line styles, character size etc. can be set in fit.inc. Default values are given in the file fit.inc delivered with the program, but can be ignored. If no specification is given, the defaults are still used. Fit results and other variables and vectors used by the program are stored in COMMON blocks, listed in fit.inc, so after calling the fit routine, the variables can be used for further processing. This feature was, e.g., used by Ness, J.U., Mewe, R., Schmitt, J.H.M.M. et al. 2001 (A&A, 367, 282) to disentangle first and third order of their CHANDRA LETGS spectrum of Capella. The third dispersion order lines were modeled in their first order, and these lines were then added to the instrumental background at the position of their third order on the detector plate. This new spectrum with the manipulated background spectrum was then used for the analysis of the remaining first order lines, recognizing the third order lines as part of the instrumental background.

A short example session is delivered with the program do.pro, where compiling and executing is done. Note that closing the plot device is necessary after running the program. This is left to the user for the case that the user wants to add plotting elements not provided by the program like labels before closing the device. The program is called with


IDL> @do


next up previous contents
Next: About this document ... Up: Manual for Cora line Previous: Graph   Contents
Jan-Uwe Ness
2003-05-23