Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1488
News FAQ
Search Home


next up previous contents index
Next: image.coordsys - Function Up: image - Tool Previous: image.convertsm - Function


image.convolve2d - Function



Package general
Module images
Tool image


Convolve image by a 2D kernel


Synopsis
convolve2d(outfile, axes, type, major, minor, pa, scale, region, mask, overwrite, async)


Arguments

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


Returns
Image tool or fail



Description

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

  • Quantity - for example major=dq.quantity(1, 'arcsec') Note that you can use pixel units, viz. major=dq.quantity(1, 'pix'), see below.

  • String - for example minor='1km' (i.e. one that the Quanta Constructor accepts).
  • Numeric - for example major=10. In this case, the units of major and minor are assumed to be in pixels. Using pixel units allows you to convolve unlike axes. For the position angle, units of degrees are assumed.

The interpretation of major and minor depends upon the kernel type.

  • Gaussian - major and minor are the Full Width at Half Maxiumum (FWHM) of the major and minor axes of the Gaussian.

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.



Example
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.





next up previous contents index
Next: image.coordsys - Function Up: image - Tool Previous: image.convertsm - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-08-01