Source code for pipeline.hif.cli.hif_uvcontsub

##################### generated by xml-casa (v2) from hif_uvcontsub.xml #############
##################### 826e60d7a7e1783fe12b85e0c0646dad ##############################
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_uvcontsub import hif_uvcontsub as _hif_uvcontsub_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_uvcontsub:
    """
    hif_uvcontsub ---- Subtract the fitted continuum from the data

    
    Subtract the fitted continuum in the callibrary from the data.
    
    hif_uvcontsub applies the precomputed uv continuum fit tables stored in the
    pipeline context to the set of visibility files using predetermined field and
    spectral window maps and default values for the interpolation schemes.
    
    Users can interact with the pipeline calibration state using the tasks
    hif_export_calstate and hif_import_calstate.
    
    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']
    field         The list of field names or field ids for which UV continuum
                  fits are computed. Defaults to all fields.
                  Eexamples: '3C279', '3C279, M82'
    intent        A string containing a comma delimited list of intents against
                  which the selected fields are matched.
                  '': Defaults to all data with TARGET intent.
    spw           The list of spectral windows and channels for which uv
                  continuum fits are computed.
                  '', Defaults to all science spectral windows.
                  
                  Example: '11,13,15,17'
    applymode     Calibration apply mode 
                  ''='calflagstrict': calibrate data and apply flags from
                    solutions using the strict flagging convention
                  'trial': report on flags from solutions, dataset entirely
                    unchanged
                  'flagonly': apply flags from solutions only, data not
                    calibrated
                  'calonly': calibrate data only, flags from solutions NOT
                    applied
                  'calflagstrict':
                  'flagonlystrict': same as above except flag spws for which
                    calibration is unavailable in one or more tables (instead
                    of allowing them to pass uncalibrated and unflagged)
    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_ = """Subtract the fitted continuum from the data"""

    def __call__( self, vis=[  ], field='', intent='', spw='', applymode='', pipelinemode='automatic', 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}, 'applymode': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'calonly', 'flagonlystrict', 'calflag', 'flagonly', 'trial', '', 'calflagstrict' ]}, 'pipelinemode': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'automatic', 'interactive', 'getinputs' ]}, 'dryrun': {'type': 'cBool'}, 'acceptresults': {'type': 'cBool'}}
        doc = {'vis': vis, 'field': field, 'intent': intent, 'spw': spw, 'applymode': applymode, 'pipelinemode': pipelinemode, 'dryrun': dryrun, 'acceptresults': acceptresults}
        assert _pc.validate(doc,schema), str(_pc.errors)
        _logging_state_ = _start_log( 'hif_uvcontsub', [ 'vis=' + repr(_pc.document['vis']), 'field=' + repr(_pc.document['field']), 'intent=' + repr(_pc.document['intent']), 'spw=' + repr(_pc.document['spw']), 'applymode=' + repr(_pc.document['applymode']), 'pipelinemode=' + repr(_pc.document['pipelinemode']), 'dryrun=' + repr(_pc.document['dryrun']), 'acceptresults=' + repr(_pc.document['acceptresults']) ] )
        return _end_log( _logging_state_, 'hif_uvcontsub', _hif_uvcontsub_t( _pc.document['vis'], _pc.document['field'], _pc.document['intent'], _pc.document['spw'], _pc.document['applymode'], _pc.document['pipelinemode'], _pc.document['dryrun'], _pc.document['acceptresults'] ) )

hif_uvcontsub = _hif_uvcontsub( )