Source code for pipeline.hifv.cli.hifv_checkflag

##################### generated by xml-casa (v2) from hifv_checkflag.xml ############
##################### bbcf54ac46530b0ba17bb4f5309fe076 ##############################
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_checkflag import hifv_checkflag as _hifv_checkflag_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_checkflag:
    """
    hifv_checkflag ---- Run flagdata in rflag mode

    --------- 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']
    checkflagmode      -- blank string default use of rflag on bandpass and delay calibrators
                       -- use string 'semi' after hifv_semiFinalBPdcals() for executing rflag on calibrators
                       -- use string 'bpd', for the bandpass and delay calibrators:
                            execute rflag on all calibrated cross-hand corrected data;
                            extend flags to all correlations
                            execute rflag on all calibrated parallel-hand residual data;
                            extend flags to all correlations
                            execute tfcrop on all calibrated cross-hand corrected data,
                              per visibility; extend flags to all correlations
                            execute tfcrop on all calibrated parallel-hand corrected data,
                              per visibility; extend flags to all correlations
                       -- use string 'allcals', for all the other calibrators, with delays and BPcal applied:
                             similar procedure as 'bpd' mode, but uses corrected data throughout
                       -- use string 'target', for the target data:
                             similar procedure as 'allcals' mode, but with a higher SNR cutoff
                             for rflag to avoid flagging data due to source structure, and
                             with an additional series of tfcrop executions to make up for
                             the higher SNR cutoff in rflag
                       -- VLASS specific modes include 'bpd-vlass', 'allcals-vlass', and 'target-vlass'
                             which calculate thresholds to use per spw/field/scan (action='calculate', then,
                             per baseband/field/scan, replace all spw thresholds above the median with the median,
                             before re-running rflag with the new thresholds.  This has the effect of
                             lowering the thresholds for spws with RFI to be closer to the RFI-free
                             thresholds, and catches more of the RFI.
                       -- Mode 'vlass-imaging' is similar to 'target-vlass', except that it executes on the split off target
                             data, intent='*TARGET', datacolumn='data' and uses a timedevscale of 4.0.
    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.
    overwrite_modelcol Always write the model column, even if it already exists
    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. Run RFLAG with associated heuristics in the VLA CASA pipeline.
    
    hifv_checkflag()


    """

    _info_group_ = """pipeline"""
    _info_desc_ = """Run flagdata in rflag mode"""

    def __call__( self, vis=[  ], checkflagmode='', pipelinemode='automatic', overwrite_modelcol=False, dryrun=False, acceptresults=True ):
        schema = {'vis': {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}, 'checkflagmode': {'type': 'cStr', 'coerce': _coerce.to_str}, 'pipelinemode': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'automatic', 'interactive', 'getinputs' ]}, 'overwrite_modelcol': {'type': 'cBool'}, 'dryrun': {'type': 'cBool'}, 'acceptresults': {'type': 'cBool'}}
        doc = {'vis': vis, 'checkflagmode': checkflagmode, 'pipelinemode': pipelinemode, 'overwrite_modelcol': overwrite_modelcol, 'dryrun': dryrun, 'acceptresults': acceptresults}
        assert _pc.validate(doc,schema), str(_pc.errors)
        _logging_state_ = _start_log( 'hifv_checkflag', [ 'vis=' + repr(_pc.document['vis']), 'checkflagmode=' + repr(_pc.document['checkflagmode']), 'pipelinemode=' + repr(_pc.document['pipelinemode']), 'overwrite_modelcol=' + repr(_pc.document['overwrite_modelcol']), 'dryrun=' + repr(_pc.document['dryrun']), 'acceptresults=' + repr(_pc.document['acceptresults']) ] )
        return _end_log( _logging_state_, 'hifv_checkflag', _hifv_checkflag_t( _pc.document['vis'], _pc.document['checkflagmode'], _pc.document['pipelinemode'], _pc.document['overwrite_modelcol'], _pc.document['dryrun'], _pc.document['acceptresults'] ) )

hifv_checkflag = _hifv_checkflag( )