Source code for pipeline.hifa.cli.hifa_fluxcalflag

##################### generated by xml-casa (v2) from hifa_fluxcalflag.xml ##########
##################### 0af5015fb8328d45526a4452410b6766 ##############################
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_fluxcalflag import hifa_fluxcalflag as _hifa_fluxcalflag_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_fluxcalflag:
    """
    hifa_fluxcalflag ---- Locate and flag line regions in solar system flux calibrators

    
    Search the built-in solar system flux calibrator line catalog for overlaps with
    the science spectral windows. Generate a list of line overlap regions and
    flagging commands.
    
    
    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 defined in the pipeline context.
    field         The list of field names or field ids for which the models are
                  to be set. Defaults to all fields with intent 'AMPLITUDE'.
                  
                  example: field='3C279', field='3C279, M82'
    intent        A string containing a comma delimited list of intents against
                  which the selected fields are matched. Defaults to all data
                  with amplitude intent.
                  
                  example: intent='AMPLITUDE'
    spw           spectral windows and channels for which bandpasses are
                  computed. Defaults to all science spectral windows.
                  
                  example: spw='11,13,15,17'
    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.
    threshold     tion of an spw occupied by line regions is greater
                  then threshold flag the entire spectral window.
    appendlines   Append user defined line regions to the line dictionary.
    linesfile     
    applyflags    
    dryrun        Run the commands (True) or generate the commands to be run but
                  do not execute (False).
    acceptresults Add the results of the task to the pipeline context (True) or
                  reject them (False).

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

    
    1. Locate known lines in any solar system object flux calibrators:
    
    hifa_fluxcalflag()


    """

    _info_group_ = """pipeline"""
    _info_desc_ = """Locate and flag line regions in solar system flux calibrators"""

    def __call__( self, vis=[  ], field='', intent='', spw='', pipelinemode='automatic', threshold=float(0.75), appendlines=False, linesfile='', applyflags=True, dryrun=False, acceptresults=True ):
        schema = {'vis': {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}, 'field': {'type': 'cStr', 'coerce': _coerce.to_str}, 'intent': {'type': 'cStr', 'coerce': _coerce.to_str}, 'spw': {'type': 'cStr', 'coerce': _coerce.to_str}, 'pipelinemode': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'automatic', 'interactive', 'getinputs' ]}, 'threshold': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'appendlines': {'type': 'cBool'}, 'linesfile': {'type': 'cStr', 'coerce': _coerce.to_str}, 'applyflags': {'type': 'cBool'}, 'dryrun': {'type': 'cBool'}, 'acceptresults': {'type': 'cBool'}}
        doc = {'vis': vis, 'field': field, 'intent': intent, 'spw': spw, 'pipelinemode': pipelinemode, 'threshold': threshold, 'appendlines': appendlines, 'linesfile': linesfile, 'applyflags': applyflags, 'dryrun': dryrun, 'acceptresults': acceptresults}
        assert _pc.validate(doc,schema), str(_pc.errors)
        _logging_state_ = _start_log( 'hifa_fluxcalflag', [ 'vis=' + repr(_pc.document['vis']), 'field=' + repr(_pc.document['field']), 'intent=' + repr(_pc.document['intent']), 'spw=' + repr(_pc.document['spw']), 'pipelinemode=' + repr(_pc.document['pipelinemode']), 'threshold=' + repr(_pc.document['threshold']), 'appendlines=' + repr(_pc.document['appendlines']), 'linesfile=' + repr(_pc.document['linesfile']), 'applyflags=' + repr(_pc.document['applyflags']), 'dryrun=' + repr(_pc.document['dryrun']), 'acceptresults=' + repr(_pc.document['acceptresults']) ] )
        return _end_log( _logging_state_, 'hifa_fluxcalflag', _hifa_fluxcalflag_t( _pc.document['vis'], _pc.document['field'], _pc.document['intent'], _pc.document['spw'], _pc.document['pipelinemode'], _pc.document['threshold'], _pc.document['appendlines'], _pc.document['linesfile'], _pc.document['applyflags'], _pc.document['dryrun'], _pc.document['acceptresults'] ) )

hifa_fluxcalflag = _hifa_fluxcalflag( )