Admit Line Finder

This module defines the class for spectral line detection and identification.

class admit.util.AdmitLineFinder.AdmitLineFinder(nchan=0, name='', spec=None, vlsr=0.0)

The AdmitLineFinder class inherits from the asap linefinder class. It takes a spectrum (list, CubeSpectrum_BDP, or CubeStats_BDP) and turns it into a scantable. The scantable is then search for spectral lines, with the given parameters.

Parameters:

nchan : int

Number of channels in the input spoectrum, can also be calculated from the input spectrum. Default: 0

name : string

Name of the temporary scantable file. Default: “”

spec : various

Input spectrum, can be a list, CubeSpectrum_BDP, or CubeStats_BDP. Default: None

vlsr : float

Source vlsr. Used to convert the sky frequency to source frequency. Set to 0.0 if no correction is needed. Default: 0.0

Attributes

nchan (int) Number of spectral channels
name (string) Name of the temporary scantable
spectrum (list) Spectrum to be analyzed
freq (list) Frequency axis (one entry per channel)
lines_merged (list) Merged list of overlapping lines.
tb (casa table) Casa table that is converted to a scantable.
bdp (BDP) Input spectrum BDP.

Methods

find([merge]) Method to do the actual searching
find_lines([nRow, mask, edge]) Search for spectral lines in the scan assigned in set_scan.
findpeak(ranges) Method to find the spectral peak in a given range
get_mask([invert]) Get the mask to mask out all lines that have been found (default)
get_merged_ranges() Get a list of merged line ranges.
get_ranges([defunits]) Get ranges (start and end channels or velocities) for all spectral lines found.
getfwhm(ch, peak) Method to determine the FMHW (roughly) of a spectral line
getspec() Method to get the frequency based spectrum
init() Create dummy scantable to work with linefinder, should not be directly called.
makepairs(inp) Method to turn a list into a list of pairs
merge_lines(lines[, frac]) Merge lines if those are close enough.
set_data(spectrum) Set the ‘data’ (spectrum) to work with Parameters: a method to allow linefinder work without setting scantable for the purpose of using linefinder inside some method in scantable class.
set_options([threshold, min_nchan, ...]) Set the options for the linefinding algorithm.
set_scan(scan) Set the ‘data’ (scantable) to work with.
set_spectrum(spec[, vlsr]) Set the spectrum you want to search for lines.
find(merge=False)

Method to do the actual searching

Parameters:

merge : Boolean

Whether or not to merge overlapping lines Deafult: False

Returns:

tuple containing the frequency ranges, channel ranges, and rms

findpeak(ranges)

Method to find the spectral peak in a given range

Parameters:

ranges : list

List of a pair of points, the endpoitns of the region to search

Returns:

Tuple, containing the peak intensity and the frequency of the peak.

get_merged_ranges()

Get a list of merged line ranges.

Parameters:None
Returns:List of merged lines
getfwhm(ch, peak)

Method to determine the FMHW (roughly) of a spectral line

Parameters:

ch : list

Pair of channels, start and end, to work with

peak : float

The peak intensity of the channels being searched.

Returns:

Float of the rough FWHM in km/s

getspec()

Method to get the frequency based spectrum

Parameters:None
Returns:Typle of lists, frequency and spectrum of all channels
init()

Create dummy scantable to work with linefinder, should not be directly called.

Parameters:None
Returns:None
makepairs(inp)

Method to turn a list into a list of pairs

Parameters:

inp : list

The list to convert

Returns:

List of pairs.

merge_lines(lines, frac=0.25)

Merge lines if those are close enough.

Parameters:

lines: list

line list detected by linefinder algorithm

frac: float

Criterion for merge as a fraction of line width for narrower line. Default: 0.25

Returns:

The new number of lines

set_options(threshold=1.7320508075688772, min_nchan=3, avg_limit=8, box_size=0.2, noise_box='all', noise_stat='mean80')

Set the options for the linefinding algorithm.

Parameters:

threshold : float

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 3-sigma criterion. Default: sqrt(3)

min_chan : int

A minimal number of consequtive channels, which should satisfy the threshold criterion to be a detection. Default: 3

avg_limit : int

A number of consequtive channels not greater than this parameter can be averaged to search for broad lines. Default: 8

box_size : float

A running mean box size specified as a fraction of the total spectrum length. Default: 0.2

noise_box : string/float

Area of the spectrum used to estimate noise stats. Both string values and numbers are allowed. Allowed string values: ‘all’ use all the spectrum, ‘box’ 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’). Default: ‘all’

noise_stat : string

Statistics used to estimate noise, allowed values: ‘mean80’ use the 80% of the lowest deviations in the noise box, ‘median’ median of deviations in the noise box Default: ‘mean80’

Returns:

None

set_spectrum(spec, vlsr=0.0)

Set the spectrum you want to search for lines. If the input spectrum was passed to the constructor there is no need to call this routine.

Parameters:

spec : list or BDP

The input spectrum

vlsr : float

The source vlsr, used to correct from sky to source frame. Set to 0.0 if no correction is needed.

Returns:

None

Previous topic

Utilities Package

This Page