Source code for pipeline.h.cli.h_init

##################### generated by xml-casa (v2) from h_init.xml ####################
##################### ae6e964178930a754f57da90b5711411 ##############################
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_h_init import h_init as _h_init_t
from casatasks.private.task_logging import start_log as _start_log
from casatasks.private.task_logging import end_log as _end_log

class _h_init:
    """
    h_init ---- Initialize the interferometry pipeline

    
    The h_init task initializes the interferometry pipeline and optionally
    imports data.
    
    h_init  must be called before any other interferometry pipeline task. The
    pipeline can be initialized in one of two ways: by creating a new pipeline
    state (h_init) or be loading a saved pipeline state (h_resume).
    
    h_init creates an empty pipeline context but does not load visibility data
    into the context. hif_importdata or hsd_importdata can be used to load data.
    
    If pipeline mode is 'getinputs' then None is returned. Otherwise
    the results object for the pipeline task is returned.

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

    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.
    loglevel      Log level for pipeline messages. Log messages below this threshold will not be displayed.
    plotlevel     Toggle generation of detail plots in the web log. A level of 'all' generates 
                  					 all plots; 'summary' omits detail plots; 'default' generates all plots 
                  					 apart from for the hif_applycal task.
    output_dir    Working directory for pipeline processing. Some pipeline
                  		processing products such as HTML logs and images will be directed to
                  		subdirectories of this path.
    weblog        Generate the web log
    overwrite     Overwrite existing files on import
    dryrun        Run the task (False) or display the task command (True)
    acceptresults Add the results into the pipeline context

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

    
    Examples
    
    1. Create the pipeline context
    
    h_init()


    """

    _info_group_ = """pipeline"""
    _info_desc_ = """Initialize the interferometry pipeline"""

    def __call__( self, pipelinemode='automatic', loglevel='info', plotlevel='default', output_dir='./', weblog=True, overwrite=True, dryrun=False, acceptresults=True ):
        schema = {'pipelinemode': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'automatic', 'interactive', 'getinputs' ]}, 'loglevel': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'error', 'info', 'critical', 'debug', 'trace', 'warning' ]}, 'plotlevel': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'all', 'default', 'summary' ]}, 'output_dir': {'type': 'cStr', 'coerce': _coerce.to_str}, 'weblog': {'type': 'cBool'}, 'overwrite': {'type': 'cBool'}, 'dryrun': {'type': 'cBool'}, 'acceptresults': {'type': 'cBool'}}
        doc = {'pipelinemode': pipelinemode, 'loglevel': loglevel, 'plotlevel': plotlevel, 'output_dir': output_dir, 'weblog': weblog, 'overwrite': overwrite, 'dryrun': dryrun, 'acceptresults': acceptresults}
        assert _pc.validate(doc,schema), str(_pc.errors)
        _logging_state_ = _start_log( 'h_init', [ 'pipelinemode=' + repr(_pc.document['pipelinemode']), 'loglevel=' + repr(_pc.document['loglevel']), 'plotlevel=' + repr(_pc.document['plotlevel']), 'output_dir=' + repr(_pc.document['output_dir']), 'weblog=' + repr(_pc.document['weblog']), 'overwrite=' + repr(_pc.document['overwrite']), 'dryrun=' + repr(_pc.document['dryrun']), 'acceptresults=' + repr(_pc.document['acceptresults']) ] )
        return _end_log( _logging_state_, 'h_init', _h_init_t( _pc.document['pipelinemode'], _pc.document['loglevel'], _pc.document['plotlevel'], _pc.document['output_dir'], _pc.document['weblog'], _pc.document['overwrite'], _pc.document['dryrun'], _pc.document['acceptresults'] ) )

h_init = _h_init( )