imcontsub(imagename, linefile='', contfile='', fitorder=0, region='', box='', chans='', stokes='')[source]

Estimates and subtracts continuum emission from an image cube

[Description] [Examples] [Development] [Details]

  • imagename (path) - Name of the input spectral line image

  • linefile (string=’’) - Output continuum-subtracted image file name

  • contfile (string=’’) - Output continuum image file name

  • fitorder (int=0) - Polynomial order for the continuum estimation

  • region (string=’’) - Region selection.

  • box ({string, intVec, stringVec}=’’) - Rectangular region to select in direction plane. Default is to use the entire direction plane.

  • chans (string=’’) - Channels to use.

  • stokes (string=’’) - Stokes planes to use.


imcontsub task: Estimates and subtracts continuum emission from an image cube

For each direction pixel in an image (or a subset selected by region and/or box), this task estimates the continuum by fitting a polynomial to one or more subsets of the channels. In most cases, the user should choose the subset(s) of channels to be free of spectral lines. The continuum estimate is saved in contfile and subtracted from the image (or its subset) to make a spectral line estimate, which is saved in linefile.

While imcontsub offers users the option to save the continuum estimate as a (multi-channel) dataset, the optimal way to create a continuum image is by using the multi-frequency synthesis (MFS) option in tclean.

Note that fitting the continuum and subtracting it from a spectral line data set can also be done in the (u,v)-domain using the task uvcontsub.

Task-specific Parameter Descriptions


Name of image to which to save the result of subtracting the computed continuum from the input image.


The computed continuum image.


Order of polynomial to fit to the specified spectral channels to determine the continuum.


Spectral channels to use for fitting a polynomial to determine continuum.


Fit a second order polynomial (fitorder=2) to channels 3-8 and 54-60 to an RA x Dec x Frequency x Stokes cube, selecting the Stokes I plane

ch = '3~8, 54~60'
imcontsub(imagename="", linefile="",
          fitorder=2, chans=ch, fitorder=2, stokes="I")

No additional development details

Parameter Details

Detailed descriptions of each function parameter

imagename (path) - Input image cube.
Default: none
Example: imagename=’’
linefile (string='') - Name of continuum-subtracted output spectral line cube
Default: none
Example: outline=’’
contfile (string='') - Name of output continuum cube
Default: none
Example: contfile=’’
fitorder (int=0) - Polynomial order for the continuum estimation
Default: 0
Example: fitorder=2
region (string='') - Region selection.
Default: ‘’ (use the full image)
box ({string, intVec, stringVec}='') - Rectangular region to select in direction plane.
Default: ‘’ (use the entire direction plane)
chans (string='') - Channels to use.
Default: ‘’ (use all channels)
stokes (string='') - Stokes planes to use.
Default: ‘’ (use all Stokes planes)