Source code for pipeline.hifa.cli.hifa_flagtargets

##################### generated by xml-casa (v2) from hifa_flagtargets.xml ##########
##################### b964ced56a19e9838ebc2f0fcb13b1d5 ##############################
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_hifa_flagtargets import hifa_flagtargets as _hifa_flagtargets_t
from casatasks.private.task_logging import start_log as _start_log
from casatasks.private.task_logging import end_log as _end_log

class _hifa_flagtargets:
    """
    hifa_flagtargets ---- Do science target flagging

    
    The hifa_flagtargets task performs basic flagging operations on a list of
    science target MeasurementSets.
    
    Output
    
    results -- If pipeline mode is 'getinputs' then None is returned. Otherwise
    the results object for the pipeline task is returned.
    
    
    Description
    
    The hifa_flagtargets task performs basic flagging operations on a list of
    measurements including:
    
    o applying a flagging template
    
    
    Issues

    --------- parameter descriptions ---------------------------------------------

    vis           The list of input MeasurementSets. Defaults to the list 
                  of MeasurementSets defined in the pipeline context.
                  (can be set only in 'interactive mode')
    template      Apply flagging templates.
                  (can be set in any pipeline mode)
    filetemplate  The name of a text file that contains the flagging 
                  template for issues with the science target data etc. 
                  If the template flags files is undefined a name of the 
                  form 'msname_flagtargetstemplate.txt' is assumed.
                  (can be set in any pipeline mode)
    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    Back up any pre-existing flags.
                  (can be set only in 'interactive mode')
    dryrun        Run the commands (False) or generate the commands to be 
                  run but do not execute (True).
    acceptresults Add the results of the task to the pipeline context (True)
                  or reject them (False).

    --------- examples -----------------------------------------------------------

    
    1. Do basic flagging on a science target MeasurementSet:
    
    hifa_flagtargets()


    """

    _info_group_ = """pipeline"""
    _info_desc_ = """Do science target flagging"""

    def __call__( self, vis=[  ], template=True, filetemplate=[  ], pipelinemode='automatic', flagbackup=False, dryrun=False, acceptresults=True ):
        schema = {'vis': {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}, 'template': {'type': 'cBool'}, 'filetemplate': {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}, 'pipelinemode': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'automatic', 'interactive', 'getinputs' ]}, 'flagbackup': {'type': 'cBool'}, 'dryrun': {'type': 'cBool'}, 'acceptresults': {'type': 'cBool'}}
        doc = {'vis': vis, 'template': template, 'filetemplate': filetemplate, 'pipelinemode': pipelinemode, 'flagbackup': flagbackup, 'dryrun': dryrun, 'acceptresults': acceptresults}
        assert _pc.validate(doc,schema), str(_pc.errors)
        _logging_state_ = _start_log( 'hifa_flagtargets', [ 'vis=' + repr(_pc.document['vis']), 'template=' + repr(_pc.document['template']), 'filetemplate=' + repr(_pc.document['filetemplate']), '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_, 'hifa_flagtargets', _hifa_flagtargets_t( _pc.document['vis'], _pc.document['template'], _pc.document['filetemplate'], _pc.document['pipelinemode'], _pc.document['flagbackup'], _pc.document['dryrun'], _pc.document['acceptresults'] ) )

hifa_flagtargets = _hifa_flagtargets( )