NAME

sgdarfgen -- Calculate SGD transmission ratio for a given source and correct the rsp for transmission

USAGE

sgdarfgen infile rspfile outfile ra dec sgdid ccid

DESCRIPTION

'sgdarfgen' computes the SGD transmission ratio for a source on the sky, given a satellite pointing, and corrects the response file for transmission. The transmission ratio depends on source position because the SGD collimator partially blocks light from off-axis sources.
'sgdarfgen' requires the source position, specified in the parameters 'ra' and 'dec', the pointing read from the keywords header RA-NOM/DEC_NOM/PA_NOM of the spectral file (see parameter 'infile') and the on-axis response from CALDB (see parameter 'rspfile'). 'sgdarfgen' calculates transmission ratio for each Compton Camera(CC) or for the combined CC in one SGD. If the parameter 'ccid' is set to either 1 or 2 or 3, the transmission is calculated for a single CC. If the parameter 'ccid' is set to either 1,2 or 2,3 or 1,3 the transmission is calculated for the two CC specified. If the 'ccid' is set to 0, the transmission is calculated for all three CC in an SGD. f 'cccid' is set to 1 or 2 or 3 only, one RSP is required as input to mmatch the SGD CC combination. If 'ccid' is set to 3, three input RSP files are required one for each of the CC for the defined SGD.
The transmission computation is done using the CALDB tramsmission file ('tranratfile') by interpolating between points in FOC coodinates for any energy in the RSP energy grid. The outputs are the following : one or three transmission files and the corresponding RSP depending on the 'ccid'. The root name for the tramsmission and RSP are specified in the parameter 'outfile'.
This task should be used for sources that off-axis. The RSP in CALDB is for on-axis sources and therefore there is not need to use this task to make a correction.

PARAMETERS

infile [filename]
Name of input spectral file from which nominal values of RA, Dec, and roll angle are read.

rspfile [filename]
Name of input RSP file(s) or file list. If the parameter 'ccid' is not 0 (i.e., either 1, 2, or 3,) then a single file name should be specified. If the parameter 'ccid' is 0, then three file names separated by commas or a file list including three file names should be given. The DETNAM keyword in the given file(s) must be consistent with the 'ccid'.

outfile [filename]
Name root of the transmission and RSP files. The output filename is constructed using the the root and appending the SGD number from 'sgdid' and the CC from 'ccid' parameters. For example for SGD1 CC1 is root_sgd1_cc1.rsp and root_sgd1_cc1.arf, if sgdid=1 and ccid= 0 six files are created as root_sgd1_cc1.rsp and root_sgd1_cc1.arf root_sgd1_cc2.rsp and root_sgd1_cc2.arf root_sgd1_cc3.rsp and root_sgd1_cc3.arf

ra [real]
Right Ascension of the source. [deg]

dec [real]
Declination of the source. [deg]

sgdid [integer]
SGD unit ID (1 or 2).

ccid [integer]
Compton camera ID (0, 1, 2, or 3: 0 for all).

(tranratfile = CALDB) [filename]
Input transmission ratio file. If the parameter is set to CALDB, the default, the file is read from the calibration database.

(buffer = -1) [integer]
Rows to buffer (-1=auto, 0=none, >0=numrows).

(clobber = no) [boolean]
Overwrites the existing output file if set to yes (yes/[no]).

(chatter = 1) [integer]
Chatter level for output. Set to 0 to suppress output, or to 1, 2, or 3 for increasing the chatter of the output.

(logfile = !DEFAULT) [string]
Log filename. If set to DEFAULT uses the name of the task and, if preceded by '!', overwrite the file if it exists. If set to NONE no log file is created.

(debug = no) [boolean]
Diagnostic output is printed out on the screen if set to yes (yes/[no]).

(history = yes) [boolean]
Records tool parameters in HISTORY ([yes]/no).

(mode = ql) [string ql|hl|q]
Mode to query the parameter file. Acceptable values include: 'ql' (query and learn/remember), 'hl' (hidden and learn/remember), 'q' (query but don't remember), 'h' (hidden).

EXAMPLES

1. Create an ARF file of SGD1/CC1 for a source at RA = 214.0 deg and Dec = 36.0 deg.

    sgdarfgen infile=input.pi rspfile=sgd1_cc1.rsp outfile=out_sgd1_cc1 ra=214.0 dec=36.0 sgdid=1 ccid=1

2. Create ARF files of all CCs of SGD2 for a source at RA = 214.0 deg and Dec = 36.0 deg.

    sgdarfgen infile=input.pi rspfile=sgd2_cc1.rsp,sgd2_cc2.rsp,sgd2_cc3.rsp outfile=out_sgd1 ra=214.0 dec=36.0 sgdid=2 ccid=0

SEE ALSO

LAST MODIFIED

February 2016