|
|||
NRAO Home > CASA > CASA Cookbook and User Reference Manual |
|
3.6 Non-Interactive Flagging using flagdata2
Alert: flagadata and flagdata2 are still available in CASA 3.4. But tflagdata (§ 3.4) will be our new flagging task (renaming it it flagdata in CASA 3.5). We strongly recommend to use tflagdata as it is faster and the syntax will be supported in the future.
Task flagdata2 will flag the visibility data set based on the specified data selections, most of the information coming from a run of the listobs task (with/without verbose=True). Currently you can select based on any combination of:
- antennas (antenna)
- baselines (antenna)
- spectral windows and channels (spw)
- correlation types (correlation)
- field ids or names (field)
- uv-ranges (uvrange)
- times (timerange) or scan numbers (scan)
- antenna arrays (array)
- scan intents (intent)
- observation id (observation)
and choose to flag, unflag, clip, and remove the first part of each scan and/or the autocorrelations.
The inputs to flagdata2 are:
vis = ’’ # Name of file to flag
flagbackup = True # Automatically back up the state of flags before the
# run?
selectdata = False # Data selection parameters, which will affect all modes
# (antenna, timerange etc)
manualflag = False # Flag by antenna, time, field, etc.
clip = False # Clip data according to value
shadow = False # Flag shadowed antennas
elevation = False # Flag data from antennas below and above the given
# elevation range
quack = False # Clip beginning or ending of scans
unflag = False # Unflag the data specified
summary = False # List rows and data points flagged
async = False # If true the taskname must be started using
# flagdata2(...)
There is no default flagging mode in flagdata2. The desired mode needs to be set to True to be used. A set of sub-parameters will become visible and can be set as desired.
The mode summary=True will print out a summary of the current state of flagging into the logger.
By setting quack=True it will allow dropping of integrations from the beginning or ending of scans. See § 3.6.1.2 for details.
By setting shadow=True it will allow shadowed data to be flagged, e.g. if it has not already during filling (§ 3.6.1.3).
Note that with ’flagdata2’, it is possible to run multiple modes in one single call to the task. When ’selectdata=True’, the selection will apply to all modes that are set to True. ’manualflag’ contains a set of sub-parameters for further selection.
flagdata2(vis=’my.ms’, manualflag=True, mf_field=’3’, mf_timerange = ’6:0:0~6:23:00’, shadow=True)
Note that often you want to apply many different flagging operations in a single pass through the data. For this, we have implemented a “list” mode for the ’manualflag’ selections where several flagdata2 task invocations can be combined into a single flagdata2 run by giving lists of parameters. This is possible for the ’manualflag’ mode, only.
For example, the following three flagdata2 runs:
flagdata2(vis=’my.ms’, manualflag=True, mf_field=’3’, mf_timerange = ’6:0:0~6:23:00’)
flagdata2(vis=’my.ms’, manualflag=True, mf_field=’3’, mf_scan=’0’, mf_spw=’0:60;62;64’)
can be combined into a single run by:
mode = ’manualflag’
selectdata = True
mf_field = ’3’
mf_spw = [ ’’ , ’’ , ’0:60;62:64’ ]
mf_timerange = [ ’’ , ’6:0:0~6:23:0’, ’’ ]
mf_scan = [ ’’ , ’’ , ’0’ ]
flagdata2()
Note that mf_field=’3’ is equivalent to mf_field=[’3’,’3’,’3’].
————————-
3.6.1.1 Manual flagging and clipping in flagdata
3.6.1.2 Flagging the beginning of scans
3.6.1.3 Flagging shadowed data with mode ’shadow’
3.6.1.4 Autoflagging.
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