NAME

aciscalsrc-fit - Extract the spectrum from an event 1 FITS file. Fit the resulting spectrum to a gaussian by minimizing chi-square and c-statistics extract spectra from events, then fit models to the spectra.


SYNOPSIS

aciscalsrc-fit -f file -i ccd_id -t tag -N nameofLines [ -a listofascagrade (0,2,3,4,6) | -g listoffltgrades ] [ -F [ chisqr, cstat ] ] [ -c chunks (32,256) ] [ -C colToExtract (pha) ] [ -d ] [ -D listofworkstations ] [ -h ] [ -l boxcarlength ] [ -m minPixValue (0) ] [ -M fitMethod ] [ -n listofnodestoextract ] [ -o ] [ -s ] [ -u ]


DESCRIPTION

For the purpose of the description of the output files, it will be assumed that the user had entered the following command:


        aciscalsrc-fit -f data.fits -i 3 -t myprefix -c 32 -n 2 -N Al,Ti,Mn

Given the command above, all output files shall have a prefix of the form:

        myprefix-i3-n2

The consolidated (all the 32 chunks) fitted-parameters of the model by minimizing chi-square and cstatistics are in the files:

  myprefix-i3-n2-Al-Ti-Mn-chisqr.rdb
 and
  myprefix-i3-n2-Al-Ti-Mn-cstat.rdb

respectively.

The consilidated plots of the fitted chunks are in the files:

  myprefix-i3-n2-Al-Ti-Mn.cps
 and
  myprefix-i3-n2-Al-Ti-Mn-residuals.cps

For each of the chunk, the output files files shall have the prefix, say for the chunk 1 through 32:

        myprefix-i3-n2-y0001_0032

The consolidated results of the lines are in the files:

 myprefix-i3-n2-y0001_0032-Al-Ti-Mn-chisqr.rdb
 myprefix-i3-n2-y0001_0032-Al-Ti-Mn-cstat.rdb
 myprefix-i3-n2-y0001_0032-Al-Ti-Mn-residuals.cps
 myprefix-i3-n2-y0001_0032-Al-Ti-Mn.cps

For each of the emission-lines given in the command line option -N. The following files shall be produced:

 myprefix-i3-n2-y0001_0032-Energy-chisqr.rdb
 myprefix-i3-n2-y0001_0032-Energy-cstat.rdb
 myprefix-i3-n2-y0001_0032-Energy-modelvsrawdata.rdb
 myprefix-i3-n2-y0001_0032-Energy-paramdef.rdb
 myprefix-i3-n2-y0001_0032-Energy.cps

where Energy is one of the emission lines (Al, Ti, or Mn) given in the -N command line option. The files are: the fitted parameters by minimizing chi-square, c-statistics, an rdb table containing the model versus raw-data of the data, the parameter definition used to fit the line and the plot of the emission line, respectively.

The file:

 myprefix-i3-n2-y0001_0032-guess.rdb

is the output of the program findline which is used as the starting point for the parameters to the emission lines.

The raw data for a chunk is in:

 myprefix-i3-n2-y0001_0032.rdb

The rdb file

 myprefix-i3-n2-filename.rdb

contains the commands used to run the script fit_the_lines.


OPTIONS

The options are :

-a list
A commma separated list of asca grade to extract. If this option is not entered then an asca grade of 0,2,3,4,6 shall be used. This option cannot be used with the -g option.

-c integer,integer
The rows and columns of the rectangular regions of the frames from which spectra will be extracted. The rows and columns must divide integrally into the frame height (1024). The default value is 32,256 respectively.

-C string
The colum to histogram, default is 'pha'.

-d
If the option is present on the command line then the output of the plot shall be the screen rather then the default postscript files.

-D list
A comman seperated list of workstations to distribute the workload of the script.

-F list
The fit-statistics to use to fit, the available options are [ chisqr, cstat ]. The default value is cstat.

-g list
A commma separated list of flight grade to extract. This option cannot be used with the -a option.

-h
To see a brief instructions on how to use this program. For example:
 aciscalsrc-fit -h

-i integer
The ccd id. For example:
 aciscalsrc-fit -f data.fits -i 3 -t prefix -c 32 -n 3 -N a,b,c

-l integer
The box car length to smooth the data. The default is 5.
 aciscalsrc-fit -f data.fits -i 3 -t prefix -c 32 -n 3 -N a,b,c -l 3

-m integer
The minimal value the bin must contain to be considered as part of the line. The default value is 1.
 aciscalsrc-fit -f data.fits -i 3 -t prefix -c 32 -n 3 -N a,b,c -l 3 -m 5

-M string
The optimizer routine to call, the default is dnls1. The available options include: [ dnls1, dn2gb, odrpack, OptSolvePowell ]
 aciscalsrc-fit -f data.fits -i 3 -t prefix -c 32 -n 3 -N a,b,c -l 3 -m odrpack

NOTE: previous user(s) indicate that OptSolvePowell, while slower than the default method, provides more reliable fits to line width.

-n list
A comma separated list of the nodes to extract. If not specified, the entire event list will be used. For example:
 aciscalsrc-fit -f data.fits -i 3 -t prefix -c 32 -n 3 -N a,b,c

-N list
A comma separated list of the lines to extract, the lines are to be entered in increasing energy. For example:
 aciscalsrc-fit -f data.fits -i 3 -t prefix -c 32 -n 3 -N a,b,c

-o
If the option is present on the command line then the script shall not call

-s
If present the lines are to be fitted simultaneously.

-t string
A string which will prefix all output files. For example:
 aciscalsrc-fit -f data.fits -i 3 -t prefix -c 32 -n 3 -N a,b,c

-u
To see a detailed instructions on how to use this program. For example:
 aciscalsrc-fit -u

-v
Print debug statements as the script executes.
 aciscalsrc-fit -v


NOTES

There have been some issues with the quality of the line fits using the default method. It has been found that the OptSolvePowel method, while slower, will provide better fits to the line width, -M OptSolvePowell.

There have been issues in the past with fitting the peaks of lines due to multiple lines blending together. If this seems to be the case, consider increasing the cut off limit, -m <some larger number>