<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="agentflagger" name="agentflagger">
<include>agentflagger_forward.h</include>
<include>agentflagger_private.h</include>
<shortdescription>Tool for manual and automated flagging</shortdescription>
The *agentflagger* tool performs manual as well as automatic synthesis
flagging operations within casapy. The *agentflagger* tool can operate on
one measurement set at a time.
**Open the Measurement Set or Calibration Table and Attach it to the Tool**
The first thing to do is to open the MS or calibration table and attach it to the agentflagger tool.
Use the af.open method, which requires the MS name and optionally the time interval,
over which to buffer data before running the algorithm. The time interval is set by
default to 0.0, which means a 'scan' length. The 'ntime' parameter is important for
the modes tfcrop, rflag and extend.
``af.open('uid_X002.ms')``
Once the MS is open, the next step is to select the data. This step will use the MS
selection tool to select the portion of the MS given by the parameters. There are two ways
1) Create a Python dictionary which internally will be transformed into a record containing the selection parameters::
Select a portion of the MS using a dictionary.
2) Parse the parameter names directly to the function::
af.selectdata(scan='1~3', spw='0:1~10')
**Parse the Parameters for the Flagging Mode(s)**
Each flagging mode is called an agent. The available agents are: manual, clip, quack,
shadow, elevation, tfcrop, rflag, extend, unflag and summary. Each one of these agents
may or may not take configuration parameters and data selection parameters. Once the desired
flagging modes are chosen, it is time to give the configuration parameters to the tool. Ommited
parameters will take default values as defined in each agent. There are
two ways of parsing the agent's parameters.
1) Using the general method af.parseagentparameters()::
Construct a dictionary with the parameters for each agent. Each agent's
parameters should go to a different 'key' of the dictionary. Example: