Source code for pipeline.h.cli.h_mssplit

##################### generated by xml-casa (v2) from h_mssplit.xml #################
##################### 85e97172c9730801a139785d30619fd5 ##############################
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_mssplit import h_mssplit as _h_mssplit_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_mssplit:
    """
    h_mssplit ---- Select data from calibrated MS(s) to form new MS(s) for imaging

    Select data from calibrated MS(s) to form new MS(s) for imaging
    
    Create new MeasurementSets for imaging from the corrected column of the input
    MeasurementSet. By default all science target data is copied to the new MS. The new
    MeasurementSet is not re-indexed to the selected data in the new MS will have the
    same source, field, and spw names and ids as it does in the parent MS.
    
    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 to be transformed. Defaults to the
                  list of MeasurementSets specified in the pipeline import data task.
                  default '': Split all MeasurementSets in the context. 
                  Can only use with pipelinemode='interactive'
                  example: 'ngc5921.ms', ['ngc5921a.ms', ngc5921b.ms', 'ngc5921c.ms']
    outputvis     The list of output split MeasurementSets. The output list must
                  be the same length as the input list and the output names must be different
                  from the input names.
                  default '', The output name defaults to <msrootname>_split.ms
                  Can only use with pipelinemode='interactive'
                  example: 'ngc5921.ms', ['ngc5921a.ms', ngc5921b.ms', 'ngc5921c.ms']
    field         Set of data selection field names or ids, \'\' for all
    intent        Select intents to split
                  default: '', All data is selected.
                  Can only use with pipelinemode='interactive'
                  example: 'TARGET'
    spw           Select spectral windows to split.
                  Can only use with pipelinemode='interactive'
                  default: '', All spws are selected
                  example: '9', '9,13,15'
    datacolumn    Select spectral windows to split. The standard CASA options are supported.
                  Can only use with pipelinemode='interactive'
                  example: 'corrected', 'model'
    chanbin       The channel binning factor. 1 for no binning, otherwise 2, 4, 8, or 16.
                  Can only use with pipelinemode='interactive'
                  example: 2, 4
    timebin       The time binning factor. '0s' for no binning
                  Can only use with pipelinemode='interactive'
                  example: '10s' for 10 second binning
    replace       If a split was performed delete the parent MS and remove it from the context.
                  Can only use with pipelinemode='interactive'
    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 display the command(True)
    acceptresults Add the results to the pipeline context

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

    
    Examples
    
    1. Create a 4X channel smoothed output MS from the input MS
    
    h_mssplit(chanbin=4)


    """

    _info_group_ = """pipeline"""
    _info_desc_ = """Select data from calibrated MS(s) to form new MS(s) for imaging"""

    def __call__( self, vis=[  ], outputvis=[  ], field='', intent='', spw='', datacolumn='data', chanbin=int(1), timebin='0s', replace=True, pipelinemode='automatic', dryrun=False, acceptresults=True ):
        schema = {'vis': {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}, 'outputvis': {'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}, 'datacolumn': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'DATA', 'model', 'corrected', 'LAG_DATA', 'lag_data', 'FLOAT_DATA,DATA', 'FLOAT_DATA', 'CORRECTED', 'lag_data,data', 'float_data', 'float_data,data', 'DATA,MODEL,CORRECTED', 'ALL', 'MODEL', 'all', 'data,model,corrected', 'LAG_DATA,DATA', 'data' ]}, 'chanbin': {'type': 'cInt', 'allowed': [ 1, 2, 4, 8, 16 ]}, 'timebin': {'type': 'cStr', 'coerce': _coerce.to_str}, 'replace': {'type': 'cBool'}, 'pipelinemode': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'automatic', 'interactive', 'getinputs' ]}, 'dryrun': {'type': 'cBool'}, 'acceptresults': {'type': 'cBool'}}
        doc = {'vis': vis, 'outputvis': outputvis, 'field': field, 'intent': intent, 'spw': spw, 'datacolumn': datacolumn, 'chanbin': chanbin, 'timebin': timebin, 'replace': replace, 'pipelinemode': pipelinemode, 'dryrun': dryrun, 'acceptresults': acceptresults}
        assert _pc.validate(doc,schema), str(_pc.errors)
        _logging_state_ = _start_log( 'h_mssplit', [ 'vis=' + repr(_pc.document['vis']), 'outputvis=' + repr(_pc.document['outputvis']), 'field=' + repr(_pc.document['field']), 'intent=' + repr(_pc.document['intent']), 'spw=' + repr(_pc.document['spw']), 'datacolumn=' + repr(_pc.document['datacolumn']), 'chanbin=' + repr(_pc.document['chanbin']), 'timebin=' + repr(_pc.document['timebin']), 'replace=' + repr(_pc.document['replace']), 'pipelinemode=' + repr(_pc.document['pipelinemode']), 'dryrun=' + repr(_pc.document['dryrun']), 'acceptresults=' + repr(_pc.document['acceptresults']) ] )
        return _end_log( _logging_state_, 'h_mssplit', _h_mssplit_t( _pc.document['vis'], _pc.document['outputvis'], _pc.document['field'], _pc.document['intent'], _pc.document['spw'], _pc.document['datacolumn'], _pc.document['chanbin'], _pc.document['timebin'], _pc.document['replace'], _pc.document['pipelinemode'], _pc.document['dryrun'], _pc.document['acceptresults'] ) )

h_mssplit = _h_mssplit( )