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

1.1.1 Convolve image with an array or another image
Description

This function does Fourier-based convolution of an image file by the given kernel.

If outfile is given, the image is written to the specified disk file. If outfile is unset, the on-the-fly Image tool generated by this function is associated with a temporary image. This temporary image may be in memory or on disk, depending on its size. When you destroy the generated Image tool (with the done function) this temporary image is deleted.

The kernel is provided as a multi-dimensional array or as the filename of a disk-based image file. The provided kernel can have fewer dimensions than the image being convolved. In this case, it will be padded with degenerate axes. An error will result if the kernel has more dimensions than the image. No additional scaling of the kernel is provided yet.

The scaling of the output image is determined by the argument scale. If you leave it unset, then the kernel is normalized to unit sum. If you do not leave scale unset, then the convolution kernel will be scaled (multipled) by this value.

Masked pixels will be assigned the value 0.0 before convolution.

The output mask is the combination (logical OR) of the default input pixel mask (if any) and the OTF mask. Any other input pixel masks will not be copied. Use function maskhandler if you need to copy other masks too.

See also the other convolution functions convolve2d, sepconvolve and hanning.

Arguments





Inputs

outfile

Output image file name. Default is unset.

allowed:

string

Default:

kernel

Convolution kernel - array or image filename. Must be specified.

allowed:

any

Default:

variant

scale

Scale factor. Default is autoscale.

allowed:

double

Default:

-1.0

region

Region of interest. Default is whole image.

allowed:

any

Default:

record

mask

OTF mask, Boolean LEL expression or mask region. Default is none.

allowed:

any

Default:

variant

overwrite

Overwrite (unprompted) pre-existing output file?

allowed:

bool

Default:

false

async

Run asynchronously?

allowed:

bool

Default:

false

Returns
casaimage

Example

"""  
#  
print "\t----\t convole Ex 1 \t----"  
ia.open(infile=’test.data’)  
# r1=rg.quarter()  
# kernel = mykernel(...)                     # Your code to generate the kernel  
# im2=ia.convolve(kernel=kernel, region=r1)  # Makes temporary image  
r1=ia.setboxregion([0.45,0.45],[0.55,0.55],frac=true)  
print "Convolving... [This takes awhile]"  
im3 = ia.convolve (kernel=ia.name(F), region=r1) # Convolve by self  
ia.close()  
im3.done()  
#  
"""

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.