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

1.1.1 Convolve one axis of image with a Hanning kernel
Description

This function performs Hanning convolution (z[i] = 0.25 * y[i - 1] + 0.5 * y[i] + 0.25 * y[i + 1]) of one axis of an image. The convolution is done in the image domain (i.e., not with an FFT). You can optionally drop every other pixel on output. If you do this, the first output pixel is centered on the second input pixel.

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 on-the-fly Image tool created by this function (with the done function) this temporary image is deleted.

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

Arguments





Inputs

outfile

Output image file name. Default is unset.

allowed:

string

Default:

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

axis

Axis to convolve. Default is spectral axis if there is one

allowed:

int

Default:

-10

drop

Drop every other pixel on output?

allowed:

bool

Default:

true

overwrite

Overwrite (unprompted) pre-existing output file?

allowed:

bool

Default:

false

async

Run asynchronously?

allowed:

bool

Default:

false

Returns
casaimage

Example

"""  
print "\t----\t hanning Ex 1 \t----"  
ia.fromshape(’x’, shape=[64,64,128], overwrite=true)  
print ia.summary()  
im2 = ia.hanning(outfile=’x.hann’)  
print im2.summary()  
im2.done(remove=T)  
ia.close()  
#  
"""

This would Hanning smooth the spectral axis of the image associated with the default image tool ia, if there is one. Every other pixel on the convolution axis is dropped on output, by default.

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.