NRAO Home > CASA > CASA Toolkit Reference Manual

5.1.6 sd.linefinder - Tool

Line finder tool for single-dish 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 off-line 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.

The constructor doesn’t take any arguments. It creates linefinder object without any settings for line finding.

Example

       fl=sd.linefinder()  
       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)

Methods

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_optionsSet the parameters of the line finding algorithm
set_scan Set the data as a scantable

    sd.linefinder.find_lines - Function
    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