Source code for pipeline.hif.cli.hif_lowgainflag

##################### generated by xml-casa (v2) from hif_lowgainflag.xml ###########
##################### 1250a2cca5c90bb575947d5a79626b17 ##############################
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_lowgainflag import hif_lowgainflag as _hif_lowgainflag_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_lowgainflag:
    """
    hif_lowgainflag ---- Flag antennas with low or high gain

    
    Flag antennas with unusually low or high gain.
    
    Deviant antennas are detected by analysis of a view showing their calibration
    gains. This view is a list of 2D images with axes 'Time' and 'Antenna'; there
    is one image for each spectral window and intent. A flagcmd to flag all data
    for an antenna will be generated by any gain that is outside the range
    [fnm_lo_limit * median, fnm_hi_limit * median].
    
    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 the list of intents to be checked for
                  antennas with deviant gains. The default is blank, which
                  causes the task to select the 'BANDPASS' intent.
    spw           The list of spectral windows and channels to which the
                  calibration will be applied. Defaults to all science windows
                  in the pipeline context.
                  
                  Examples: spw='17', spw='11, 15'
    refant        A string containing a prioritized list of reference antenna
                  name(s) to be used to produce the gain table. Defaults to the
                  value(s) stored in the pipeline context. If undefined in the
                  pipeline context defaults to the CASA reference antenna naming
                  scheme.
                  
                  Examples: refant='DV01', refant='DV06,DV07'
    flag_nmedian  True to flag figures of merit greater than
                  fnm_hi_limit * median or lower than fnm_lo_limit * median.
    fnm_lo_limit  Flag values lower than fnm_lo_limit * median
    fnm_hi_limit  Flag values higher than fnm_hi_limit * median
    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 -----------------------------------------------------------

    


    """

    _info_group_ = """pipeline"""
    _info_desc_ = """Flag antennas with low or high gain"""

    def __call__( self, vis=[  ], intent='', spw='', refant='', flag_nmedian=True, fnm_lo_limit=float(0.5), fnm_hi_limit=float(1.5), pipelinemode='automatic', dryrun=False, acceptresults=True ):
        schema = {'vis': {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}, 'intent': {'type': 'cStr', 'coerce': _coerce.to_str}, 'spw': {'type': 'cStr', 'coerce': _coerce.to_str}, 'refant': {'type': 'cStr', 'coerce': _coerce.to_str}, 'flag_nmedian': {'type': 'cBool'}, 'fnm_lo_limit': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'fnm_hi_limit': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'pipelinemode': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'automatic', 'interactive', 'getinputs' ]}, 'dryrun': {'type': 'cBool'}, 'acceptresults': {'type': 'cBool'}}
        doc = {'vis': vis, 'intent': intent, 'spw': spw, 'refant': refant, 'flag_nmedian': flag_nmedian, 'fnm_lo_limit': fnm_lo_limit, 'fnm_hi_limit': fnm_hi_limit, 'pipelinemode': pipelinemode, 'dryrun': dryrun, 'acceptresults': acceptresults}
        assert _pc.validate(doc,schema), str(_pc.errors)
        _logging_state_ = _start_log( 'hif_lowgainflag', [ 'vis=' + repr(_pc.document['vis']), 'intent=' + repr(_pc.document['intent']), 'spw=' + repr(_pc.document['spw']), 'refant=' + repr(_pc.document['refant']), 'flag_nmedian=' + repr(_pc.document['flag_nmedian']), 'fnm_lo_limit=' + repr(_pc.document['fnm_lo_limit']), 'fnm_hi_limit=' + repr(_pc.document['fnm_hi_limit']), 'pipelinemode=' + repr(_pc.document['pipelinemode']), 'dryrun=' + repr(_pc.document['dryrun']), 'acceptresults=' + repr(_pc.document['acceptresults']) ] )
        return _end_log( _logging_state_, 'hif_lowgainflag', _hif_lowgainflag_t( _pc.document['vis'], _pc.document['intent'], _pc.document['spw'], _pc.document['refant'], _pc.document['flag_nmedian'], _pc.document['fnm_lo_limit'], _pc.document['fnm_hi_limit'], _pc.document['pipelinemode'], _pc.document['dryrun'], _pc.document['acceptresults'] ) )

hif_lowgainflag = _hif_lowgainflag( )