|
|||
NRAO Home > CASA > CASA Cookbook and User Reference Manual |
|
6.10 Collapsing an Image Along an Axis (imcollapse)
imcollapse allows to apply an aggregation function along one or more axes of an image. Functions supported are ’max’, ’mean’, ’median’, ’min’, ’rms’, ’stdev’, ’sum’, ’variance’ (minimum match supported). The relevant axes will then collapse to a single value or plane (i.e. they will result in a degenerate axis). The functions are specified in the function parameter of the imcollapse inputs:
imagename = ’’ # Name of the input image
function = ’’ # Function used to compute aggregation
# of pixel values.
axes = [0] # Zero-based axis number(s) or minimal
# match strings to collapse.
outfile = ’’ # Name of output CASA image.
box = ’’ # Optional direction plane box ("blcx,
# blcy, trcx trcy").
region = ’’ # Name of optional region file to use.
chans = ’’ # Optional zero-based contiguous
# frequency channel specification.
stokes = ’’ # Optional contiguous stokes planes
# specification.
mask = ’’ # Optional mask to use.
wantreturn = True # Should an image analysis tool
# referencing the collapsed image be
# returned?
async = False # If true the taskname must be started
wantreturn=True returns an image analysis tool containing the newly created collapsed image.
Example:
myimage.im is a 512x512x128x4 (ra,dec,freq,stokes; i.e. in the 0-based system, frequency is labeled as axis 2) image and we want to collapse a subimage of it along its spectral axis avoiding the 8 edge channels at each end of the band, computing the mean value of the pixels (resulting image is 256x256x1x4 in size):
function="mean", axis=2, box="127,127,383,383", chans="8~119")
More information about CASA may be found at the
CASA web page
Copyright © 2010 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