Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1488 |
|
Package | general | |
Module | images | |
Tool | image |
outfile | in | Output image file name | |
Allowed: | String | ||
Default: | unset | ||
axes | in | Axes to convolve | |
Allowed: | Vector (length 2) of integers | ||
Default: | [1,2] | ||
type | in | Type of convolution kernel | |
Allowed: | String from 'gaussian' | ||
Default: | 'gaussian' | ||
major | in | Major axis | |
Allowed: | Quantity, string, numeric | ||
minor | in | Minor axis | |
Allowed: | Quantity, string, numeric | ||
pa | in | Position Angle | |
Allowed: | Quantity, string, numeric | ||
Default: | 0deg | ||
scale | in | Scale factor | |
Allowed: | Float | ||
Default: | Autoscale | ||
region | in | Region of interest | |
Allowed: | Region tool | ||
Default: | Whole image | ||
mask | in | OTF mask | |
Allowed: | Boolean LEL expression or mask region | ||
Default: | None | ||
overwrite | in | Overwrite (unprompted) pre-existing output file ? | |
Allowed: | T or F | ||
Default: | F | ||
async | in | Run asynchronously? | |
Allowed: | Bool | ||
Default: | !dowait |
This function (short-hand name c2d) does Fourier-based convolution of an image file by the given 2D kernel.
If outfile is unset, the image is written to the specified disk file. If outfile is not given, the Image tool 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 2 pixel axes of the image you wish to convolve via the axes argument.
You specify the type of convolution kernel with type (minimum match is active); currently only 'gaussian' is available. With time others will be implemented.
You specify the parameters of the convolution kernel via the arguments major, minor, and pa. These arguments can be specified in one of three ways
The interpretation of major and minor depends upon the kernel type.
The position angle is measured North through East when you convolve a plane holding a celestial coordinate (the usual astronomical convention). For other axis/coordinate combinations, a positive position angle is measured from +x to +y in the absolute pixel coordinate frame (x is the first axis that you specify with argument axes).
The scaling of the output image is determined by the argument scale. If you leave it unset, then autoscaling will be invoked.
If you are not convolving the sky, then autoscaling means that the convolution kernel will be normalized to have unit volume so as to conserve flux.
If you are convolving the sky, then there are two cases for which autoscaling is useful.
Firstly, if the input image units are Jy/pixel, then the output image will have units of Jy/beam and be appropriately scaled. In addition, the restoring beam of the output image will be the same as the convolution kernel.
Secondly,if the input image units are Jy/beam, then the output image will also have units of Jy/beam and be appropriately scaled. In addition, the restoring beam of the output image will be the convolution of the input image restoring beam and the convolution kernel.
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 convolve, hanning, and sepconvolve.
dowait := T im := image('xfy') # RA/Freq/DEC im2 := im.convolve2d(outfile='xyf.con', axes=[1,3], type='gauss', major='20arcsec', minor='10arcsec', pa=45); # im := image('xyf') # RA/DEC/Freq im2 := im.convolve2d(outfile='xyf.con', axes=[1,3], type='gauss', major='20pix', minor='10pix', pa=45);In the second example we must use pixel units because axes 1 and 3 are unlike.