CTI coefficient calculation procedure:
cti.bat
- compiles all other cti programs
- assigns input and output directories
- assigns list of obsids to read in, and their chipsets
- calls cti.pro
cti.pro
- loops over all chips/nodes
- for each chip determines which obsids to read
- loops over all obsids for each chip, reads in fits files
- contains three sections, which have to be run separately:
- reads in fits files and cats together chip,pha,grade
data, then calls calc,energyscale,plot pgms to calculate cti
values for each chip/node.
- reads in fits files for each individual obsid and
corrects it using cti data calculated by (1).
- reads in text data file for each obsid and overplots
results for a sort of summary plot.
Programs called by cti.pro:
cticalc (1 and 2)
- plots spectra, fits peaks, finds centroids
- plots centroids vs row number
- fits line/curve for CTI
- writes file 'chipNnN_in.dat' with fits and 'chipNnN_out.dat' with
CTI data.
cti_energyscale
- plots centroids vs. true line energy, FWHM vs. true line e.
- fits line to cent.vs.e. - this is the energy scale correction
- writes file 'chipNnN_gain.dat' with slope and int
ctiplot
- reads in cti data from cticalc output
- plots cti vs. centroid for the first 100 rows of the node
- fits a polynomial
- prints poly coefficients to 'cNnN_ctiplot.dat'
ctigaincorr (1 and 2)
- takes one obsid's fits file at a time and corrects it for CTI and
energy scale using data read in from ctiplot and energyscale output.
plotcticorr
- makes a nice plot of all of the results from ctigaincorr so
you can see how well the corrections worked.
Note - you can also run the standalone program
ctifilecat.pro
to assemble data from all the little text files created
by this software into one big text file and an HTML table.