NRAO Home > CASA > CASA Toolkit Reference Manual
image.fft - Function

1.1.1 FFT the image


Description

This function fast Fourier Transforms the supplied image to the Fourier plane. Both float valued and complex valued images are supported. If the axes parameter is left unset, then the sky plane of the image (if there is one) is transformed. Otherwise, the user can specify which axes are to be transformed. Note that if a sky axis is to be transformed, both of them must be specified.

The user specifies which form is desired in the result by specifying the desired output image file name(s).

Before the FFT is performed, any masked pixels are set to values of zero. 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. The function maskhandler can be used if there is a need to copy other masks too.

Arguments





Inputs

real

Output real image file name.

allowed:

string

Default:

imag

Output imaginary image file name.

allowed:

string

Default:

amp

Output amplitude image file name.

allowed:

string

Default:

phase

Output phase image file name.

allowed:

string

Default:

axes

Specify the pixel axes that are to undergo the FFT. The default option (-1) is to transform the sky plane(s).

allowed:

intArray

Default:

-1

region

Region selection. Default is to use the full image.

allowed:

any

Default:

variant

mask

The mask to be used. The default option is none.

allowed:

any

Default:

variant

stretch

Stretch the mask if it is necessary and possible.

allowed:

bool

Default:

false

complex

Output complex valued image file name.

allowed:

string

Default:

Returns
bool

Example

 
 
"""  
#  
print "\t----\t fft Ex 1 \t----"  
# Create a test image:  
ia.maketestimage(’gc.small’, overwrite=true)  
# Perform an FFT on the sky plane of the test image,  
# writing out just the resulting real and amplitude images:  
ia.fft(real=’r.im’, amp=’a.im’)  
# Close the image tool when done:  
ia.close()  
# Lastly, clean up the example output files:  
ia.removefile(’r.im’)  
ia.removefile(’a.im’)  
#  
"""  
 

Example

 
 
"""  
#  
print "\t----\t fft Ex 2 \t----"  
# Create a zero-filled 3D test dataset and add noise to it:  
ia.fromshape(’gc.small’, [64,64,128], overwrite=true)  
ia.addnoise(type=’normal’, pars=[0.5, 1], zero=false)  
# The following transforms only the third axis of the image.  
# writing out only the amplitude and phase images.  
ia.fft(amp=’amp.im’, phase=’p.im’, axes=[2])  
# Close the image tool when done:  
ia.close()  
# Lastly, clean up the example output files:  
ia.removefile(’amp.im’)  
ia.removefile(’p.im’)  
#  
"""  
 

__________________________________________________________________


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