Last modified: December 2022

URL: https://cxc.cfa.harvard.edu/ciao/ahelp/tgidselectsrc.html
Jump to: Description · Example · Parameters · Bugs · See Also


AHELP for CIAO 4.16

tgidselectsrc

Context: Tools::Gratings

Synopsis

Filter an input source list based upon a SNR threshold.

Syntax

tgidselectsrc infile outfile snr_ratio_limit [setsrcid] [clobber]
[verbose]

Description

Filter an input source list based upon a SNR ratio threshold. `tgidselectsrc' filters the input file based upon a comparison of the ratio of each sources SNR to the first sources SNR with a threshold input by the user. It is expected that the source file is sorted on SNR, so that the source with the highest SNR is the first. The format of the output file is defined by that of the input file. In addition, if the input file had a TG_SRCID column, or if the user sets setsrcid to yes, then source ids will be calculated for each source and written to the output file. If the input file had a TG_SRCID column the source ids will be reset even if the user set setsrcid to no.

The input file must contain a column labelled SNR. The output file name will have an extension name of SRCLIST.

This tool is called by tgdetect and is not normally run independently.

To detect multiple sources with tgdetect, the snr_ratio_limit must be set below 1.0.

If there are any errors the task will return -1 and print the errors that occurred to the screen. Otherwise zero will be returned.

ALGORITHMS:

SNR Ratio filtering:

if SNR[i]/SNR[1] >= SNR ratio limit then the source[i] is good

This is done for all sources, 1 -> N. Obviously, the first source will always pass, as the maximum allowed value of the SNR limit is 1.0.


Example

tgidselectsrc $INDATA/tgselectsrc_src.fits . 0.95 setsrcid=yes
clobber=yes verbose=4

Process the sources in tgselectsrc_src.fits and use the infile as template for outfile name, set the limit to find sources down to half the SNR of the brightest source.


Parameters

name type ftype def min max reqd autoname
infile file input       yes  
outfile file output       yes yes
snr_ratio_limit real   1.0 0.0 1.0 yes  
setsrcid boolean   yes        
clobber boolean   no        
verbose integer   0        

Detailed Parameter Descriptions

Parameter=infile (file required filetype=input default=)

Name of input source table.

Parameter=outfile (file required filetype=output default= autoname=yes)

Name of output filtered source file

Parameter=snr_ratio_limit (real required default=1.0 min=0.0 max=1.0)

Value of SNR ratio to use as lower limit for sources output.

Parameter=setsrcid (boolean default=yes)

Flag to specify whether to assign sequential integer source identifiers to sources selected. (primarily for source-matching between observation intervals by tgdetect).

Parameter=clobber (boolean default=no)

Overwrite existing output file, or don't.

Parameter=verbose (integer default=0)

Control amount of diagnostic chatter from none (0) to most (5).


Bugs

There are no known bugs for this tool.

See Also

chandra
eventdef
tools::background
create_bkg_map
tools::composite
combine_grating_spectra
tools::detect
celldetect, vtpdetect, wavdetect, wrecon, wtransform
tools::gratings
detilt, dewiggle, symmetrize, tg_bkg, tg_choose_method, tg_create_mask, tg_findzo, tg_resolve_events, tgdetect, tgdetect2, tgextract, tgextract2, tgmask2reg, tgmatchsrc, tgsplit
tools::region
rank_roi, regphystocel, roi, splitroi
tools::response
mktgresp
tools::table
dmtype2split