nraonrao
 
 NRAO Home > CASA > CasaDocument
image.continuumsub - Function

1.1.1 Image plane continuum subtraction
Description

This function packages the relevant image tool functionality for simple specification and application of image plane continuum subtraction. All that is required of the input image is that it have a non-degenerate Spectral axis.

The user specifies region, the region of the input image over which continuum subtraction is desired (otherwise the whole image will be treated); channels, the subset of channels on the spectral axis to use in the continuum estimation, specified as a vector; pol, the desired single polarization to treat (otherwise all pols, if a polarization axis exists, will be treated); fitorder, the polynomial order to use in the estimation. Optionally, output line and continuum images may be written by specifying outline and outcont, respectively. If outline is not specified, a virtual image tool is all that is produced. If outcont is not specified, the output continuum image will be written in ’continuumsub.im’.

Arguments





Inputs

outline

Output line image filename. Default is unset.

allowed:

string

Default:

outcont

Output continuum image filename

allowed:

string

Default:

continuumsub.im

region

Region over which continuum subtraction is desired. Deafault is whole image.

allowed:

any

Default:

record

channels

Channels to use for continuum estimation. Default is all.

allowed:

intArray

Default:

-1

pol

Polarization to process. String from ”I Q U V XX RR” etc. Default is unset.

allowed:

string

Default:

I Q U V XX RR

fitorder

Polynomial order for continuum estimation

allowed:

int

Default:

0

overwrite

Auto-overwrite output files if they exist?

allowed:

bool

Default:

false

Returns
casaimage

Example

"""  
#  
print "\t----\t continuumsub Ex 1 \t----"  
ia.fromarray(outfile=’test.data’,  
             pixels=ia.makearray(0, [64, 64, 4, 128]), overwrite=true)  
#im1csub=ia.continuumsub(region=rg.quarter(),  
#                        channels=range(3,9)+range(54,61),fitorder=0);  
innerquarter=ia.setboxregion([0.25,0.25],[0.75,0.75],frac=true)  
im1csub=ia.continuumsub(region=innerquarter,  
                        channels=range(3,9)+range(54,61),fitorder=0);  
im1csub.done()      # done the on-the-fly image tool  
ia.close()  
#  
"""

In this first example, the continuum emission in each pixel of the inner quarter of the input image is estimated by averaging (fitorder=0) channels 3-8 and 54-60, inclusive. (Python’s range function includes the lower limit and excludes the upper limit.) im1csub is an image tool containing the result (only the inner quarter of the original image).

"""  
#  
print "\t----\t continuumsub Ex 2 \t----"  
ia.fromarray(outfile=’test.data’,  
             pixels=ia.makearray(0, [64, 64, 4, 128]), overwrite=true)  
im2csub=ia.continuumsub(channels=range(3,9)+range(54,61),pol=’I’,fitorder=2)  
im2csub.done()  
ia.close()  
#  
"""

In this second example, the Stokes I continuum emission in each pixel of the whole input image is estimated with a 2nd-order polynomial fit to channels 3-8 and 54-60. The output image tool (im2csub) contains only Stokes I, even if the original image had other stokes planes.

Please send any comments or questions about CASA or AIPS++ to aips2-requests@nrao.edu

Copyright © 2007 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

Updated daily during alpha development.