Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatasks/listvis.py: 89%

27 statements  

« prev     ^ index     » next       coverage.py v7.6.4, created at 2024-11-01 07:19 +0000

1##################### generated by xml-casa (v2) from listvis.xml ################### 

2##################### 74d4b217d2565f7f95a58f1b6a2778be ############################## 

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_listvis import listvis as _listvis_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 

13 

14class _listvis: 

15 """ 

16 listvis ---- List measurement set visibilities. 

17 

18  

19  

20 This task lists measurement set visibility data under a number of 

21 input selection conditions. The measurement set data columns that 

22 can be listed are: the raw data, float_data, corrected data, model data, 

23 and residual (corrected - model) data. 

24  

25 The output table format is dynamic. Field, Spectral Window, and 

26 Channel columns are not displayed if the column contents are uniform. 

27 For example, if "spw = '1'" is specified, the spw column will not be 

28 displayed. When a column is not displayed, a message is sent to the 

29 logger and terminal indicating that the column values are uniform and 

30 listing the uniform value. 

31  

32 Table column descriptions: 

33  

34 COLUMN NAME DESCRIPTION 

35 ----------- ----------- 

36 Date/Time Time stamp of data sample (YYMMDD/HH:MM:SS UT) 

37 Intrf Interferometer baseline (antenna names) 

38 UVDist uv-distance (units of wavelength) 

39 Fld Field ID (if more than 1) 

40 SpW Spectral Window ID (if more than 1) 

41 Chn Channel number (if more than 1) 

42 (Correlated Correlated polarizations (eg: RR, LL, XY) 

43 polarization) Sub-columns are: Amp, Phs, Wt, F 

44 Amp Visibility amplitude 

45 Phs Visibility phase (deg) 

46 Wt Weight of visibility measurement 

47 F Flag: 'F' = flagged datum; ' ' = unflagged 

48 UVW UVW coordinates (meters) 

49  

50  

51 Input Parameters: 

52 vis Name of input visibility file 

53 default: none; example: vis='ngc5921.ms' 

54  

55 options List options: default = 'ap' 

56 Not yet implemented for suboptions 

57  

58 datacolumn Visibility file data column: 

59 default = 'data': options are 

60 data, float_data, corrected, model, residual (corrected-model) 

61  

62 field Select data based on field id(s) or name(s) 

63 default: ''==>all; example: field='1' 

64 field='0~2' field ids inclusive from 0 to 2 

65 field='3C*' all field names starting with 3C 

66  

67 spw Select spectral window, channel to list 

68 default: '0:0' --> spw=0, chan=0 

69 spw='2:34' spectral window 2, channel 34 

70  

71 selectdata Toggle the following 7 selection parameters. 

72 default: False; example: selectdata=True 

73 If false, the following parameters are reset 

74 to default values. 

75  

76 antenna Select calibration data based on antenna 

77 default: ''-->all; examples: 

78 antenna = '5,6'; antenna index 5 and 6 solutions 

79 antenna = '05,06'; antenna names '05' and '06 solutions 

80  

81 timerange Select time range to list 

82 default: ''-->all; examples: 

83 timerange='10:37:50.1'; list data for this sampling interval 

84 timerange='<10:37:25'; list data before 10:37:25 

85  

86 correlation Select polarization correlations to list 

87 default: ''-->all; examples: 

88 correlation='RR LL'; list RR and LL correlations 

89 correlation='XX XY'; list XX and XY correlations 

90  

91 scan Select scans to list 

92 default: ''-->all; examples: 

93 scan='2'; list scan 2 

94 scan='>2'; list scan numbers greater than 2 

95  

96 feed (not yet implemented) 

97  

98 array (not yet implemented) 

99  

100 observation Select by observation ID. 

101  

102 uvrange Select baseline lengths to list. 

103 default: ''--> all; examples: 

104 uvrange='<5klambda'; less than 5 kilo-wavelengths 

105 Caution: Input units default to meters. 

106 Listed units are always wavelengths. 

107  

108 average (not yet implemented) 

109  

110 showflags (not yet implemented) 

111  

112 pagerows rows per page of listing 

113 default: 50; 0 --> do not paginate 

114  

115 listfile write output to disk; will not overwrite 

116 default: '' --> write to screen 

117 listfile = 'solutions.txt' 

118  

119  

120 

121 --------- parameter descriptions --------------------------------------------- 

122 

123 vis Name of input visibility file 

124 options List options: ap only 

125 datacolumn Column to list: data, float_data, corrected, model, residual 

126 field Field names or index to be listed 

127 spw Spectral window channels 

128 selectdata Other data selection parameters 

129 antenna Antenna/baselines 

130 timerange Time range 

131 correlation Correlations 

132 scan Scan numbers 

133 feed Multi-feed numbers (Not yet implemented) 

134 array Array numbers (Not yet implemented) 

135 observation Select by observation ID(s) 

136 uvrange uv range 

137 average Averaging mode 

138 showflags Show flagged data (Not yet implemented) 

139 pagerows Rows per page 

140 listfile Output file 

141 RETURNS void 

142 

143 --------- examples ----------------------------------------------------------- 

144 

145  

146  

147 This task lists measurement set visibility data under a number of 

148 input selection conditions. The measurement set data columns that 

149 can be listed are: the raw data, float_data, corrected data, model data, 

150 and residual (corrected - model) data. 

151  

152 The output table format is dynamic. Field, Spectral Window, and 

153 Channel columns are not displayed if the column contents are uniform. 

154 For example, if "spw = '1'" is specified, the spw column will not be 

155 displayed. When a column is not displayed, a message is sent to the 

156 logger and terminal indicating that the column values are uniform and 

157 listing the uniform value. 

158  

159 Table column descriptions: 

160  

161 COLUMN NAME DESCRIPTION 

162 ----------- ----------- 

163 Date/Time Time stamp of data sample (YYMMDD/HH:MM:SS UT) 

164 Intrf Interferometer baseline (antenna names) 

165 UVDist uv-distance (units of wavelength) 

166 Fld Field ID (if more than 1) 

167 SpW Spectral Window ID (if more than 1) 

168 Chn Channel number (if more than 1) 

169 (Correlated Correlated polarizations (eg: RR, LL, XY) 

170 polarization) Sub-columns are: Amp, Phs, Wt, F 

171 Amp Visibility amplitude 

172 Phs Visibility phase (deg) 

173 Wt Weight of visibility measurement 

174 F Flag: 'F' = flagged datum; ' ' = unflagged 

175 UVW UVW coordinates (meters) 

176  

177  

178 Input Parameters: 

179 vis Name of input visibility file 

180 default: none; example: vis='ngc5921.ms' 

181  

182 options List options: default = 'ap' 

183 Not yet implemented for suboptions 

184  

185 datacolumn Visibility file data column: 

186 default = 'data': options are 

187 data, float_data, corrected, model, residual (corrected-model) 

188  

189 field Select data based on field id(s) or name(s) 

190 default: ''==>all; example: field='1' 

191 field='0~2' field ids inclusive from 0 to 2 

192 field='3C*' all field names starting with 3C 

193  

194 spw Select spectral window, channel to list 

195 default: '0:0' --> spw=0, chan=0 

196 spw='2:34' spectral window 2, channel 34 

197  

198 selectdata Toggle the following 7 selection parameters. 

199 default: False; example: selectdata=True 

200 If false, the following parameters are reset 

201 to default values. 

202  

203 antenna Select calibration data based on antenna 

204 default: ''-->all; examples: 

205 antenna = '5,6'; antenna index 5 and 6 solutions 

206 antenna = '05,06'; antenna names '05' and '06 solutions 

207  

208 timerange Select time range to list 

209 default: ''-->all; examples: 

210 timerange='10:37:50.1'; list data for this sampling interval 

211 timerange='<10:37:25'; list data before 10:37:25 

212  

213 correlation Select polarization correlations to list 

214 default: ''-->all; examples: 

215 correlation='RR LL'; list RR and LL correlations 

216 correlation='XX XY'; list XX and XY correlations 

217  

218 scan Select scans to list 

219 default: ''-->all; examples: 

220 scan='2'; list scan 2 

221 scan='>2'; list scan numbers greater than 2 

222  

223 feed (not yet implemented) 

224  

225 array (not yet implemented) 

226  

227 observation Select by observation ID(s). 

228 default: ''-->all; 

229 example: observation='0' (select obsID 0) 

230  

231 uvrange Select baseline lengths to list. 

232 default: ''--> all; examples: 

233 uvrange='<5klambda'; less than 5 kilo-wavelengths 

234 Caution: Input units default to meters. 

235 Listed units are always wavelengths. 

236  

237 average (not yet implemented) 

238  

239 showflags (not yet implemented) 

240  

241 pagerows rows per page of listing 

242 default: 50; 0 --> do not paginate 

243  

244 listfile write output to disk; will not overwrite 

245 default: '' --> write to screen 

246 listfile = 'solutions.txt' 

247  

248  

249 

250 

251 """ 

