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

5.1.2 Perform automatic line finding and baseline subtraction using cubic spline function
Description

Return a scan which has been baselined (all rows) by cubic spline function (piecewise cubic polynomial). Fit will be done with ’sigma-clipping’.

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

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

Default:

None (no mask)

npiece

Number of pieces

allowed:

integer

Default:

2

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)  
        bscan = scan.auto_cspline_baseline(npiece=3, 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