Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatasks/listpartition.py: 89%
27 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-01 07:19 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-01 07:19 +0000
1##################### generated by xml-casa (v2) from listpartition.xml #############
2##################### 6189ee239dcbf5762daf5b6427959029 ##############################
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_listpartition import listpartition as _listpartition_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 _listpartition:
15 """
16 listpartition ---- Get the summary of a multi-MS data set and print in the logger or in a file
19 Lists the following properties of a multi-measurement set:
20 sub-MS name, scan list, spw list, list of number of channels per spw,
21 number of rows for all scans.
24 --------- parameter descriptions ---------------------------------------------
26 vis Name of Multi-MS or normal MS.
27 createdict Create and return a dictionary with Sub-MS information
28 listfile Name of ASCII file to save output: ''==>to terminal
29 [1;42mRETURNS[1;m void
31 --------- examples -----------------------------------------------------------
35 A multi-measurement set (MMS) is an MS that has been split into sub-MSs.
36 An MMS contains a reference MS in the top directory and the sub-MSs are
37 located in a directory called SUBMSS inside the MMS directory.
38 Example of a MS that was partitioned in the 'scan' axis using the task partition:
40 > ls ngc5921.mms
41 ANTENNA FLAG_CMD POLARIZATION SPECTRAL_WINDOW table.dat
42 DATA_DESCRIPTION HISTORY PROCESSOR STATE table.info
43 FEED OBSERVATION SORTED_TABLE SUBMSS WEATHER
44 FIELD POINTING SOURCE SYSCAL
46 > ls ngc5921.mms/SUBMSS/
47 ngc5921.0000.ms/ ngc5921.0002.ms/ ngc5921.0004.ms/ ngc5921.0006.ms/
48 ngc5921.0001.ms/ ngc5921.0003.ms/ ngc5921.0005.ms/
50 The task lists the following properties of a multi-MS or MS:
51 sub-MS name, scan, spw list, list of number of channels per spw,
52 number of rows for each scan and the size in disk. Example of logger output:
54 Sub-MS Scan Spw Nchan Nrows Size
55 ngc5921.0000.ms 1 [0] [63] 4509 11M
56 ngc5921.0001.ms 2 [0] [63] 1890 6.4M
57 ngc5921.0002.ms 3 [0] [63] 6048 13M
58 ngc5921.0003.ms 4 [0] [63] 756 4.9M
59 ngc5921.0004.ms 5 [0] [63] 1134 6.4M
60 ngc5921.0005.ms 6 [0] [63] 6804 15M
61 ngc5921.0006.ms 7 [0] [63] 1512 6.4M
64 ------- Detailed description of keyword arguments -------
65 vis -- Name of multi-MS or normal MS.
66 default: ''.
67 example: vis='pScan.mms'
69 createdict -- Create and return a dictionary containing scan summaries of each
70 sub-MS.
71 default: False
73 If set to True, the returned dictionary will contain information from
74 ms.getscansummary() and ms.getspectralwindowinfo(), with the addition of an
75 index as the top key and the sub-MS name.
76 Example:
78 {0: {'MS': 'ngc5921.0000.ms',
79 'scanId': {1: {'nchans': array([63], dtype=int32),
80 'nrows': 4509,
81 'spwIds': array([0], dtype=int32)}},
82 'size': '11M'},
83 1: {'MS': 'ngc5921.0001.ms',
84 'scanId': {2: {'nchans': array([63], dtype=int32),
85 'nrows': 1890,
86 'spwIds': array([0], dtype=int32)}},
87 'size': '6.4M'}}
89 listfile -- Name of ASCII file to save output to. If empty, it will
90 list on the logger/terminal.
91 default: ''
92 example: listfile='pscan.txt'
97 """
99 _info_group_ = """information"""
100 _info_desc_ = """Get the summary of a multi-MS data set and print in the logger or in a file"""
102 def __call__( self, vis='', createdict=False, listfile='' ):
103 schema = {'vis': {'type': 'cReqPath', 'coerce': _coerce.expand_path}, 'createdict': {'type': 'cBool'}, 'listfile': {'type': 'cStr', 'coerce': _coerce.to_str}}
104 doc = {'vis': vis, 'createdict': createdict, 'listfile': listfile}
105 assert _pc.validate(doc,schema), create_error_string(_pc.errors)
106 _logging_state_ = _start_log( 'listpartition', [ 'vis=' + repr(_pc.document['vis']), 'createdict=' + repr(_pc.document['createdict']), 'listfile=' + repr(_pc.document['listfile']) ] )
107 task_result = None
108 try:
109 task_result = _listpartition_t( _pc.document['vis'], _pc.document['createdict'], _pc.document['listfile'] )
110 except Exception as exc:
111 _except_log('listpartition', exc)
112 raise
113 finally:
114 task_result = _end_log( _logging_state_, 'listpartition', task_result )
115 return task_result
117listpartition = _listpartition( )