Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatasks/calstat.py: 56%
27 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 18:48 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 18:48 +0000
1##################### generated by xml-casa (v2) from calstat.xml ###################
2##################### 37ee58c3b0cae4fdf3ce5843ae09628c ##############################
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_calstat import calstat as _calstat_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 _calstat:
15 """
16 calstat ---- Calculates statistical information on a calibration table
19 This task returns statistical information about a column in a
20 calibration table. The following values are computed: mean value, sum
21 of values, sum of squared values, median, median absolute deviation,
22 quartile, minimum, maximum, variance, standard deviation, root mean
23 square.
25 --------- parameter descriptions ---------------------------------------------
27 caltable Name of input calibration table
28 Default: ''
30 Example: vis='ggtau.1mm.amp.gcal'
31 axis Which data to analyze.
32 Default: 'amplitude'
33 Options: 'amp', 'amplitude', 'phase', 'real',
34 'imag', 'imaginary'. Also, the name of any real
35 valued MS column can be given, e.g. TIME,
36 POLY_COEFF_AMP, REF_ANT, ANTENNA1, FLAG, ...
38 Note: the phase of a complex number is in
39 radians in the range [-pi; pi].
40 datacolumn Which data column to use if axis is 'amp', 'amplitude', 'phase', 'real', 'imag' or 'imaginary'.
41 Default: 'gain'
43 --------- examples -----------------------------------------------------------
48 For more information, see the task pages of calstat in CASA Docs:
50 https://casa.nrao.edu/casadocs/
53 """
55 _info_group_ = """information, calibration"""
56 _info_desc_ = """Calculates statistical information on a calibration table"""
58 def __call__( self, caltable='', axis='amplitude', datacolumn='gain' ):
59 schema = {'caltable': {'type': 'cReqPath', 'coerce': _coerce.expand_path}, 'axis': {'type': 'cStr', 'coerce': _coerce.to_str}, 'datacolumn': {'type': 'cStr', 'coerce': _coerce.to_str}}
60 doc = {'caltable': caltable, 'axis': axis, 'datacolumn': datacolumn}
61 assert _pc.validate(doc,schema), create_error_string(_pc.errors)
62 _logging_state_ = _start_log( 'calstat', [ 'caltable=' + repr(_pc.document['caltable']), 'axis=' + repr(_pc.document['axis']), 'datacolumn=' + repr(_pc.document['datacolumn']) ] )
63 task_result = None
64 try:
65 task_result = _calstat_t( _pc.document['caltable'], _pc.document['axis'], _pc.document['datacolumn'] )
66 except Exception as exc:
67 _except_log('calstat', exc)
68 raise
69 finally:
70 task_result = _end_log( _logging_state_, 'calstat', task_result )
71 return task_result
73calstat = _calstat( )