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.sepconvolvegui - Function Up: image - Tool Previous: image.restoringbeam - Function


image.sepconvolve - Function



Package general
Module images
Tool image


Separable convolution


Synopsis
sepconvolve(outfile, axes, types, widths, scale, region, mask, overwrite, async)


Arguments

outfile in Output image file name
    Allowed: String
    Default: unset
axes in Axes to convolve
    Allowed: Vector of integers
    Default: [1,2,...]
types in Type of convolution kernel
    Allowed: Vector of strings from `boxcar', `gaussian', and `hanning'
    Default: 'gaussian'
widths in Convolution kernel widths
    Allowed: Vector of numeric, quantity or string
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 sc) 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 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 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=dq.quantity("1arcsec 0.00001rad"). Note that you can use pixel units, viz. widths=dq.quantity("10pix 0.00001rad") see below.

  • String - for example widths="1km 2arcsec" (i.e. a string that the Quanta Constructor 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.



Example
- dowait := T
- im := image('xyv')
- im2 := im.sepconvolve(outfile='xyv.con', axes=[2,3], types="gauss box", widths=[10,20])





next up previous contents index
Next: image.sepconvolvegui - Function Up: image - Tool Previous: image.restoringbeam - 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