2.1 autoflag - Module autoflag
Module for automatic flagging of synthesis data
include autoflag.g
Description
The autoflag module provides automatic synthesis flagging capabilities within
CASA. The primary purpose of this module is to flag data inside a MeasurementSet
using a number of different algorithms and heuristics.
The facilities of the autoflag module are made available in Glish by including
the following script:
- include ’autoflag.g’
T
where a hyphen precedes user input. The Glish response is indicated without the
prompt.
An autoflag tool is created and attached to a specified measurement set as
indicated in the following example:
- af:=autoflag(’3C273XC1.MS’)
A variety of algorithms (called methods in this context) can be applied for any
given autoflag tool. A setdata method allows a user to apply setmethods to the
whole measurement set with default parameters or to a subset of the
measurement set by specifying parameters. Individual methods are
set up in advance by calling Glish functions of the tool, i.e.:
af.setmethod(parameters). Afterwards, a call to af.run(options)
actually applies all the specified methods simultaneously. Here is an
example:
- af:=autoflag(’3C273XC1.MS’)
- af.setdata()
- af.settimemed(thr=6,hw=5)
Added method 1: timemed (TimeMedian)
*thr = 6
*hw = 5
rowthr = 10
rowhw = 6
column = DATA
expr = ABS I
debug = F
fignore = F
T
- af.setuvbin(nbins=100,thr=.01)
Added method 2: uvbin (UVBinner)
*thr = 0.01
*nbins = 100
plotchan = F
econoplot = T
column = DATA
expr = ABS I
fignore = F
T
- af.settimemed(thr=5,hw=5,expr="- ABS XX YY")
Added method 3: timemed (TimeMedian)
thr = 5
*hw = 5
rowthr = 10
rowhw = 6
column = DATA
*expr = - ABS XX YY
debug = F
fignore = F
T
- af.run(trial=T)
lots of interesting messages
-
Here, three methods -- a UV binner and two time-median filters --
are set up and executed. Note the following crucial points:
- The setmethod() functions respond with a summary of the
parameters with which the method will be run. All parameter
have reasonable defaults. Parameters for which you have
specified an explicit non-default value are marked with an
‘‘*’’ symbol.
- You may set up multiple instances of a method, using
different parameters for each instance. In the above
example, two timemed methods are set up. The first one is
applied to |I| , the second one -- to |XX|-|Y Y |.
- Most methods perform flagging based on some real value
derived from a set of complex correlations, e.g.
|I|, or |XX| - |Y Y |. You can specify how the value is derived
by using the expr parameter. This parameter is either a
string or an array of strings. A single string will be
automatically split at whitespace, so "ABS XX" and ’ABS XX’
are fully equivalent. Currently, the following types of
expressions are recognized:
-
func CC
- --- real function of a complex correlation. E.g.
"ABS XX" for |XX|.
-
+/- func C1 C2
- --- sum/difference of functions of two
correlations. E.g. "- ABS RR LL" for |RR|-|LL|.
-
func +/- C1 C2
- --- function of a sum/difference of two
correlations. E.g. "ARG - XX YY" for arg(XX - Y Y ).
-
func I
- --- I is used to specify Stokes I. Depending on
polarization frame, it is equivalent to
either XX + Y Y or RR + LL. |I| ("ABS I") is in fact the
default expression for all methods.
The following functions are currently recognized: ABS, ARG, RE,
IM, NORM. Any correlations present in the measurement set are
recognized.
- The column parameter specifies which measurement set column to
use. Possible values are DATA, MODEL or CORR for corrected
data.
- All methods by default honor pre-existing flags (as determined by
the FLAG and FLAGROW columns), in the sense that flagged values
are omitted from all calculations. Methods may be asked to ignore
existing flags via the fignore parameter. The reset option to
autoflag.run clears all pre-existing flags prior to a flagging
run.
- For each flagging run, autoflag will automatically produce
a graphical flagging report, consisting of a summary and
several plots showing the distribution of flags by baseline,
antenna, frequency, time, etc. By default, this report is
written in PostScript format to a file named flagreport.ps.
However, the devfile parameter of autoflag.run() can be used to
redirect this output to a different file or a different PGPlot
device.
- If your measurement set contains different fields and/or spectral
windows (or, more generally, different data description IDs),
autoflag will automatically treat it as a set of disjoint chunks.
Flagging is performed independently within each chunk (i.e.
independently for each spectral window, field, etc.)
- autoflag will attempt to manage its memory consumption to stay
roughly within the meximum physical memory specified in your
.aipsrc file. If you find your system swapping to disk when
running autoflag, you can improve performance by using a reduced
memory setting. Conversely, if a lot of memory remains free during
an autoflag run, performance may be improced by increasing the
setting.
Please send any comments or questions about CASA or AIPS++
to aips2-requests@nrao.edu
Copyright © 2008 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.