NRAO Home > CASA > CASA Toolkit Reference Manual
sd.scantable.auto_sinusoid_baseline - Function

5.1.2 Perform automatic line finding and baseline subtraction using sinusoidal function
Description

Return a scan which has been baselined (all rows) with sinusoidal functions. Fit will be done with ’sigma-clipping’.

Spectral lines are detected first using linefinder and masked out to avoid them affecting the baseline solution.

If applyfft is set to True, the function performs Fourier analysis to select wave numbers for sinusoidal fitting. Currently, ’fft’ is only available to be used for the analysis. You can specify threshold for selection of wave number using fftthresh parameter. Both float and string is acceptable. Given a float value, the unit is set to sigma. For string values, allowed formats include:

In addition, you can add or reject specific wave numbers from the fit using addwn and rejwn, respectively. You can specify wave numbers as an integer, string, or list of them. For string specification, syntax for those parameters are as follows:

You can append ’=’ after inequality sign. When both addwn and rejwn are set, rejwn will take priority of addwn.

The edge argument is an optional number of channel to drop at the edge of spectrum. If only one value is specified, the same number will be dropped from both sides of the spectrum. Default is to keep all channels. Nested tuples represent individual edge selection for different IFs (a number of spectral channels can be different).

The threshold and chan_avg_limit arguments are linefinder options. The former is the threshold used by line finder. It is better to keep it large as only strong lines affect the baseline solution. The later is a maximum number of consequtive spectral channels to average during the search of weak and broad lines. The default is no averaging (and no search for weak lines). If such lines can affect the fitted baseline (e.g. a high order polynomial is fitted), increase this parameter (usually values up to 8 are reasonable). Most users of this method should find the default value sufficient. See linefinder for more details on these options.

Note: The best-fit parameter values output in logger and/or blfile are now based on specunit of ’channel’.

Arguments





Inputs

insitu

If False a new scantable is returned

allowed:

bool

Default:

None (use default value)

mask

An optional mask retreived from scantable

allowed:

bool array

Default:

None (no mask)

applyfft

Perform Fourier analysis to find appropriate sinusoidal component

allowed:

bool

Default:

True

fftmethod

Method to find sinusoidal component (currently only ’fft’ is available)

allowed:

string

Default:

’fft’

fftthresh

Threshod to select wave number in Fourier analysis

allowed:

float, string

Default:

3.0

addwn

Additional wave numbers to be used for fitting

allowed:

integer, string, any array

Default:

[]

rejwn

Waver numbers not to be used for fitting

allowed:

integer, string, any array

Default:

[]

clipthresh

Clipping threshold in unit of sigma

allowed:

float

Default:

3.0

clipniter

Maximum number of iteration of clipping

allowed:

integer

Default:

0

edge

An optional number of channel to drop at the edge of spectrum

allowed:

integer, integer array

Default:

(0,0)

threshold

The threshold used by line finder

allowed:

float

Default:

3

chan_avg_limit

A maximum number of consequtive spectral channels to average during the search

allowed:

int

Default:

1

plot

Plot the fit and the residual (currently unavailable)

allowed:

bool

Default:

False

getresidual

If False, return best-fit value instead of residual

allowed:

bool

Default:

True

showprogress

Show progress status for large data

allowed:

bool

Default:

True

minnrow

Minimum number of spectra to show progress status

allowed:

integer

Default:

1000

outlog

Output the coefficients of the best-fit function to logger

allowed:

bool

Default:

False

blfile

Name of text file in which the best-fit parameter values to be written

allowed:

string

Default:





Returns
scantable

Example

        scan = sd.scantable(’OrionS_rawACSmod_cal’,average=False)  
        scan2 = scan.auto_sinusoid_baseline(addwn=’<=10’, insitu=False)


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