<casaxml xsi:schemaLocation="http://casa.nrao.edu/schema/casa.xsd file:///opt/casa/code/xmlcasa/xml/casa.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://casa.nrao.edu/schema/psetTypes.html">
<task category="analysis" name="imcollapse" type="function">
<shortdescription>Collapse image along one axis, aggregating pixel values along that axis.</shortdescription>
This task collapses an image along a specified axis or set of axes of
N pixels to a single pixel on each specified axis. Both float valued
and complex valued images are supported. It computes the specified
aggregate function for pixel values along the specified axes and
places those values in the single remaining plane of those axes in the
The reference pixel of the collapsed axis is set to 0 and its
reference value is set to the mean of the the first and last values of
that axis in the specified region of the input image. Convolution to a
common beam is not performed automatically as part of the
preprocessing before the collapse operation occurs. Therefore, if the
input image has per-plane beams, then the user should consider first
smoothing the data to have the same resolution, and use the resulting
image as the input for imcollapse.
<param mustexist="true" name="imagename" type="path">
<shortdescription>Name of the input image</shortdescription>
<description>Name of the input image
Example: imagename='ngc5921.im'
<example>imagename='ngc5921.im'</example>
<param name="function" type="string">
<shortdescription>Aggregate function to apply. This can be set one of flux, madm, max, mean, median, min, npts, rms, stddev, sum, variance, xmadm. Must be specified.</shortdescription>
<description>Function used to compute aggregation of pixel values
along the collapsed axis.
Options: flux, madm, max, mean, median, min,
npts, rms, stddev, sum, variance, xmadm
Minimum match is supported for the function
parameter (eg, function="r" will compute the rms
If one specifies function='flux', the following
constraints must be true:
1. The image must have a direction coordinate,
2. The image must have at least one beam,
3. The specified axes must be exactly the
direction coordinate axes,
4. Only one of the non-directional axes may be
5. The iamge brightness unit must be conformant
with x*yJy/beam, where x is an optional unit
(such as km/s for moments images) and y is an
<example>function="max"</example>
<example>function="rms</example>
<example>function="mean"</example>
<param name="axes" type="variant">
<shortdescription>Zero-based axis number(s) or minimal match strings to collapse.</shortdescription>
<description>Zero-based axis number(s) or minimal match strings to
Axes can be specified as a single integer or
array of integers indicating the zero-based axes
along which to collapse the image. Axes may also
be specified as a single or array of strings
which minimally and uniquely match (ignoring
case) world axes names in the image (eg "dec" or
["ri, "d"] for collapsing along the declination
axis or along the right ascension and declination
<example>axis=2</example>
<param name="outfile" type="string">
<shortdescription>Name of output CASA image. Must be specified.</shortdescription>