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

5.1.2 Perform a 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.

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

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)  
        # return a scan baselined by a combination of sinusoidal curves having  
        # wave numbers in spectral window up to 10,  
        # also with 3-sigma clipping, iteration up to 4 times  
        bscan = scan.sinusoid_baseline(addwn=’<=10’,clipthresh=3.0,clipniter=4)


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