Source code for pipeline.hif.cli.hif_correctedampflag

##################### generated by xml-casa (v2) from hif_correctedampflag.xml ######
##################### 4bc94ea03b87498cd3276cd7b371f867 ##############################
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_hif_correctedampflag import hif_correctedampflag as _hif_correctedampflag_t
from casatasks.private.task_logging import start_log as _start_log
from casatasks.private.task_logging import end_log as _end_log

class _hif_correctedampflag:
    """
    hif_correctedampflag ---- Flag corrected - model amplitudes based on calibrators.

    
    Flag corrected - model amplitudes based on calibrators.
    
    Output
    
    results -- If pipeline mode is 'getinputs' then None is returned. Otherwise
    the results object for the pipeline task is returned.

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

    vis            The list of input MeasurementSets. Defaults to the list of
                   MeasurementSets specified in the h_init or hif_importdata task.
                   '': use all MeasurementSets in the context
                   
                   Examples: 'ngc5921.ms', ['ngc5921a.ms', ngc5921b.ms', 'ngc5921c.ms']
    intent         A string containing a comma delimited list of intents against
                   which the selected fields are matched. If undefined (default),
                   it will select all data with the BANDPASS intent.
                   
                   Example: intent='*PHASE*'
    field          The list of field names or field ids for which bandpasses are
                   computed. If undefined (default), it will select all fields.
                   
                   Examples: field='3C279', '3C279, M82'
    spw            The list of spectral windows and channels for which bandpasses
                   are computed. If undefined (default), it will select all
                   science spectral windows.
                   
                   Example: spw='11,13,15,17'
    antnegsig      Lower sigma threshold for identifying outliers as a result of bad antennas within individual timestamps
    antpossig      Upper sigma threshold for identifying outliers as a result of bad antennas within individual timestamps
    tmantint       Threshold for maximum fraction of timestamps that are allowed to contain outliers
    tmint          Initial threshold for maximum fraction of "outlier timestamps" over "total timestamps" that a baseline may be a part of
    tmbl           Initial threshold for maximum fraction of "bad baselines" over "all timestamps" that an antenna may be a part of
    antblnegsig    Lower sigma threshold for identifying outliers as a result of "bad baselines" and/or "bad antennas" within baselines (across all timestamps)
    antblpossig    Upper sigma threshold for identifying outliers as a result of "bad baselines" and/or "bad antennas" within baselines (across all timestamps)
    relaxed_factor Relaxed value to set the threshold scaling factor to under certain conditions (see task description)
    niter          Maximum number of times to iterate on evaluation of flagging
                   heuristics. If an iteration results in no new flags, then
                   subsequent iterations are skipped.
    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.
    dryrun         Run the task (False) or just display the command (True)
    acceptresults  Add the results of the task to the pipeline context (True) or
                   reject them (False).

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

    
    Run default flagging on bandpass calibrator with recommended settings:
    
    hif_correctedampflag()


    """

    _info_group_ = """pipeline"""
    _info_desc_ = """Flag corrected - model amplitudes based on calibrators."""

    def __call__( self, vis=[  ], intent='', field='', spw='', antnegsig=float(4.0), antpossig=float(4.6), tmantint=float(0.063), tmint=float(0.085), tmbl=float(0.175), antblnegsig=float(3.4), antblpossig=float(3.2), relaxed_factor=float(2.0), niter=int(2), pipelinemode='automatic', dryrun=False, acceptresults=True ):
        schema = {'vis': {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}, 'intent': {'type': 'cStr', 'coerce': _coerce.to_str}, 'field': {'type': 'cStr', 'coerce': _coerce.to_str}, 'spw': {'type': 'cStr', 'coerce': _coerce.to_str}, 'antnegsig': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'antpossig': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'tmantint': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'tmint': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'tmbl': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'antblnegsig': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'antblpossig': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'relaxed_factor': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'niter': {'type': 'cInt'}, 'pipelinemode': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'automatic', 'interactive', 'getinputs' ]}, 'dryrun': {'type': 'cBool'}, 'acceptresults': {'type': 'cBool'}}
        doc = {'vis': vis, 'intent': intent, 'field': field, 'spw': spw, 'antnegsig': antnegsig, 'antpossig': antpossig, 'tmantint': tmantint, 'tmint': tmint, 'tmbl': tmbl, 'antblnegsig': antblnegsig, 'antblpossig': antblpossig, 'relaxed_factor': relaxed_factor, 'niter': niter, 'pipelinemode': pipelinemode, 'dryrun': dryrun, 'acceptresults': acceptresults}
        assert _pc.validate(doc,schema), str(_pc.errors)
        _logging_state_ = _start_log( 'hif_correctedampflag', [ 'vis=' + repr(_pc.document['vis']), 'intent=' + repr(_pc.document['intent']), 'field=' + repr(_pc.document['field']), 'spw=' + repr(_pc.document['spw']), 'antnegsig=' + repr(_pc.document['antnegsig']), 'antpossig=' + repr(_pc.document['antpossig']), 'tmantint=' + repr(_pc.document['tmantint']), 'tmint=' + repr(_pc.document['tmint']), 'tmbl=' + repr(_pc.document['tmbl']), 'antblnegsig=' + repr(_pc.document['antblnegsig']), 'antblpossig=' + repr(_pc.document['antblpossig']), 'relaxed_factor=' + repr(_pc.document['relaxed_factor']), 'niter=' + repr(_pc.document['niter']), 'pipelinemode=' + repr(_pc.document['pipelinemode']), 'dryrun=' + repr(_pc.document['dryrun']), 'acceptresults=' + repr(_pc.document['acceptresults']) ] )
        return _end_log( _logging_state_, 'hif_correctedampflag', _hif_correctedampflag_t( _pc.document['vis'], _pc.document['intent'], _pc.document['field'], _pc.document['spw'], _pc.document['antnegsig'], _pc.document['antpossig'], _pc.document['tmantint'], _pc.document['tmint'], _pc.document['tmbl'], _pc.document['antblnegsig'], _pc.document['antblpossig'], _pc.document['relaxed_factor'], _pc.document['niter'], _pc.document['pipelinemode'], _pc.document['dryrun'], _pc.document['acceptresults'] ) )

hif_correctedampflag = _hif_correctedampflag( )