NAME

ftgenrsp - Generic spectral response generator

USAGE

ftgenrsp infile outfile resolreln resolfile fwhm units respreln respfile resplow resphigh respnumber respbreak respbnumber chanreln chanfile chanlow chanhigh channumber chanbreak chanbnumber efffile detfile filfile tlscpe instrm rspmin clobber

DESCRIPTION

FTGENRSP is a generator for the spectral response files used by XSPEC. It is primarily intended as a way of making quick response files when designing new instruments. FTGENRSP assumes that the response is Gaussian which is unlikely to be the case in reality so these responses are probably not going to be useful for analyzing actual data. The parameter resolreln specifies the way that the resolution varies with energy or wavelength. The options are CONSTANT, LINEAR, SQROOT, CZT, and FILE. CZT is a special case and uses the relation FWHM = E/(10*sqrt(20/E)). If FILE is specified then resolfile should be used to give the filename. This should be an ascii file. Each line should contain the energy followed by the difference between the input energy and the peak, the FWHM for the peak, and the normalization for each peak. The normalizations should sum to unity. For example the line 1.0 0.0 0.005 0.9 1.0 0.004 0.1 indicates that an input energy of 1 keV will produce two response peaks, the first centered at the input energy with a FWHM of 5 eV and the second centered at 1 keV below the input energy with a FWHM of 4 eV and a normalization of 10% of the response. Note that all energies must have the same number of peaks. If there is only one peak then the normalization is not included (since it has to be unity). If resolreln is CONSTANT, LINEAR or SQROOT are specifed then fwhm should be set. This is assumed to be the FWHM at 1 in whatever energy/wavelength units are required.

The units parameter can take values of keV, MeV, GeV, Hz, angstrom, cm, micron, or nm. All energies/wavelengths are assumed to be given in these units.

The response energy bins (ie the energies on which the model is calculated in XSPEC) are specified using the respreln parameter. At present there are three options: linear, log, or file. If linear or log is chosen then respnumber bins will be created with the first bin having a start energy/wavelength of resplow and the last bin an end energy/wavelength of resphigh. If respbnumber is non-zero and respbreak is less than resphigh then respnumber bins are created between resplow and respbreak and respbnumber bins between respbreak and resphigh. If respreln='file' then the response energies will be read from respfile. This should be an ascii file with 2 columns, the first being the start energy/wavelength of the bin and the second the end energy/wavelength. Note that at present the bins must be contiguous ie the start of bin i is the end of bin (i-1).

The channel energies are defined analogously to the response energies using parameters starting chan instead of resp.

All of the above can be circumvented if there is already an rmf file which is being used as a template. In this case the file is specified by the infile parameter value and all other parameters specifying the response matrix are ignored.

There are three files that can be used to give the instrument efficiency. efffil is the effective area curve, detfil the detector efficiency, and filfil the filter transmission. These files should be ascii with two columns, the first the energy/wavelength and the second the area, efficiency or transmission as appropriate.

The response matrix is calculated in a compressed format with only elements having values above rspmin being stored.

PARAMETERS

infile [filename]
The name of any input response matrix file. This will override any use of resolreln etc.

outfile [filename]
The name of the output spectral response matrix file.

resolreln [string]
The relation that describes the change in resolution with energy or wavelength. Options are CONSTANT, LINEAR, SQROOT, CZT, and FILE.

resolfile [filename]
The filename required if resreln=FILE.

units [string]
The units for energy/wavelength. Allowed are keV/MeV/GeV/Hz/angstrom/micron/nm.

fwhm [real]
The fiducial FWHM for resreln=CONSTANT, LINEAR or SQROOT.

respreln [string]
The relation defining response energies/wavelengths (linear, log, or file).

respfile [filename]
Filename to read for response energies/wavelengths.

resplow [real]
low energy or wavelength for the response energies.

resphigh [real]
The high energy or wavelength for the response energies.

respnumber [integer]
The number of response energy bins.

respbreak [real]
The energy or wavelength where the response bins change size.

respbnumber [integer]
The binsize for the response energies/wavelengths above respbreak.

chanreln [string]
The relation defining channels (linear, log, or file).

chanfile [filename]
Filename to read for channel energies/wavelengths.

chanlow [real]
The low energy or wavelength for the response channels.

chanhigh [real]
The high energy or wavelength for the response channels.

channumber [integer]
The number of channels.

chanbreak [real]
The energy or wavelength where the response channels change size.

chanbnumber [integer]
The number of channels above the break.

efffile [filename]
The name of the file with effective areas.

detfile [filename]
The name of the file with detector effeciencies.

filfile [filename]
The name of the file with filter transmissions.

tlscpe [string]
The telescope name.

instrm [string]
The instrument name.

rspmin [real]
The maximum value of a response element to be stored.

clobber [bool]
If clobber = yes then overwrite the output file if a file of this name already exists.

EXAMPLES

1. Generate a high resolution non-dispersive response with resolution data from a file

ftgenrsp infile=none outfile=fileout.rsp resolreln=file resolfile=resol.txt tlscpe=TEL instrm=INST units=keV
respreln=linear resplow=0.1 resphigh=20.0 respnumber=2800 respbreak=1.5 respbnumber=18500 chanreln=linear
chanlow=0.1 chanhigh=20.0 channumber=2800 chanbreak=1.5 chanbnumber=18500 efffile=eff.txt detfile=none filfile=none
2. As 1 with channel and energy boundaries also defined from files

ftgenrsp infile=NONE outfile=fileout.rsp resolreln=FILE resolfile=resol.txt tlscpe=TEL instrm=INST units=keV
respreln=FILE respfile=energies.dat chanreln=FILE chanfile=chan.dat efffile=eff.txt rspmin=1.0e-6 detfile=none
filfile=none
3. Make an RMF with linear fwhm and log binning

ftgenrsp infile=NONE outfile=outfile.rmf resolreln=LINEAR fwhm=0.1 tlscpe=Test instrm=Test units=keV
respreln=LINEAR resplow=2.0 resphigh=10.0 respnumber=100 chanreln=LINEAR chanlow=2.0 chanhigh=10.0
channumber=100 efffile=none detfile=none filfile=none
4. Make an RMF with constant fwhm with all units in angstrom

ftgenrsp infile=NONE outfile=fileout.rmf resolreln=CONSTANT fwhm=10.0 tlscpe=Test instrm=Test units=angstrom
respreln=LINEAR resplow=5000.0 resphigh=6000.0 respnumber=100 chanreln=LINEAR chanlow=5000.0 chanhigh=6000.0 channumber=100
efffile=none detfile=none filfile=none

SEE ALSO

LAST MODIFIED

Aug 2016