##################### generated by xml-casa (v2) from hifv_flagdata.xml #############
##################### b7a521fa1a3c4ebc2f0c756f573c7446 ##############################
from __future__ import absolute_import
import numpy
from casatools.typecheck import CasaValidator as _val_ctor
_pc = _val_ctor( )
from casatools.coercetype import coerce as _coerce
from .private.task_hifv_flagdata import hifv_flagdata as _hifv_flagdata_t
from casatasks.private.task_logging import start_log as _start_log
from casatasks.private.task_logging import end_log as _end_log
class _hifv_flagdata:
"""
hifv_flagdata ---- Do basic deterministic flagging of a list of MeasurementSets
The hifv_flagdata task performs basic flagging operations on a list of
MeasurementSets.
The hifv_flagdata task performs basic flagging operations on a list of measurements including:
o autocorrelation data flagging
o shadowed antenna data flagging
o scan based flagging
o edge channel flagging
o baseband edge flagging
o applying online flags
o applying a flagging template
o quack, shadow, and basebands
o Antenna not-on-source (ANOS)
--------- parameter descriptions ---------------------------------------------
vis List of visibility data files. These may be ASDMs, tar files of ASDMs,
MSes, or tar files of MSes, If ASDM files are specified, they will be
converted to MS format.
example: vis=['X227.ms', 'asdms.tar.gz']
autocorr Flag autocorrelation data
shadow Flag shadowed antennas
scan Flag specified scans
scannumber A string containing a comma delimited list of scans to be flagged.
example: '3,5,6'
quack Quack scans
clip Clip mode
baseband Flag 20MHz of each edge of basebands
intents A string containing a comma delimited list of intents against
which the scans to be flagged are matched.
example: '*BANDPASS*'
edgespw Fraction of the baseline correlator TDM edge channels to be flagged.
fracspw Fraction of baseline correlator edge channels to be flagged
online Apply the online flags
fileonline File containing the online flags. These are computed by the
h_init or hif_importdata data tasks. If the online flags files
are undefined a name of the form 'msname.flagonline.txt' is assumed.
template Apply a flagging template
filetemplate The name of a text file that contains the flagging template
for RFI, birdies, telluric lines, etc. If the template flags files
is undefined a name of the form 'msname.flagtemplate.txt' is assumed.
hm_tbuff The time buffer computation heuristic
tbuff List of time buffers (sec) to pad timerange in flag commands
pipelinemode The pipeline operating mode. In 'automatic' mode the pipeline
determines the values of all context defined pipeline inputs automatically.
In interactive mode the user can set the pipeline context defined parameters
manually. In 'getinputs' mode the user can check the settings of all
pipeline parameters without running the task.
flagbackup Backup pre-existing flags before applying new ones. Only can be set in
pipelinemode='interactive'.
dryrun Run the commands (True) or generate the commands to be run but
do not execute (False). This is a pipeline task execution mode.
acceptresults Add the results of the task to the pipeline context (True) or
reject them (False). This is a pipeline task execution mode.
--------- examples -----------------------------------------------------------
Output:
results -- If pipeline mode is 'getinputs' then None is returned. Otherwise
the results object for the pipeline task is returned.
Examples
1. Do basic flagging on a MeasurementSet
hifv_flagdata()
2. Do basic flagging on a MeasurementSet as well as flag pointing and
atmosphere data
hifv_flagdata(scan=True intent='*BANDPASS*')
"""
_info_group_ = """pipeline"""
_info_desc_ = """Do basic deterministic flagging of a list of MeasurementSets"""
def __call__( self, vis=[ ], autocorr=True, shadow=True, scan=True, scannumber='', quack=True, clip=True, baseband=True, intents='*POINTING*,*FOCUS*,*ATMOSPHERE*,*SIDEBAND_RATIO*, *UNKNOWN*, *SYSTEM_CONFIGURATION*, *UNSPECIFIED#UNSPECIFIED*', edgespw=True, fracspw=float(0.05), online=True, fileonline='', template=True, filetemplate=[ ], hm_tbuff='1.5int', tbuff=float(0.0), pipelinemode='automatic', flagbackup=False, dryrun=False, acceptresults=True ):
schema = {'vis': {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}, 'autocorr': {'type': 'cBool'}, 'shadow': {'type': 'cBool'}, 'scan': {'type': 'cBool'}, 'scannumber': {'type': 'cStr', 'coerce': _coerce.to_str}, 'quack': {'type': 'cBool'}, 'clip': {'type': 'cBool'}, 'baseband': {'type': 'cBool'}, 'intents': {'type': 'cStr', 'coerce': _coerce.to_str}, 'edgespw': {'type': 'cBool'}, 'fracspw': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'online': {'type': 'cBool'}, 'fileonline': {'type': 'cStr', 'coerce': _coerce.to_str}, 'template': {'type': 'cBool'}, 'filetemplate': {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}, 'hm_tbuff': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ '1.5int', 'halfint', 'manual' ]}, 'tbuff': {'anyof': [{'type': 'cFloat', 'coerce': _coerce.to_float}, {'type': 'cFloatVec', 'coerce': [_coerce.to_list,_coerce.to_floatvec]}]}, 'pipelinemode': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'automatic', 'interactive', 'getinputs' ]}, 'flagbackup': {'type': 'cBool'}, 'dryrun': {'type': 'cBool'}, 'acceptresults': {'type': 'cBool'}}
doc = {'vis': vis, 'autocorr': autocorr, 'shadow': shadow, 'scan': scan, 'scannumber': scannumber, 'quack': quack, 'clip': clip, 'baseband': baseband, 'intents': intents, 'edgespw': edgespw, 'fracspw': fracspw, 'online': online, 'fileonline': fileonline, 'template': template, 'filetemplate': filetemplate, 'hm_tbuff': hm_tbuff, 'tbuff': tbuff, 'pipelinemode': pipelinemode, 'flagbackup': flagbackup, 'dryrun': dryrun, 'acceptresults': acceptresults}
assert _pc.validate(doc,schema), str(_pc.errors)
_logging_state_ = _start_log( 'hifv_flagdata', [ 'vis=' + repr(_pc.document['vis']), 'autocorr=' + repr(_pc.document['autocorr']), 'shadow=' + repr(_pc.document['shadow']), 'scan=' + repr(_pc.document['scan']), 'scannumber=' + repr(_pc.document['scannumber']), 'quack=' + repr(_pc.document['quack']), 'clip=' + repr(_pc.document['clip']), 'baseband=' + repr(_pc.document['baseband']), 'intents=' + repr(_pc.document['intents']), 'edgespw=' + repr(_pc.document['edgespw']), 'fracspw=' + repr(_pc.document['fracspw']), 'online=' + repr(_pc.document['online']), 'fileonline=' + repr(_pc.document['fileonline']), 'template=' + repr(_pc.document['template']), 'filetemplate=' + repr(_pc.document['filetemplate']), 'hm_tbuff=' + repr(_pc.document['hm_tbuff']), 'tbuff=' + repr(_pc.document['tbuff']), 'pipelinemode=' + repr(_pc.document['pipelinemode']), 'flagbackup=' + repr(_pc.document['flagbackup']), 'dryrun=' + repr(_pc.document['dryrun']), 'acceptresults=' + repr(_pc.document['acceptresults']) ] )
return _end_log( _logging_state_, 'hifv_flagdata', _hifv_flagdata_t( _pc.document['vis'], _pc.document['autocorr'], _pc.document['shadow'], _pc.document['scan'], _pc.document['scannumber'], _pc.document['quack'], _pc.document['clip'], _pc.document['baseband'], _pc.document['intents'], _pc.document['edgespw'], _pc.document['fracspw'], _pc.document['online'], _pc.document['fileonline'], _pc.document['template'], _pc.document['filetemplate'], _pc.document['hm_tbuff'], _pc.document['tbuff'], _pc.document['pipelinemode'], _pc.document['flagbackup'], _pc.document['dryrun'], _pc.document['acceptresults'] ) )
hifv_flagdata = _hifv_flagdata( )