Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatasks/polfromgain.py: 56%
27 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 19:10 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 19:10 +0000
1##################### generated by xml-casa (v2) from polfromgain.xml ###############
2##################### 81a3ae6d4c5273a4ac930473d37d18bb ##############################
3from __future__ import absolute_import
4import numpy
5from casatools.typecheck import CasaValidator as _val_ctor
6_pc = _val_ctor( )
7from casatools.coercetype import coerce as _coerce
8from casatools.errors import create_error_string
9from .private.task_polfromgain import polfromgain as _polfromgain_t
10from casatasks.private.task_logging import start_log as _start_log
11from casatasks.private.task_logging import end_log as _end_log
12from casatasks.private.task_logging import except_log as _except_log
14class _polfromgain:
15 """
16 polfromgain ---- Derive linear polarization from gain ratio
19 TBD
22 --------- parameter descriptions ---------------------------------------------
24 vis Name of input MS from which gaincal caltable in tablein originated. Used to extract geometry information not available in the tablein caltable.
25 tablein Input gain calibration table corresponding to MS specified in vis.
26 caltable Optional output calibration table which will contain source polarization-corrected gains, if specified
27 paoffset Manual position angle offset (clockwise, in deg); added to value stored in the MS FEED subtable. Use with care, since downstream calibration operation using polfromgain results will change according to this position angle offset.
28 minpacov Minimum parallactic angle coverage (deg) required for Q,U estimation. Reliable Q,U estimation depends on adequate parallactic angle coverage, and this parameter enforces a minimum allowable range of parallactic angle (per antenna) for unflagged gain solutions before the Q,U esimation is attempted. (If caltable is specified, gains for antennas failing the minpacov criteria will be corrected by the per-spw average of Q,U estimates from good antennas.)
29 [1;42mRETURNS[1;m void
31 --------- examples -----------------------------------------------------------
36 """
38 _info_group_ = """calibration"""
39 _info_desc_ = """Derive linear polarization from gain ratio"""
41 def __call__( self, vis='', tablein='', caltable='', paoffset=float(0.0), minpacov=float(30.0) ):
42 schema = {'vis': {'type': 'cReqPath', 'coerce': _coerce.expand_path}, 'tablein': {'type': 'cReqPath', 'coerce': _coerce.expand_path}, 'caltable': {'type': 'cStr', 'coerce': _coerce.to_str}, 'paoffset': {'type': 'cFloat', 'coerce': _coerce.to_float}, 'minpacov': {'type': 'cFloat', 'coerce': _coerce.to_float}}
43 doc = {'vis': vis, 'tablein': tablein, 'caltable': caltable, 'paoffset': paoffset, 'minpacov': minpacov}
44 assert _pc.validate(doc,schema), create_error_string(_pc.errors)
45 _logging_state_ = _start_log( 'polfromgain', [ 'vis=' + repr(_pc.document['vis']), 'tablein=' + repr(_pc.document['tablein']), 'caltable=' + repr(_pc.document['caltable']), 'paoffset=' + repr(_pc.document['paoffset']), 'minpacov=' + repr(_pc.document['minpacov']) ] )
46 task_result = None
47 try:
48 task_result = _polfromgain_t( _pc.document['vis'], _pc.document['tablein'], _pc.document['caltable'], _pc.document['paoffset'], _pc.document['minpacov'] )
49 except Exception as exc:
50 _except_log('polfromgain', exc)
51 raise
52 finally:
53 task_result = _end_log( _logging_state_, 'polfromgain', task_result )
54 return task_result
56polfromgain = _polfromgain( )