252 

253 _info_group_ = """information, analysis""" 

254 _info_desc_ = """List measurement set visibilities.""" 

255 

256 def __call__( self, vis='', options='ap', datacolumn='data', field='', spw='*', selectdata=False, antenna='', timerange='', correlation='', scan='', feed='', array='', observation='', uvrange='', average='', showflags=False, pagerows=int(50), listfile='' ): 

257 schema = {'vis': {'type': 'cReqPath', 'coerce': _coerce.expand_path}, 'options': {'type': 'cStr', 'coerce': _coerce.to_str}, 'datacolumn': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'model', 'corrected', 'residual', 'float_data', 'data' ]}, 'field': {'type': 'cStr', 'coerce': _coerce.to_str}, 'spw': {'type': 'cStr', 'coerce': _coerce.to_str}, 'selectdata': {'type': 'cBool'}, 'antenna': {'type': 'cStr', 'coerce': _coerce.to_str}, 'timerange': {'type': 'cStr', 'coerce': _coerce.to_str}, 'correlation': {'type': 'cStr', 'coerce': _coerce.to_str}, 'scan': {'type': 'cStr', 'coerce': _coerce.to_str}, 'feed': {'type': 'cStr', 'coerce': _coerce.to_str}, 'array': {'type': 'cStr', 'coerce': _coerce.to_str}, 'observation': {'anyof': [{'type': 'cStr', 'coerce': _coerce.to_str}, {'type': 'cInt'}]}, 'uvrange': {'type': 'cStr', 'coerce': _coerce.to_str}, 'average': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'none', 'chan', 'both', '', 'time' ]}, 'showflags': {'type': 'cBool'}, 'pagerows': {'type': 'cInt'}, 'listfile': {'type': 'cStr', 'coerce': _coerce.to_str}} 

