

NRAO Home > CASA > CASA Toolkit Reference Manual 

5.1.6 sd.linefinder  Tool
Line finder tool for singledish spectrum
Description
The linefinder performs automated spectral line search. The algorithm involves
a simple threshold criterion. The line is considered to be detected if a specified
number of consecutive channels (default is 3) is brighter (with respect to the
current baseline estimate) than the threshold times the noise level. This
criterion is applied in the iterative procedure updating baseline estimate and
trying reduced spectral resolutions to detect broad lines as well. The offline
noise level is determined at each iteration as an average of 80% of the lowest
variances across the spectrum (i.e. histogram equalization is used to avoid
missing weak lines if strong ones are present). For bad baseline shapes it is
recommended to increase the threshold and possibly switch the averaging
option off (see set_options) to detect strong lines only, fit a high order baseline
and repeat the line search.
There are six parameters for the algorithm. These can be set by set_options method of this object.

threshold
A single channel S/N ratio above which the channel is considered to be a detection. Default is sqrt(3), which together with min_nchan=3 gives a 3sigma criterion 
min_nchan
A minimal number of consequtive channels, which should satisfy a threshold criterion to be a detection. Default is 3. 
avg_limit
A number of consequtive channels not greater than this parameter can be averaged to search for broad lines. Default is 8. 
box_size
A running mean/median box size specified as a fraction of the total spectrum length. Default is 1/5 
noise_box
Area of the spectrum used to estimate noise stats. Both string values and numbers are allowed Allowed string values are ’all’ that use all the spectrum (default), and ’box’ means noise box is the same as running mean/median box. Numeric values are defined as a fraction from the spectrum size. Values should be positive. (noise_box == box_size has the same effect as noise_box = ’box’) 
noise_stat
Statistics used to estimate noise. Allowed values are ’mean80’ that use the 80% of the lowest deviations in the noise box (default) and ’median’ means median of deviations in the noise box.
The constructor doesn’t take any arguments. It creates linefinder object without any settings for line finding.
Example
sc=sd.scantable(’sddata.asap’,average=False)
# set data
fl.set_scan(sc)
# set linefinder options
fl.set_options(threshold=3)
# search lines
nlines=fl.find_lines(edge=(50,0))
# get range of lines found
if nlines!=0:
print "Found ",nlines," spectral lines"
print fl.get_ranges(False)
else:
print "No lines found!"
# baseline subtraction using masks provided by linefinder
sc2=sc.poly_baseline(fl.get_mask(),7)
find_lines  Search for spectral lines in the scan 
get_mask  Get the mask to mask all lines that have been found 
get_ranges  Get ranges for all spectral lines found 
set_data  Set the data as an array 
set_options  Set the parameters of the line finding algorithm 
set_scan  Set the data as a scantable 
sd.linefinder.get_mask  Function
sd.linefinder.get_ranges  Function
sd.linefinder.set_data  Function
sd.linefinder.set_options  Function
sd.linefinder.set_scan  Function
More information about CASA may be found at the
CASA web page
Copyright © 2016 Associated Universities Inc., Washington, D.C.
This code is available under the terms of the GNU General Public Lincense
Home  Contact Us  Directories  Site Map  Help  Privacy Policy  Search