|
|||
NRAO Home > CASA > CASA Toolkit Reference Manual |
|
image.sepconvolve - Function
1.1.1 Separable convolution
Description
This function does Fourier-based convolution of an image file by a specified
separable kernel.
If outfile is given, the image is written to the specified disk file. If outfile is unset, the on-the-fly Image tool returned 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 Image tool (with the done function) this temporary image is deleted.
You specify which axes of the image you wish to convolve, by what kernel of what width. The kernel types can be shortened to ‘gauss’, ‘hann’ and ‘box’.
You specify the widths of the convolution kernels via the argument widths. The values can be specified as a vector of three different types.
- Quantity - for example widths=qa.quantity("1arcsec 0.00001rad"). Note that you can use pixel units, viz. widths=qa.quantity("10pix 0.00001rad") see below.
- String - for example widths="1km 2arcsec" (i.e. a string that qa.quantity() accepts).
- Numeric - for example widths=[10,20]. In this case, the units of the widths are assumed to be in pixels.
The interpretation of widths depends upon the kernel type.
- Gaussian - the specified width is the full-width at half-maximum.
- Boxcar (tophat) - the specified width is the full width.
- Hanning - The kernel is $z[i] = 0.25*y[i-1] + 0.5*y[i] + 0.25*y[i+1]$. The width is always 3 pixels, regardless of what you give (but you still have to give it !).
The scaling of the output image is determined by the argument scale. If you leave it unset, then autoscaling will be invoked which means that the convolution kernels will all be normalized to have unit volume to as to conserve flux.
If you do not leave scale unset, then the convolution kernel will be scaled by this value (it has peak unity before application of this scale factor).
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, convolve and hanning.
Arguments
Inputs |
| ||
outfile |
| Output image file name. Default is unset.
| |
| allowed: | string |
|
| Default: |
|
|
axes |
| Axes to convolve. Default is [0,1,...].
| |
| allowed: | intArray |
|
| Default: | -1 | |
types |
| Type of convolution kernel. Vector of
strings from ’boxcar’, ’gaussian’, and ’hanning’. Default
is appropriately sized vector of ’gaussian’.
| |
| allowed: | stringArray |
|
| Default: |
| |
widths |
| Convolution kernel widths, Vector of numeric, quantity
or string
| |
| allowed: | any |
|
| Default: | variant
|
|
scale |
| Scale factor. Default is autoscale.
| |
| allowed: | double |
|
| Default: | -1 |
|
region |
| Region selection. See ”help par.region” for details.
Default is to use the full image.
| |
| allowed: | any |
|
| Default: | region
|
|
mask |
| Mask to use. See help par.mask. Default is none.
| |
| allowed: | any |
|
| Default: | variant
|
|
overwrite |
| Overwrite (unprompted) pre-existing output file?
| |
| allowed: | bool |
|
| Default: | false |
|
stretch |
| Stretch the mask if necessary and possible? See help
par.stretch. Default False
| |
| allowed: | bool |
|
| Default: | false |
|
image
Example
"""
#
print "\t----\t sepconvolve Ex 1 \t----"
ia.maketestimage(’xyv’,overwrite=true)
im2 = ia.sepconvolve(outfile=’xyv.con’, axes=[0,1], types=["gauss","box"], widths=[10,20], overwrite=true)
im2.done()
ia.close()
#
"""
__________________________________________________________________
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