258 doc = {'vis': vis, 'options': options, 'datacolumn': datacolumn, 'field': field, 'spw': spw, 'selectdata': selectdata, 'antenna': antenna, 'timerange': timerange, 'correlation': correlation, 'scan': scan, 'feed': feed, 'array': array, 'observation': observation, 'uvrange': uvrange, 'average': average, 'showflags': showflags, 'pagerows': pagerows, 'listfile': listfile} 

259 assert _pc.validate(doc,schema), create_error_string(_pc.errors) 

260 _logging_state_ = _start_log( 'listvis', [ 'vis=' + repr(_pc.document['vis']), 'options=' + repr(_pc.document['options']), 'datacolumn=' + repr(_pc.document['datacolumn']), 'field=' + repr(_pc.document['field']), 'spw=' + repr(_pc.document['spw']), 'selectdata=' + repr(_pc.document['selectdata']), 'antenna=' + repr(_pc.document['antenna']), 'timerange=' + repr(_pc.document['timerange']), 'correlation=' + repr(_pc.document['correlation']), 'scan=' + repr(_pc.document['scan']), 'feed=' + repr(_pc.document['feed']), 'array=' + repr(_pc.document['array']), 'observation=' + repr(_pc.document['observation']), 'uvrange=' + repr(_pc.document['uvrange']), 'average=' + repr(_pc.document['average']), 'showflags=' + repr(_pc.document['showflags']), 'pagerows=' + repr(_pc.document['pagerows']), 'listfile=' + repr(_pc.document['listfile']) ] ) 

261 task_result = None 

262 try: 

263 task_result = _listvis_t( _pc.document['vis'], _pc.document['options'], _pc.document['datacolumn'], _pc.document['field'], _pc.document['spw'], _pc.document['selectdata'], _pc.document['antenna'], _pc.document['timerange'], _pc.document['correlation'], _pc.document['scan'], _pc.document['feed'], _pc.document['array'], _pc.document['observation'], _pc.document['uvrange'], _pc.document['average'], _pc.document['showflags'], _pc.document['pagerows'], _pc.document['listfile'] ) 

264 except Exception as exc: 

265 _except_log('listvis', exc) 

266 raise 

267 finally: 

268 task_result = _end_log( _logging_state_, 'listvis', task_result ) 

269 return task_result 

270 

271listvis = _listvis( ) 

272