NRAO Home > CASA > CASA Toolkit Reference Manual
ms.continuumsub - Function

1.3.1 Continuum fitting and subtraction in uv plane


Description

This function provides a means of continuum determination and subtraction by fitting a polynomial of desired order to a subset of channels in each time-averaged uv spectrum. The fit is used to model the continuum in all channels (not just those used in the fit), for subtraction, if desired. Use the fitspw parameter to limit the spectral windows processed and the range of channels used to estimate the continuum in each (avoid channels containing spectral lines). The default solution interval ’int’ will result in per-integration continuum fits for each baseline. The mode parameter indicates how the continuum model (the result of the fit) should be used: ’subtract’ will store the continuum model in the MODEL_DATA column and subtract it from the CORRECTED_DATA column; ’replace’ will replace the CORRECTED_DATA column with the continuum model (useful if you want to image the continuum model result); and ’model’ will only store the continuum model in the MODEL_DATA column (the CORRECTED_DATA is unaffected).

It is important to start the ms tool with nomodify=False so that changes to the dataset will be allowed (see example below).

For now, the only way to recover the un-subtracted CORRECTED_DATA column is to use calibrater.correct() again.

Note that the MODEL_DATA and CORRECTED_DATA columns must be present for continuumsub to work correctly. The function will warn the user if they are not present, and abort. To add these scratch columns (for now), close the ms tool, then start a calibrater or an imager tool, which will add the scratch columns. Then restart the ms tool, and try continuumsub again.

Options for shifting known bright sources to the phase center and for editing based on the rms fit will be added in the near future.

Arguments





Inputs

field

Select fields to fit

allowed:

any

Default:

variant

fitspw

Spectral windows/channels to use for fitting the continuum; default all spectral windows in all channels

allowed:

any

Default:

variant

spw

Select spectral windows and channels from which to subtract a continuum estimate; default: all channels in all spectral windows for which the continuum was estimated

allowed:

any

Default:

variant

solint

Continuum fit timescale (units optional)

allowed:

any

Default:

variant int

fitorder

Polynomial order for fit

allowed:

int

Default:

0

mode

Desired use of fit model (see below)

allowed:

string

Default:

subtract

Returns
bool

Example

 
 
 ms.fromfits(’ngc5921.ms’,’/aips++/data/demo/NGC5921.fits’)  
 ms.close()  
 cb.open(’ngc5921.ms’)  # add MODEL_DATA, CORRECTED_DATA columns  
 cb.close()  
 ms.open(’ngc5921.ms’,nomodify=False);    # writable!  
 ms.continuumsub(field=2,fitspw=’0:5~9;50~59’,  
                 solint=0.0,fitorder=1,mode=’sub’)  
 ms.done()  
 
    This example will fit a linear continuum to channels 5-9 and 50-59 in  
    spectral window 0 in each scan-averaged spectrum for field 2, and  
    store the result in the MODEL\_DATA column and subtract it from the  
    CORRECTED\_DATA column.  
 

__________________________________________________________________


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