Source code for pipeline.hif.cli.hif_setmodels

##################### generated by xml-casa (v2) from hif_setmodels.xml #############
##################### 914ee000d03f4468b827af2887554753 ##############################
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_setmodels import hif_setmodels as _hif_setmodels_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_setmodels:
    """
    hif_setmodels ---- Set calibrator source models

    
    Set model fluxes values for calibrator reference and transfer sources using lookup
    values. By default the reference sources are the flux calibrators and the transfer
    sources are the bandpass, phase, and check source calibrators. Reference sources
    which are also in the transfer source list are removed from the transfer source list.
    
    Built-in lookup tables are used to compute models for solar system object calibrators.
    Point source models for other calibrators are provided in the reference file.
    Normalize fluxes are computed for transfer sources if the normfluxes parameter is
    set to True.
    
    The reference file default to a file called 'flux.csv' in the current working
    directory. This file is normal created in the importdata step. The file is in
    'csv' format and contains the following comma delimited columns.
    
    vis,fieldid,spwid,I,Q,U,V,pix,comment
    
    
    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 pipeline context.
                  
                  example: ['M32A.ms', 'M32B.ms']
    reference     A string containing a comma delimited list of  field names
                  defining the reference calibrators. Defaults to field names with
                  intent 'AMPLITUDE'.
                  
                  example: 'M82,3C273'
    refintent     A string containing a comma delimited list of intents
                  used to select the reference calibrators. Defaults to 'AMPLITUDE'.
                  
                  example: 'BANDPASS'
    transfer      A string containing a comma delimited list of  field names
                  defining the transfer calibrators. Defaults to field names with
                  intent ''.
                  
                  example: 'J1328+041,J1206+30'
    transintent   A string containing a comma delimited list of intents
                  defining the transfer calibrators. Defaults to 'BANDPASS,PHASE,CHECK'.
                  '' stands for no transfer sources.
                  
                  example: 'PHASE'
    reffile       The reference file containing a lookup table of point source models
                  This file currently defaults to 'flux.csv' in the working directory. This
                  file must conform to the standard pipeline 'flux.csv' format
                  example: 'myfluxes.csv'
    normfluxes    
    scalebychan   lux density on a per channel basis or else on a per spw basis
                  
                  example: False
    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 users can check the settings
                  of all pipeline parameters without running the task.
    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. Set model fluxes for the flux, bandpass, phase, and check sources.
    
    hif_setmodels()


    """

    _info_group_ = """pipeline"""
    _info_desc_ = """Set calibrator source models"""

    def __call__( self, vis='', reference='', refintent='AMPLITUDE', transfer='', transintent='BANDPASS', reffile='', normfluxes=True, scalebychan=True, pipelinemode='automatic', dryrun=False, acceptresults=True ):
        schema = {'vis': {'type': 'cStr', 'coerce': _coerce.to_str}, 'reference': {'type': 'cVariant', 'coerce': [_coerce.to_variant]}, 'refintent': {'type': 'cStr', 'coerce': _coerce.to_str}, 'transfer': {'type': 'cVariant', 'coerce': [_coerce.to_variant]}, 'transintent': {'type': 'cStr', 'coerce': _coerce.to_str}, 'reffile': {'type': 'cStr', 'coerce': _coerce.to_str}, 'normfluxes': {'type': 'cBool'}, 'scalebychan': {'type': 'cBool'}, 'pipelinemode': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'automatic', 'interactive', 'getinputs' ]}, 'dryrun': {'type': 'cBool'}, 'acceptresults': {'type': 'cBool'}}
        doc = {'vis': vis, 'reference': reference, 'refintent': refintent, 'transfer': transfer, 'transintent': transintent, 'reffile': reffile, 'normfluxes': normfluxes, 'scalebychan': scalebychan, 'pipelinemode': pipelinemode, 'dryrun': dryrun, 'acceptresults': acceptresults}
        assert _pc.validate(doc,schema), str(_pc.errors)
        _logging_state_ = _start_log( 'hif_setmodels', [ 'vis=' + repr(_pc.document['vis']), 'reference=' + repr(_pc.document['reference']), 'refintent=' + repr(_pc.document['refintent']), 'transfer=' + repr(_pc.document['transfer']), 'transintent=' + repr(_pc.document['transintent']), 'reffile=' + repr(_pc.document['reffile']), 'normfluxes=' + repr(_pc.document['normfluxes']), 'scalebychan=' + repr(_pc.document['scalebychan']), 'pipelinemode=' + repr(_pc.document['pipelinemode']), 'dryrun=' + repr(_pc.document['dryrun']), 'acceptresults=' + repr(_pc.document['acceptresults']) ] )
        return _end_log( _logging_state_, 'hif_setmodels', _hif_setmodels_t( _pc.document['vis'], _pc.document['reference'], _pc.document['refintent'], _pc.document['transfer'], _pc.document['transintent'], _pc.document['reffile'], _pc.document['normfluxes'], _pc.document['scalebychan'], _pc.document['pipelinemode'], _pc.document['dryrun'], _pc.document['acceptresults'] ) )

hif_setmodels = _hif_setmodels( )