Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatasks/smoothcal.py: 56%
27 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 17:39 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 17:39 +0000
1##################### generated by xml-casa (v2) from smoothcal.xml #################
2##################### f42067d5fb841f01ce7665574434918f ##############################
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_smoothcal import smoothcal as _smoothcal_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 _smoothcal:
15 """
16 smoothcal ---- Smooth calibration solution(s) derived from one or more sources
19 A G- or T-type gain calibration can be smoothed. Amplitude and
20 phase are currently smoothed with the same time. Calibration values
21 will be smoothed over all fields.
24 --------- parameter descriptions ---------------------------------------------
26 vis Name of input visibility file (MS)
27 tablein Input calibration table
28 caltable Output calibration table (overwrite tablein if unspecified)
29 field Field name list
30 smoothtype Smoothing filter to use
31 smoothtime Smoothing time (sec)
32 [1;42mRETURNS[1;m void
34 --------- examples -----------------------------------------------------------
39 A G- or T-type gain calibration can be smoothed. The amplitude and
40 phase smoothing times are currently the same. Calibration values
41 will be smoothed for only the specified fields. Smoothing is
42 performed independently per field, per spw, and per antenna.
44 Keyword arguments:
45 vis -- Name of input visibility file
46 default: none; example: vis='ngc5921.ms'
47 tablein -- Input calibration table (G or T)
48 default: none; example: tablein='ngc5921.gcal'
49 caltable -- Output calibration table (smoothed)
50 default: '' (will overwrite tablein);
51 example: caltable='ngc5921_smooth.gcal'
52 field -- subset of fields to select and smooth
53 default: '' means all; example: field='0319_415_1,3C286'
54 smoothtype -- The smoothing filter to be used for both amp and phase
55 default: 'median'; example: smoothtype='mean'
56 Options: 'median','mean'
57 smoothtime -- Smoothing filter time (sec)
58 default: 300.0; example: smoothtime=60.
62 """
64 _info_group_ = """calibration"""
65 _info_desc_ = """Smooth calibration solution(s) derived from one or more sources"""
67 def __call__( self, vis='', tablein='', caltable='', field=[ ], smoothtype='median', smoothtime=float(60.0) ):
68 schema = {'vis': {'type': 'cReqPath', 'coerce': _coerce.expand_path}, 'tablein': {'type': 'cReqPath', 'coerce': _coerce.expand_path}, 'caltable': {'type': 'cStr', 'coerce': _coerce.to_str}, 'field': {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}, 'smoothtype': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'median', 'mean' ]}, 'smoothtime': {'anyof': [{'type': 'cFloat', 'coerce': _coerce.to_float}, {'type': 'cInt'}]}}
69 doc = {'vis': vis, 'tablein': tablein, 'caltable': caltable, 'field': field, 'smoothtype': smoothtype, 'smoothtime': smoothtime}
70 assert _pc.validate(doc,schema), create_error_string(_pc.errors)
71 _logging_state_ = _start_log( 'smoothcal', [ 'vis=' + repr(_pc.document['vis']), 'tablein=' + repr(_pc.document['tablein']), 'caltable=' + repr(_pc.document['caltable']), 'field=' + repr(_pc.document['field']), 'smoothtype=' + repr(_pc.document['smoothtype']), 'smoothtime=' + repr(_pc.document['smoothtime']) ] )
72 task_result = None
73 try:
74 task_result = _smoothcal_t( _pc.document['vis'], _pc.document['tablein'], _pc.document['caltable'], _pc.document['field'], _pc.document['smoothtype'], _pc.document['smoothtime'] )
75 except Exception as exc:
76 _except_log('smoothcal', exc)
77 raise
78 finally:
79 task_result = _end_log( _logging_state_, 'smoothcal', task_result )
80 return task_result
82smoothcal = _smoothcal( )