<casaxml xsi:schemaLocation="http://casa.nrao.edu/schema/casa.xsd file:///opt/casa/code/tools/xml/casa.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://casa.nrao.edu/schema/psetTypes.html">
<tool module="ms" name="ms">
<needs>msmetadata</needs>
<shortdescription>Operations on measurement sets</shortdescription>
<keyword>UVFITS</keyword>
<keyword>SDFITS</keyword>
<keyword>FITS-IDI</keyword>
<keyword>FITSIDI</keyword>
<include>ms_forward.h</include>
<include>ms_private.h</include>
The ms tool provides functions to manipulate the contents of
measurement set tables. The functions can be categorised as shown
\medskip\noindent\textbf{Attaching to a Measurement Set}
The simplest and most common way to attach an ms tool to a
measurement set is to use the <link anchor="ms:ms.open">ms.open</link> function which requires that
you specify the name of the measurement set table.
The function <link anchor="ms:ms.fromfits">ms.fromfits</link>
converts a uvfits file to a measurement set table prior to
attaching the ms tool to the newly created measurement set.
take some time if the fits file is large. However it only needs
to be done once. The measurement set table is not deleted when you
close the ms tool, using the close function, or exit casa. And
once the measurement set table is created it is much faster to
attach an ms tool to it using the <link anchor="ms:ms.open">ms.open</link>
\medskip\noindent\textbf{Getting summary information}
The summary function will display, in the logger, an overview of
the measurement set. This will include listings of the fields,
spectral windows and polarization setups used in the measurement
The <link anchor="ms:ms.range.function">range</link> function will provide more
quantitative information on the minimum, maximum or used values of
specified parameters. When using this function you may need to do
an initial selection, as described below, depending on whether the
parameters you ask for change their shape. The lister function
provides a concise listing of the data in the measurement set.
The listhistory function lists the contents of the measurement set
history table. The history table contains a record of changes
made to the measurement set by flagger, calibrater, imager and
\medskip\noindent\textbf{Selecting data}
As described in the <link anchor="ms">ms module</link> documentation a
measurement set can contain data with a variety of different
shapes. Some of the functions in this tool require the data to
be in a fixed shape. Before you can use these functions you need
to select a subset of the data in the measurement set where all
the data has a fixed shape. There are two functions which can be
used to do this. These are the
<link anchor="ms:ms.selectinit.function">selectinit</link> and
<link anchor="ms:ms.command.function">command</link> functions.
The select function can be used to further refine which subset of
the data will be used by the data access functions. This function
allows you to select specific rows in a measurement set using a
The select function can only select whole rows in a measurement
set. To select specific channels within a row you use the