##################### generated by xml-casa (v2) from hpc_hif_refant.xml ############
##################### 9ed0f0f5cd1e23734390ccb652efc11f ##############################
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_hpc_hif_refant import hpc_hif_refant as _hpc_hif_refant_t
from casatasks.private.task_logging import start_log as _start_log
from casatasks.private.task_logging import end_log as _end_log
class _hpc_hif_refant:
"""
hpc_hif_refant ---- Select the best reference antennas
The hpc_hif_refant task selects a list of reference antennas and stores them
in the pipeline context in priority order.
The priority order is determined by a weighted combination of scores derived
by the antenna selection heuristics. In manual mode the reference antennas
can be set by hand.
Output:
results -- If pipeline mode is 'getinputs' then None is returned. Otherwise
the results object for the pipeline task is returned.
Issues
--------- parameter descriptions ---------------------------------------------
vis The list of input MeasurementSets. Defaults to the list of
MeasurementSets in the pipeline context.
Not available when pipelinemode='automatic'.
example: ['M31.ms']
field The comma delimited list of field names or field ids for which flagging
scores are computed if hm_refant='automatic' and flagging = True.
Not available when pipelinemode='automatic'.
example: '' (Default to fields with the specified intents), '3C279', '3C279,M82'
intent A string containing a comma delimited list of intents against
which the selected fields are matched. Defaults to all supported
intents. Not available when pipelinemode='automatic'.
example: 'BANDPASS', 'AMPLI,BANDPASS,PHASE'
spw A string containing the comma delimited list of spectral window ids for
which flagging scores are computed if hm_refant='automatic' and flagging = True.
Not available when pipelinemode='automatic'.
example: '' (all spws observed with the specified intents), '11,13,15,17'
hm_refant The heuristics method or mode for selection the reference
antenna. The options are 'manual' and 'automatic. In manual
mode a user supplied referenence antenna refant is supplied.
In 'automatic' mode the antennas are selected automatically.
refant The user supplied reference antenna for hm_refant='manual. If
no antenna list is supplied an empty list is returned.
example: 'DV05'
refantignore string list to be ignored as reference antennas.
example: refantignore='ea02,ea03'
geometry Score antenna by proximity to the center of the array. This
option is quick as only the ANTENNA table must be read.
Parameter is available when hm_refant='automatic'.
flagging Score antennas by percentage of unflagged data. This option
requires computing flagging statistics.
Parameter is available when hm_refant='automatic'.
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).
Available when pipelinemode='interactive'.
acceptresults Add the results of the task to the pipeline context (True) or
reject them (False). Available when pipelinemode='interactive'.
parallel Execute using CASA HPC functionality, if available.
--------- examples -----------------------------------------------------------
1. Compute the references antennas to be used for bandpass and gain calibration.
hpc_hif_refant()
"""
_info_group_ = """pipeline"""
_info_desc_ = """Select the best reference antennas"""
def __call__( self, vis=[ ], field='', intent='AMPLITUDE,BANDPASS,PHASE', spw='', hm_refant='automatic', refant='', refantignore='', geometry=True, flagging=True, pipelinemode='automatic', dryrun=False, acceptresults=True, parallel='automatic' ):
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}, 'hm_refant': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'automatic', 'manual' ]}, 'refant': {'type': 'cStr', 'coerce': _coerce.to_str}, 'refantignore': {'type': 'cStr', 'coerce': _coerce.to_str}, 'geometry': {'type': 'cBool'}, 'flagging': {'type': 'cBool'}, 'pipelinemode': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'automatic', 'interactive', 'getinputs' ]}, 'dryrun': {'type': 'cBool'}, 'acceptresults': {'type': 'cBool'}, 'parallel': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'automatic', 'true', 'false' ]}}
doc = {'vis': vis, 'field': field, 'intent': intent, 'spw': spw, 'hm_refant': hm_refant, 'refant': refant, 'refantignore': refantignore, 'geometry': geometry, 'flagging': flagging, 'pipelinemode': pipelinemode, 'dryrun': dryrun, 'acceptresults': acceptresults, 'parallel': parallel}
assert _pc.validate(doc,schema), str(_pc.errors)
_logging_state_ = _start_log( 'hpc_hif_refant', [ 'vis=' + repr(_pc.document['vis']), 'field=' + repr(_pc.document['field']), 'intent=' + repr(_pc.document['intent']), 'spw=' + repr(_pc.document['spw']), 'hm_refant=' + repr(_pc.document['hm_refant']), 'refant=' + repr(_pc.document['refant']), 'refantignore=' + repr(_pc.document['refantignore']), 'geometry=' + repr(_pc.document['geometry']), 'flagging=' + repr(_pc.document['flagging']), 'pipelinemode=' + repr(_pc.document['pipelinemode']), 'dryrun=' + repr(_pc.document['dryrun']), 'acceptresults=' + repr(_pc.document['acceptresults']), 'parallel=' + repr(_pc.document['parallel']) ] )
return _end_log( _logging_state_, 'hpc_hif_refant', _hpc_hif_refant_t( _pc.document['vis'], _pc.document['field'], _pc.document['intent'], _pc.document['spw'], _pc.document['hm_refant'], _pc.document['refant'], _pc.document['refantignore'], _pc.document['geometry'], _pc.document['flagging'], _pc.document['pipelinemode'], _pc.document['dryrun'], _pc.document['acceptresults'], _pc.document['parallel'] ) )
hpc_hif_refant = _hpc_hif_refant( )