Last modified: December 2022

Jump to: Description · Example · Parameters · Bugs · See Also

AHELP for CIAO 4.15


Context: Tools::Gratings


Automatically choose between tgdetect and tg_findzo for determining the zeroth order centroid


tg_choose_method infile method [verbose]


CIAO has two primary methods for determining the zeroth order centroid in ACIS observations, the familiar point-source image-detection (celldetect, via tgdetect) and for bright sources, use of the CCD frame-shift streak (tg_findzo). The latter is necessary if the zeroth order is heavily distorted by pileup, or if it is blocked from telemetry. tg_choose_method will make a good guess at the appropriate method from the observation itself.

The choice of method is based on the relation between the zeroth order count rate and the dispersed spectrum rate. Using empirical values from over 700 observations processed with both tgdetect and tg_findzo, criteria have been derived which are sensitive to the zeroth order quality and which provide the correct choice of method in all but a few cases. This program simply uses a priori defined regions in the zeroth order vs dispersed rate plane in which each method is preferred.

Some cases are pathological and will always require human intervention to review the result (e.g., very crowded fields, very bright, extended sources). Tests have shown that the correct method is chosen in all but about 2% of the cases.

The tool requires that tg_findzo has been run and produced a valid source file. This file has an HDUCLAS3 header keyword value of FINDZO, contains the zeroth order's counts (in table column NET_COUNTS), the grating arm's counts (in header keyword COUNT_TG), and the frame-shift streak's counts (in header keyword COUNT_ST).


tg_choose_method infile=src1a.fits

Take the src1a file produced by tg_findzo and set the output parameter 'method'.


name type ftype def min max reqd
infile file input       yes
method string   unknown      
verbose integer   0 0 5  

Detailed Parameter Descriptions

Parameter=infile (file required filetype=input)

Name of Input src1a file.

The input file must be produced by tg_findzo which contains the header keywords of HDUCLAS3, COUNT_TG, COUNT_ST and TIMEDEL and the column of NET_COUNTS.

Parameter=method (string default=unknown)

Output of the selected program's name, tgdetect or tg_findzo. The default value is "unknown", and an allowed value is "none" (for possible future use).

Parameter=verbose (integer default=0 min=0 max=5)

Program verbosity, 0 (least) to 5 (most).


There are no known bugs for this tool.

See Also

combine_grating_spectra, detilt, dewiggle, dmtype2split, mktgresp, symmetrize, tg_bkg, tg_choose_method, tg_create_mask, tg_findzo, tg_resolve_events, tgdetect, tgdetect2, tgextract, tgextract2, tgidselectsrc, tgmask2reg, tgmatchsrc, tgsplit