Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatools/__casac__/msmetadata.py: 51%

298 statements  

« prev     ^ index     » next       coverage.py v7.6.4, created at 2024-10-31 17:39 +0000

1# This file was automatically generated by SWIG (http://www.swig.org). 

2# Version 3.0.12 

3# 

4# Do not make changes to this file unless you know what you are doing--modify 

5# the SWIG interface file instead. 

6 

7from sys import version_info as _swig_python_version_info 

8if _swig_python_version_info >= (2, 7, 0): 

9 def swig_import_helper(): 

10 import importlib 

11 pkg = __name__.rpartition('.')[0] 

12 mname = '.'.join((pkg, '_msmetadata')).lstrip('.') 

13 try: 

14 return importlib.import_module(mname) 

15 except ImportError: 

16 return importlib.import_module('_msmetadata') 

17 _msmetadata = swig_import_helper() 

18 del swig_import_helper 

19elif _swig_python_version_info >= (2, 6, 0): 

20 def swig_import_helper(): 

21 from os.path import dirname 

22 import imp 

23 fp = None 

24 try: 

25 fp, pathname, description = imp.find_module('_msmetadata', [dirname(__file__)]) 

26 except ImportError: 

27 import _msmetadata 

28 return _msmetadata 

29 try: 

30 _mod = imp.load_module('_msmetadata', fp, pathname, description) 

31 finally: 

32 if fp is not None: 

33 fp.close() 

34 return _mod 

35 _msmetadata = swig_import_helper() 

36 del swig_import_helper 

37else: 

38 import _msmetadata 

39del _swig_python_version_info 

40 

41try: 

42 _swig_property = property 

43except NameError: 

44 pass # Python < 2.2 doesn't have 'property'. 

45 

46try: 

47 import builtins as __builtin__ 

48except ImportError: 

49 import __builtin__ 

50 

51def _swig_setattr_nondynamic(self, class_type, name, value, static=1): 

52 if (name == "thisown"): 

53 return self.this.own(value) 

54 if (name == "this"): 

55 if type(value).__name__ == 'SwigPyObject': 

56 self.__dict__[name] = value 

57 return 

58 method = class_type.__swig_setmethods__.get(name, None) 

59 if method: 

60 return method(self, value) 

61 if (not static): 

62 if _newclass: 

63 object.__setattr__(self, name, value) 

64 else: 

65 self.__dict__[name] = value 

66 else: 

67 raise AttributeError("You cannot add attributes to %s" % self) 

68 

69 

70def _swig_setattr(self, class_type, name, value): 

71 return _swig_setattr_nondynamic(self, class_type, name, value, 0) 

72 

73 

74def _swig_getattr(self, class_type, name): 

75 if (name == "thisown"): 

76 return self.this.own() 

77 method = class_type.__swig_getmethods__.get(name, None) 

78 if method: 

79 return method(self) 

80 raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name)) 

81 

82 

83def _swig_repr(self): 

84 try: 

85 strthis = "proxy of " + self.this.__repr__() 

86 except __builtin__.Exception: 

87 strthis = "" 

88 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) 

89 

90try: 

91 _object = object 

92 _newclass = 1 

93except __builtin__.Exception: 

94 class _object: 

95 pass 

96 _newclass = 0 

97 

98class msmetadata(_object): 

99 """Proxy of C++ casac::msmetadata class.""" 

100 

101 __swig_setmethods__ = {} 

102 __setattr__ = lambda self, name, value: _swig_setattr(self, msmetadata, name, value) 

103 __swig_getmethods__ = {} 

104 __getattr__ = lambda self, name: _swig_getattr(self, msmetadata, name) 

105 __repr__ = _swig_repr 

106 

107 def __init__(self): 

108 """__init__(self) -> msmetadata""" 

109 this = _msmetadata.new_msmetadata() 

110 try: 

111 self.this.append(this) 

112 except __builtin__.Exception: 

113 self.this = this 

114 

115 def almaspws(self, *args, **kwargs): 

116 """ 

117 almaspws(self, _chavg, _fdm, _sqld, _tdm, _wvr, _complement) -> std::vector< long > 

118 

119 

120 

121 Summary: 

122 Get a list of spectral window IDs with ALMA-specific attributes. 

123 

124 Description: 

125 

126 

127 Get spectral window IDs based on ALMA-specific criteria. The inputs are or'ed together 

128 to form the returned list. If complement=True, then the complement of the selection 

129 is returned. 

130 

131 If the SPECTRAL_WINDOW table has the optional BBC_NO column and if the name 

132 of the spectral window matches the regular expression 'BB_[0-9]#SQLD', where 

133 [0-9] indicates that a single integer matches, the window is classified as 

134 a *square law detector spectral window*. 

135 

136 The following algorithm is used to identify WVR spwectral windows: 

137 

138 1. check for water vapor radiometer (WVR) spectral windows using the spectral window 

139 name 'WVR#NOMINAL' and report these. 

140 2. If no SPWs match that string, then the names are checked for 'WVR' and are reported instead. 

141 

142 If the window is not found to be a WVR window, it is then checked if 

143 

144 The window is classified as a *channel average spectral window* if it is not 

145 a WVR window, if the number of channels is one, and the spectral window name 

146 does not contain the string 'FULL_RES' 

147 

148 The window is classified as an *FDM window* if it is neither a WVR window nor 

149 a channel average window and if either 

150 

151 1. its bandwidth is less than 2 GHz, or 

152 2. the number of channels it contains is greater than or equal to 15 but not 

153 equal to 256, 128, 64, 32, 16, 248, 124, 62, or 31. 

154 

155 The window is classified as a *TDM spectral window* if it is neither a WVR window, 

156 a channel average window, nor an FDM window. 

157 

158 

159 

160 Input Parameters: 

161 chavg Get channel average spectral windows? 

162 fdm Get FDM spectral windows? 

163 sqld Get square law (i.e. total power) detector spectral windows? 

164 tdm Get TDM spectral windows? 

165 wvr Get WVR spectral windows? 

166 complement Return the complement of the selected set? 

167 

168 Example: 

169 

170 msmd.open('my.ms') 

171 # get all square law detector spectral window IDs 

172 msmd.almaspws(sqld=True) 

173 # get all spectral window IDs other than those associated with square law detectors 

174 msmd.almaspws(sqld=True, complement=True) 

175 

176 -------------------------------------------------------------------------------- 

177 

178 """ 

179 return _msmetadata.msmetadata_almaspws(self, *args, **kwargs) 

180 

181 

182 def antennadiameter(self, *args, **kwargs): 

183 """ 

184 antennadiameter(self, _antenna) -> record * 

185 

186 

187 

188 Summary: 

189 Get the diameter for the specified antenna. 

190 

191 Description: 

192 

193 

194 Get the diameter for the specified antenna. The antenna can be specified either by 

195 its zero-based ID from the ANTENNA table or by its name in that table. The returned 

196 dictionary is a valid quantity. If a negative integer is provided for the antenna, then 

197 all atenna diameters will be returned in a dictionary that has keys that are the antenna IDs 

198 and values that are dictionaries, each being a valid quantity representing the diameter for 

199 that antenna ID. 

200 

201 

202 Input Parameters: 

203 antenna Zero-based antenna in the ANTENNA table, or antenna name. A negative integer will cause all antenna diameters to be returned. 

204 

205 Example: 

206 

207 msmd.open('my.ms') 

208 # Get the diameter of the antenna named 'VB2' 

209 diameter = msmd.antennadiameter('VB2') 

210 msmd.done() 

211 

212 -------------------------------------------------------------------------------- 

213 

214 """ 

215 return _msmetadata.msmetadata_antennadiameter(self, *args, **kwargs) 

216 

217 

218 def antennaids(self, *args, **kwargs): 

219 """ 

220 antennaids(self, _name, _mindiameter, _maxdiameter, _obsid) -> std::vector< long > 

221 

222 

223 

224 Summary: 

225 Get the zero-based antenna ID for the specfied antenna name. 

226 

227 Description: 

228 

229 

230 Get the zero-based antenna IDs for the specfied antenna names and the specified diameter 

231 range for the specified observation ID. An array of unique IDs in order of the specified names is returned. 

232 Note that if a specified name is listed mulitple times in the ANTENNA table, the largest 

233 ID is returned, unless the observation ID is specified to be non-negative, in which case, the 

234 returned IDs are filtered based on the specified observation ID. 

235 If no names and no diameter range is specified, all IDs are returned. 

236 

237 

238 Input Parameters: 

239 name Antenna names (string or string array) for which to get the corresponding IDs. Note that * matches any number of characters of all character classes. 

240 mindiameter Minimum antenna diameter, expressed as a quantity. 

241 maxdiameter Maximum antenna diameter, expressed as a quantity. 

242 obsid Observation ID. If negative, all observation IDs are considered. 

243 

244 Example: 

245 

246 msmd.open('my.ms') 

247 # get the zero-based antenna IDs for the antenna named 'VB2' 

248 antenna_id = msmd.antennaids('VB2')[0] 

249 # get the zero-based antenna IDs for all antennas with diameters between 9m and 11m 

250 antenna_ids = msmd.antennaids(mindiameter='9m', maxdiameter=qa.quantity('11m')) 

251 msmd.done() 

252 

253 -------------------------------------------------------------------------------- 

254 

255 """ 

256 return _msmetadata.msmetadata_antennaids(self, *args, **kwargs) 

257 

258 

259 def antennanames(self, *args, **kwargs): 

260 """ 

261 antennanames(self, _antennaids) -> std::vector< std::string > 

262 

263 

264 

265 Summary: 

266 Get the names of the antennas for the specfied zero-based antenna IDs. 

267 

268 Description: 

269 

270 

271 Get the name of the antenna for the specfied zero-based antenna ID. If antennaids is not specified, 

272 all antenna names are returned. 

273 

274 

275 Input Parameters: 

276 antennaids Zero-based antenna IDs (int or int array) for which to get the antenna names. 

277 

278 Example: 

279 

280 msmd.open('my.ms') 

281 # get the name associated with antenna ID 31 

282 antenna_name = msmd.antennanames(31)[0] 

283 msmd.done() 

284 

285 -------------------------------------------------------------------------------- 

286 

287 """ 

288 return _msmetadata.msmetadata_antennanames(self, *args, **kwargs) 

289 

290 

291 def antennaoffset(self, *args, **kwargs): 

292 """ 

293 antennaoffset(self, _which) -> record * 

294 

295 

296 

297 Summary: 

298 Get the offset position of the specified antenna relative to the array reference position. 

299 

300 Description: 

301 

302 

303 Get the offset position of the specified antenna relative to the array reference position. Antenna may 

304 be specified as a zero-based integer (row number in the ANTENNA table) or a string representing a valid 

305 antenna name. The returned 

306 record contains the longitude, latitude, and elevation offsets as quantity records. The reported longitude and 

307 latitude offsets are measured along the surface of a sphere whose center is coincident with the center of 

308 the earth and whose surface contains the observatory reference position. 

309 

310 

311 Input Parameters: 

312 which Zero-based antenna in the ANTENNA table, or antenna name. 

313 

314 Example: 

315 

316 msmd.open('my.ms') 

317 # get the offset of the (zero-based) 3rd antenna in the ANTENNA table 

318 antennna_offset = msmd.antennaoffset(3) 

319 # get the offset of antenna DV02 

320 antennna_offset = msmd.antennaoffset('DV02') 

321 msmd.done() 

322 

323 -------------------------------------------------------------------------------- 

324 

325 """ 

326 return _msmetadata.msmetadata_antennaoffset(self, *args, **kwargs) 

327 

328 

329 def antennaposition(self, *args, **kwargs): 

330 """ 

331 antennaposition(self, _which) -> record * 

332 

333 

334 

335 Summary: 

336 Get the position of the specified antenna. 

337 

338 Description: 

339 

340 

341 Get the position of the specified antenna. The returned record represents a position measure, 

342 and can be used as such by the measures (me) tool. 

343 

344 

345 Input Parameters: 

346 which Zero-based antenna ID in the ANTENNA table or antenna name. 

347 

348 Example: 

349 

350 msmd.open('my.ms') 

351 # get the position of the (zero-based) 3rd antenna in the ANTENNA table 

352 antennna_position = msmd.antennaposition(3) 

353 # get the position of the antenna named DV07 

354 antennna_position = msmd.antennaposition('DV07') 

355 msmd.done() 

356 

357 -------------------------------------------------------------------------------- 

358 

359 """ 

360 return _msmetadata.msmetadata_antennaposition(self, *args, **kwargs) 

361 

362 

363 def antennastations(self, *args, **kwargs): 

364 """ 

365 antennastations(self, _which, _obsid) -> std::vector< std::string > 

366 

367 

368 

369 Summary: 

370 Get the station names of the specified antennas. 

371 

372 Description: 

373 

374 

375 Get the station names of the specified antennas. If a specified antenna name is listed multiple 

376 times in the ANTENNA table, obsid is negative, and which is specified as an array of names, then 

377 the station associated with the largest ID for that antenna is returned. If obsid is nonnegative, 

378 returned stations are filtered based on that. If which is specified as a string (antenna name), 

379 then all the stations associated with that antenna are returned. 

380 

381 

382 Input Parameters: 

383 which Zero-based antenna ID(s) in the ANTENNA table or antenna name(s). Single numeric id less than zero retrieves all station names. 

384 obsid Observation ID. If negative, all observation IDs are considered. 

385 

386 Example: 

387 

388 msmd.open('my.ms') 

389 # get all station names 

390 stations = msmd.antennastations(-1) 

391 # get the stations of the antennas named DV07 and DV01 

392 stations = msmd.antennaposition(['DV07', 'DV01']) 

393 msmd.done() 

394 

395 -------------------------------------------------------------------------------- 

396 

397 """ 

398 return _msmetadata.msmetadata_antennastations(self, *args, **kwargs) 

399 

400 

401 def antennasforscan(self, *args, **kwargs): 

402 """ 

403 antennasforscan(self, _scan, _obsid, _arrayid) -> std::vector< long > 

404 

405 

406 

407 Summary: 

408 Get an array of the unique antenna IDs for the specified scan, obsservation ID, and array ID. 

409 

410 Description: 

411 

412 

413 Get an array of the unique antennaIDs for the specified scan, observation ID, and array ID. 

414 

415 

416 Input Parameters: 

417 scan Scan number for which to return the intents. 

418 obsid Observation ID. If less than 0, all observation IDs are used. 

419 arrayid Array ID. If less than 0, all array IDs are used. 

420 

421 Example: 

422 

423 msmd.open('my.ms') 

424 # get the antennas associated with scan 4 (all observation IDs, all array IDs) 

425 antennas = msmd.antennasforscan(4) 

426 msmd.done() 

427 

428 -------------------------------------------------------------------------------- 

429 

430 """ 

431 return _msmetadata.msmetadata_antennasforscan(self, *args, **kwargs) 

432 

433 

434 def bandwidths(self, *args, **kwargs): 

435 """ 

436 bandwidths(self, _spw) -> variant * 

437 

438 

439 

440 Summary: 

441 Get the bandwidths in Hz for the specified spectral windows. If spw less than zero, return bandwidths for all spectral windows. 

442 

443 Description: 

444 

445 

446 Get the bandwidths in Hz for the specified spectral windows. If spw less than zero, return bandwidths for all spectral windows. 

447 

448 

449 Input Parameters: 

450 spw Spectral window IDs, if integer less than zero, return bandwidths for all spectral windows. 

451 

452 Example: 

453 

454 msmd.open('my.ms') 

455 # get bandwdith for spectral window 2. 

456 baseband = msmd.bandwidth(2) 

457 msmd.done() 

458 

459 -------------------------------------------------------------------------------- 

460 

461 """ 

462 return _msmetadata.msmetadata_bandwidths(self, *args, **kwargs) 

463 

464 

465 def baseband(self, *args, **kwargs): 

466 """ 

467 baseband(self, _spw) -> long 

468 

469 

470 

471 Summary: 

472 Get the baseband for the specified spectral window. 

473 

474 Description: 

475 

476 

477 Get the baseband for the specified spectral window. 

478 

479 

480 Input Parameters: 

481 spw Spectral window ID. 

482 

483 Example: 

484 

485 msmd.open('my.ms') 

486 # get baseband for spectral window 2. 

487 baseband = msmd.baseband(2) 

488 msmd.done() 

489 

490 -------------------------------------------------------------------------------- 

491 

492 """ 

493 return _msmetadata.msmetadata_baseband(self, *args, **kwargs) 

494 

495 

496 def baselines(self): 

497 """ 

498 baselines(self) -> variant * 

499 

500 

501 

502 Summary: 

503 Get a two dimensional boolean array representing baselines for data recorded in the MS. 

504 

505 Description: 

506 

507 

508 Get a two dimensional boolean array representing baselines for data recorded in the MS. A value of True means 

509 there is at least one row in the MS main table for that baseline, False means no rows for that baseline. Autocorrelation 

510 'baseline' information is also present via the values along the diagonal. 

511 

512 

513 Example: 

514 

515 msmd.open('my.ms') 

516 # get the baseline matrix for this data set 

517 baselines = msmd.baselines() 

518 msmd.done() 

519 

520 -------------------------------------------------------------------------------- 

521 

522 """ 

523 return _msmetadata.msmetadata_baselines(self) 

524 

525 

526 def chanavgspws(self): 

527 """ 

528 chanavgspws(self) -> std::vector< long > 

529 

530 

531 

532 Summary: 

533 Get an array of spectral window IDs used for channel averages. These are windows that do have 1 channel. 

534 

535 Description: 

536 

537 

538 

539 Get an array of spectral window IDs used for channel averages. These are windows that do have 1 channel. 

540 

541 

542 Example: 

543 

544 msmd.open('my.ms') 

545 # get the spectral window IDs used for channel averages. 

546 chan_avg_spws = msmd.chanavgspws() 

547 msmd.done() 

548 

549 -------------------------------------------------------------------------------- 

550 

551 """ 

552 return _msmetadata.msmetadata_chanavgspws(self) 

553 

554 

555 def chaneffbws(self, *args, **kwargs): 

556 """ 

557 chaneffbws(self, _spw, _unit, _asvel) -> std::vector< double > 

558 

559 

560 

561 Summary: 

562 Get an array of channel effective bandwidths for the specified spectral window. 

563 

564 Description: 

565 

566 

567 Get an array of channel effective bandwidths for the specified spectral window. The parameter 

568 asvel indicates if velocity widths (True) or frequency widths (False) should be returned. 

569 The unit parameter specifies the units that the returned values should have. If empty (default), 

570 'Hz' will be used if asvel=False, or 'km/s' will be used if asvel=True. 

571 

572 

573 Input Parameters: 

574 spw Spectral window ID. 

575 unit Desired unit of returned quantities. Empty means 'Hz' if asvel=False, 'km/s' if asvel=True. 

576 asvel Should return values be equivalent velocity widths? 

577 

578 Example: 

579 

580 msmd.open('my.ms') 

581 # get the channel effective bandwidths for spectral window 2, in m/s 

582 chan_ebw = msmd.chaneffbws(2, 'm/s', True) 

583 msmd.done() 

584 

585 -------------------------------------------------------------------------------- 

586 

587 """ 

588 return _msmetadata.msmetadata_chaneffbws(self, *args, **kwargs) 

589 

590 

591 def chanfreqs(self, *args, **kwargs): 

592 """ 

593 chanfreqs(self, _spw, _unit) -> std::vector< double > 

594 

595 

596 

597 Summary: 

598 Get an array of channel frequencies for the specified spectral window. 

599 

600 Description: 

601 

602 

603 Get an array of channel frequencies for the specified spectral window. 

604 

605 

606 Input Parameters: 

607 spw Spectral window ID. 

608 unit Convert frequencies to this unit. 

609 

610 Example: 

611 

612 msmd.open('my.ms') 

613 # get the channel frequencies for spectral window 2. 

614 chan_freqs = msmd.chanfreqs(2) 

615 msmd.done() 

616 

617 -------------------------------------------------------------------------------- 

618 

619 """ 

620 return _msmetadata.msmetadata_chanfreqs(self, *args, **kwargs) 

621 

622 

623 def chanres(self, *args, **kwargs): 

624 """ 

625 chanres(self, _spw, _unit, _asvel) -> std::vector< double > 

626 

627 

628 

629 Summary: 

630 Get an array of channel resolutions for the specified spectral window. 

631 

632 Description: 

633 

634 

635 Get an array of channel resolutions for the specified spectral window. The parameter 

636 asvel indicates if velocity widths (True) or frequency widths (False) should be returned. 

637 The unit parameter specifies the units that the returned values should have. If empty (default), 

638 'Hz' will be used if asvel=False, or 'km/s' will be used if asvel=True. 

639 

640 

641 Input Parameters: 

642 spw Spectral window ID. 

643 unit Desired unit of returned quantities. Empty means 'Hz' if asvel=False, 'km/s' if asvel=True. 

644 asvel Should return values be equivalent velocity resolutions? 

645 

646 Example: 

647 

648 msmd.open('my.ms') 

649 # get the channel resolutions for spectral window 2, in m/s 

650 chan_res = msmd.chanres(2, 'm/s', True) 

651 msmd.done() 

652 

653 -------------------------------------------------------------------------------- 

654 

655 """ 

656 return _msmetadata.msmetadata_chanres(self, *args, **kwargs) 

657 

658 

659 def chanwidths(self, *args, **kwargs): 

660 """ 

661 chanwidths(self, _spw, _unit) -> std::vector< double > 

662 

663 

664 

665 Summary: 

666 Get an array of channel widths for the specified spectral window. 

667 

668 Description: 

669 

670 

671 Get an array of channel widths for the specified spectral window. 

672 

673 

674 Input Parameters: 

675 spw Spectral window ID. 

676 unit Convert frequencies to this unit. 

677 

678 Example: 

679 

680 msmd.open('my.ms') 

681 # get the channel widths for spectral window 2. 

682 chan_freqs = msmd.chanwidths(2) 

683 msmd.done() 

684 

685 -------------------------------------------------------------------------------- 

686 

687 """ 

688 return _msmetadata.msmetadata_chanwidths(self, *args, **kwargs) 

689 

690 

691 def close(self): 

692 """ 

693 close(self) -> bool 

694 

695 

696 

697 Summary: 

698 Close this tool and reclaim system resources associated with it. 

699 

700 Description: 

701 

702 

703 This method will close the tool and reclaim system resources it has been using. Returns true if successful. 

704 

705 

706 Example: 

707 

708 msmd.open('my.ms') 

709 # do things with tool 

710 # finish, close tool and free up resources. 

711 msmd.close() 

712 

713 -------------------------------------------------------------------------------- 

714 

715 """ 

716 return _msmetadata.msmetadata_close(self) 

717 

718 

719 def corrbit(self, *args, **kwargs): 

720 """ 

721 corrbit(self, _spw) -> variant * 

722 

723 

724 

725 Summary: 

726 Get the value of the SPECTRAL_WINDOW::SDM_CORR_BIT column for the specified spw. 

727 

728 Description: 

729 

730 

731 Get the value of SPECTRAL_WINDOW::SDM_CORR_BIT column for the specified spw. 

732 If spw >= 0 is specified, a string value is returned. If spw <0, a list 

733 of string values with length equal to the number of spectral windows is returned. 

734 If the SPECTRAL_WINDOW::SDM_CORR_BIT column does not exist, either 

735 'UNKNOWN' is returned if spw>=0, or a list with nspw entries of 

736 'UNKNOWN' is returned if spw<0. A list of integers may also be 

737 supplied for the spw parameter. In this case, all integers should be in the 

738 range [0, spw-1] or an exception will be thrown. The return value will 

739 be a list containing the corresponding CORR_BIT values in the order 

740 of the spws specified. 

741 

742 

743 Input Parameters: 

744 spw Spectral window ID(s). May be an integer or list of integers. If integer, <0 implies all. 

745 

746 Example: 

747 

748 msmd.open('my.ms') 

749 # get value of SPECTRAL_WINDOW::SDM_CORR_BIT column for spw=2. 

750 cb = msmd.corrbit(spw=2) 

751 msmd.done() 

752 

753 -------------------------------------------------------------------------------- 

754 

755 """ 

756 return _msmetadata.msmetadata_corrbit(self, *args, **kwargs) 

757 

758 

759 def corrprodsforpol(self, *args, **kwargs): 

760 """ 

761 corrprodsforpol(self, _pol) -> variant * 

762 

763 

764 

765 Summary: 

766 Get the correlation products associated with the specified polarization ID 

767 

768 Description: 

769 

770 

771 Get the correlation products associated with the specified polarization ID. 

772 

773 

774 Input Parameters: 

775 pol Polarization ID. Must be nonnegative. 

776 

777 Example: 

778 

779 msmd.open('my.ms') 

780 # get correlation products for polarization ID 3 

781 corrprods = msmd.corrprodsforpol(3) 

782 msmd.done() 

783 

784 -------------------------------------------------------------------------------- 

785 

786 """ 

787 return _msmetadata.msmetadata_corrprodsforpol(self, *args, **kwargs) 

788 

789 

790 def corrtypesforpol(self, *args, **kwargs): 

791 """ 

792 corrtypesforpol(self, _pol) -> std::vector< long > 

793 

794 

795 

796 Summary: 

797 Get the correlation types associated with the specified polarization ID 

798 

799 Description: 

800 

801 

802 Get the correlation types associated with the specified polarization ID. 

803 

804 

805 Input Parameters: 

806 pol Polarization ID. Must be nonnegative. 

807 

808 Example: 

809 

810 msmd.open('my.ms') 

811 # get correlation types for polarization ID 3 

812 corrtypes = msmd.corrtypesforpol(3) 

813 msmd.done() 

814 

815 -------------------------------------------------------------------------------- 

816 

817 """ 

818 return _msmetadata.msmetadata_corrtypesforpol(self, *args, **kwargs) 

819 

820 

821 def datadescids(self, *args, **kwargs): 

822 """ 

823 datadescids(self, _spw, _pol) -> std::vector< long > 

824 

825 

826 

827 Summary: 

828 Get the data description IDs associated with the specified spectral window and/or polarization ID 

829 

830 Description: 

831 

832 

833 Get a list of data description IDs associated with the specified spectral window ID 

834 and/or polarization ID. Values of less than zero for either means all IDs should be used 

835 in the selection. 

836 

837 

838 Input Parameters: 

839 spw Spectral window ID. Less than zero implies any, 

840 pol Polarization ID. Less than zero implies any. 

841 

842 Example: 

843 

844 msmd.open('my.ms') 

845 # get all data description IDs associated with spw 2. 

846 msmd.datadescids(spw=2) 

847 # same as before but limit the IDs returned to those associated with 

848 # polarization ID 3 

849 msmd.datadescids(spw=2, pol=3) 

850 msmd.done() 

851 

852 -------------------------------------------------------------------------------- 

853 

854 """ 

855 return _msmetadata.msmetadata_datadescids(self, *args, **kwargs) 

856 

857 

858 def done(self): 

859 """ 

860 done(self) -> bool 

861 

862 

863 

864 Summary: 

865 Close this tool and reclaim system resources associated with it. 

866 

867 Description: 

868 

869 

870 This method will close the tool and reclaim system resources it has been using. Returns true if successful. 

871 

872 

873 Example: 

874 

875 msmd.open('my.ms') 

876 # do things with tool 

877 # finish, close tool and free up resources. 

878 msmd.done() 

879 

880 -------------------------------------------------------------------------------- 

881 

882 """ 

883 return _msmetadata.msmetadata_done(self) 

884 

885 

886 def effexposuretime(self): 

887 """ 

888 effexposuretime(self) -> record * 

889 

890 

891 

892 Summary: 

893 Get the effective exposure (on-source integration time) 

894 

895 Description: 

896 

897 

898 Get the effective exposure time (equivalent to what might be more commonly known as total integration 

899 time or total sample time) is calculated by summing over all rows in the main MS table, excluding 

900 autocorrelations or rows where FLAG_ROW is false, thusly: 

901 

902 sum[over i] (exposure[i]*sum[over j](UFBW[i, j])/ncorrelations[i] )/ nmaxbaselines 

903 

904 where exposure[i] is the value of EXPOSURE for the ith row, the inner sum is performed over each correlation 

905 for that row, UFBW is the unflagged fractional bandwidth is determined by summing all the widths of the 

906 unflagged channels for that correlation and dividing by the total bandwidth of all spectral windows observed 

907 at the timestamp of row i, ncorrelations is the number of correlations determined by the number of rows in 

908 the FLAG matrix for MS row i, and nmaxbaselines is the maximum number of antenna pairs, 

909 nantennas*(nantennas-1)/2, where nantennas is the number of antennas in the ANTENNA table. This method returns 

910 a quantity (a dictionary having a numerical value and a string unit). 

911 

912 

913 Example: 

914 

915 msmd.open('my.ms') 

916 # get the effective exposure time. 

917 exposure_time = msmd.effexposuretime() 

918 msmd.done() 

919 

920 -------------------------------------------------------------------------------- 

921 

922 """ 

923 return _msmetadata.msmetadata_effexposuretime(self) 

924 

925 

926 def exposuretime(self, *args, **kwargs): 

927 """ 

928 exposuretime(self, _scan, _spwid, _polid, _obsid, _arrayid) -> record * 

929 

930 

931 

932 Summary: 

933 Get the exposure time for the specified scan, spwid, polarization ID, array ID, and observation ID. 

934 

935 Description: 

936 

937 

938 Get the exposure time for the specified scan, spwid, polarization ID, array ID, and observation ID. 

939 This is the exposure time of the record with the lowest time stamp of the records associated with 

940 these parameters. Returns a quantity dictionary. If polid is not specified (or specified and negative) 

941 and there is only one polarization ID in for the specified combination of scan, spwid, obsID, and 

942 arrayID, then that polarization ID is used. If there are multiple polarization IDs for the 

943 combination of other parameters, a list of these is logged and an empty dictionary is returned. 

944 

945 

946 Input Parameters: 

947 scan Scan number. 

948 spwid Spectral window ID. 

949 polid Polarization ID. 

950 obsid Observation ID. 

951 arrayid Array ID. 

952 

953 Example: 

954 

955 msmd.open('my.ms') 

956 # get the exposure time for scan 1, spwid 2, and polid 3 

957 # for obsid=0 and arrayid=0 

958 integration_time = msmd.exposuretime(scan=1, spwid=2, polid=3) 

959 msmd.done() 

960 

961 -------------------------------------------------------------------------------- 

962 

963 """ 

964 return _msmetadata.msmetadata_exposuretime(self, *args, **kwargs) 

965 

966 

967 def fdmspws(self): 

968 """ 

969 fdmspws(self) -> std::vector< long > 

970 

971 

972 

973 Summary: 

974 Get an array of spectral window IDs used for FDM. These are windows that do not have 64, 128, or 256 channels. 

975 

976 Description: 

977 

978 

979 

980 Get an array of spectral window IDs used for FDM. These are windows that do not have 64, 128, or 256 channels. 

981 

982 

983 Example: 

984 

985 msmd.open('my.ms') 

986 # get the spectral window IDs used for FDM. 

987 fdm_spws = msmd.fdmspws() 

988 msmd.done() 

989 

990 -------------------------------------------------------------------------------- 

991 

992 """ 

993 return _msmetadata.msmetadata_fdmspws(self) 

994 

995 

996 def fieldnames(self): 

997 """ 

998 fieldnames(self) -> std::vector< std::string > 

999 

1000 

1001 

1002 Summary: 

1003 Get an array of field names as they appear in the FIELD table. 

1004 

1005 Description: 

1006 

1007 

1008 Get an array of field names as they appear in the FIELD table. 

1009 

1010 

1011 Example: 

1012 

1013 msmd.open('my.ms') 

1014 # get list of field names in the ms 

1015 fieldnames = msmd.fieldnames() 

1016 msmd.done() 

1017 

1018 -------------------------------------------------------------------------------- 

1019 

1020 """ 

1021 return _msmetadata.msmetadata_fieldnames(self) 

1022 

1023 

1024 def fieldsforintent(self, *args, **kwargs): 

1025 """ 

1026 fieldsforintent(self, _intent, _asnames) -> variant * 

1027 

1028 

1029 

1030 Summary: 

1031 Get an array of the unique fields for the specified intent. 

1032 

1033 Description: 

1034 

1035 

1036 Get an array of the unique fields for the specified intent. Note that * matches any number of characters of all character classes. 

1037 

1038 

1039 Input Parameters: 

1040 intent Intent (case sensitive) for which to return the fields. 

1041 asnames If true, return the field names. If false, return the zero-based field IDs. 

1042 

1043 Example: 

1044 

1045 msmd.open('my.ms') 

1046 # get the field names for intent 'observe target' 

1047 field_names = msmd.fieldsforintent('observe target', True, regex=False) 

1048 # get the field IDs for intent 'observe target' 

1049 field_IDs = msmd.fieldsforintent('observe target', False, regex=False) 

1050 # get all field IDs for all intents which contain 'WVR' 

1051 field_IDs = msmd.fieldsforIntent('*WVR*') 

1052 msmd.done() 

1053 

1054 -------------------------------------------------------------------------------- 

1055 

1056 """ 

1057 return _msmetadata.msmetadata_fieldsforintent(self, *args, **kwargs) 

1058 

1059 

1060 def fieldsforname(self, *args, **kwargs): 

1061 """ 

1062 fieldsforname(self, _name) -> std::vector< long > 

1063 

1064 

1065 

1066 Summary: 

1067 Get an array of the unique, zero-based field IDs for the specified field name. 

1068 

1069 Description: 

1070 

1071 

1072 Get an array of the unique, zero-based field IDs for the specified field name. If the field name is the 

1073 empty string (the default), a list of all unique field IDs in the main table of the MS will be returned. 

1074 

1075 

1076 Input Parameters: 

1077 name Field name (case sensitive) for which to return the fields. 

1078 

1079 Example: 

1080 

1081 msmd.open('my.ms') 

1082 # get the field IDs for field name 'Enceladus' 

1083 fields = msmd.fieldsforname('Enceladus') 

1084 msmd.done() 

1085 

1086 -------------------------------------------------------------------------------- 

1087 

1088 """ 

1089 return _msmetadata.msmetadata_fieldsforname(self, *args, **kwargs) 

1090 

1091 

1092 def fieldsforscan(self, *args, **kwargs): 

1093 """ 

1094 fieldsforscan(self, _scan, _asnames, _obsid, _arrayid) -> variant * 

1095 

1096 

1097 

1098 Summary: 

1099 Get an array of the unique fields for the specified scan number, observation ID, and array ID. 

1100 

1101 Description: 

1102 

1103 

1104 Get an array of the unique fields for the specified scan number, observation ID, and array ID. 

1105 

1106 

1107 Input Parameters: 

1108 scan Scan number for which to return the fields. 

1109 asnames If true, return the field names. If false, return the zero-based field IDs. 

1110 obsid Observation ID. A negative value means use all observation IDs. 

1111 arrayid Array ID. A negative value means use all array IDs. 

1112 

1113 Example: 

1114 

1115 msmd.open('my.ms') 

1116 # get the field names for scan number 5 (for all array IDs and all observation IDs). 

1117 field_names = msmd.fieldsforscan(5, True) 

1118 # get the field IDs for scan number 5 (for all array IDs and all observation IDs) 

1119 field_IDs = msmd.fieldsforscan(5, False) 

1120 msmd.done() 

1121 

1122 -------------------------------------------------------------------------------- 

1123 

1124 """ 

1125 return _msmetadata.msmetadata_fieldsforscan(self, *args, **kwargs) 

1126 

1127 

1128 def fieldsforscans(self, *args, **kwargs): 

1129 """ 

1130 fieldsforscans(self, _scans, _asnames, _obsid, _arrayid, _asmap) -> variant * 

1131 

1132 

1133 

1134 Summary: 

1135 Get an array or dictionary of the unique fields for the specified scan numbers, observationID, and array ID. 

1136 

1137 Description: 

1138 

1139 

1140 Get an array or dictionary of the unique fields for the specified scan numbers, observation ID, and array ID. 

1141 If asnames=True, the values returned will be the field names, if False, they will be field IDs. 

1142 If asmap=True, the structure returned will be a dictionary which maps scan number (as a string) to fields. 

1143 In this case, both obsid and arrayid must be nonnegative. If asmap=False, a single array of fields is returned 

1144 that matches the query. In this case, if obsid and/or arrayid are negative, then it indicates that all 

1145 fields matching any obsid and/or arrayid should be returned. An empty array specified for scans means 

1146 that all scans for the selected obsid and arrayid should be included. 

1147 

1148 

1149 Input Parameters: 

1150 scans Scan numbers for which to return the fields. 

1151 asnames If true, return the field names. If false, return the zero-based field IDs. 

1152 obsid Observation ID. A negative value means use all observation IDs. 

1153 arrayid Array ID. A negative value means use all array IDs. 

1154 asmap Return a dictionary mapping scan numbers to fields? 

1155 

1156 Example: 

1157 

1158 msmd.open('my.ms') 

1159 # get the field names for scan numbers 5 and 10 (all obsids, all arrayids) 

1160 field_names = msmd.fieldsforscan([5, 10], True) 

1161 # get the field IDs for scan numbers 5 and 10 (all obsids, all arrayids) 

1162 field_IDs = msmd.fieldsforscan([5, 10], False) 

1163 # get mapping of scans to fields for arrayid=2 and obsid=4 

1164 scans_to_fields = msmd.fieldsforscan(obsid=4, arrayid=2, asmap=True) 

1165 msmd.done() 

1166 

1167 -------------------------------------------------------------------------------- 

1168 

1169 """ 

1170 return _msmetadata.msmetadata_fieldsforscans(self, *args, **kwargs) 

1171 

1172 

1173 def fieldsforsource(self, *args, **kwargs): 

1174 """ 

1175 fieldsforsource(self, _source, _asnames) -> variant * 

1176 

1177 

1178 

1179 Summary: 

1180 Get an array of the unique fields for the specified source ID. 

1181 

1182 Description: 

1183 

1184 

1185 Get an array of the unique fields for the specified source. 

1186 

1187 

1188 Input Parameters: 

1189 source Zero-based source ID for which to return the fields. 

1190 asnames If true, return the field names. If false, return the zero-based field IDs. 

1191 

1192 Example: 

1193 

1194 msmd.open('my.ms') 

1195 # get the field names for source ID 1 

1196 field_names = msmd.fieldsforsource(1, True) 

1197 # get the field IDs for source ID 1 

1198 field_IDs = msmd.fieldsforsource(1, False) 

1199 msmd.done() 

1200 

1201 -------------------------------------------------------------------------------- 

1202 

1203 """ 

1204 return _msmetadata.msmetadata_fieldsforsource(self, *args, **kwargs) 

1205 

1206 

1207 def fieldsforsources(self, *args, **kwargs): 

1208 """ 

1209 fieldsforsources(self, _asnames) -> record * 

1210 

1211 

1212 

1213 Summary: 

1214 Get a map of source IDs to fields. 

1215 

1216 Description: 

1217 

1218 

1219 Get a map of source IDs to fields. The keys (source IDs) will be strings. 

1220 

1221 

1222 Input Parameters: 

1223 asnames If true, return the field names. If false, return the zero-based field IDs. 

1224 

1225 Example: 

1226 

1227 msmd.open('my.ms') 

1228 # get the source to field name map 

1229 sources_to_fields = msmd.fieldsforsources(True) 

1230 # access the field names for source 1 

1231 field = sources_to_fields['1'] 

1232 msmd.done() 

1233 

1234 -------------------------------------------------------------------------------- 

1235 

1236 """ 

1237 return _msmetadata.msmetadata_fieldsforsources(self, *args, **kwargs) 

1238 

1239 

1240 def fieldsforspw(self, *args, **kwargs): 

1241 """ 

1242 fieldsforspw(self, _spw, _asnames) -> variant * 

1243 

1244 

1245 

1246 Summary: 

1247 Get an array of the unique fields for the specified spectral window. 

1248 

1249 Description: 

1250 

1251 

1252 Get an array of the unique fields for the specified spectral window. 

1253 

1254 

1255 Input Parameters: 

1256 spw Zero-based spectral window ID for which to return the fields. 

1257 asnames If true, return the field names. If false, return the zero-based field IDs. 

1258 

1259 Example: 

1260 

1261 msmd.open('my.ms') 

1262 # get the field names for spectral window 1 

1263 field_names = msmd.fieldsforspw(1, True) 

1264 # get the field IDs for spectral window 1 

1265 field_IDs = msmd.fieldsforspw(1, False) 

1266 msmd.done() 

1267 

1268 -------------------------------------------------------------------------------- 

1269 

1270 """ 

1271 return _msmetadata.msmetadata_fieldsforspw(self, *args, **kwargs) 

1272 

1273 

1274 def fieldsfortimes(self, *args, **kwargs): 

1275 """ 

1276 fieldsfortimes(self, _time, _tol) -> std::vector< long > 

1277 

1278 

1279 

1280 Summary: 

1281 Get an array of the unique, zero-based, field IDs for the specified time range (time-tol to time+tol). 

1282 

1283 Description: 

1284 

1285 

1286 Get an array of the unique, zero-based, fieldIDs for the specified time range (time-tol to time+tol). 

1287 

1288 

1289 Input Parameters: 

1290 time Time at center of time range. 

1291 tol Time on either side of center for specifying range. 

1292 

1293 Example: 

1294 

1295 msmd.open('my.ms') 

1296 # get the field IDs associated with the specified time range 

1297 fields = msmd.fieldsfortimes(4.8428293714e+09, 20) 

1298 msmd.done() 

1299 

1300 -------------------------------------------------------------------------------- 

1301 

1302 """ 

1303 return _msmetadata.msmetadata_fieldsfortimes(self, *args, **kwargs) 

1304 

1305 

1306 def intents(self): 

1307 """ 

1308 intents(self) -> std::vector< std::string > 

1309 

1310 

1311 

1312 Summary: 

1313 Get an array of the unique intents associated with the MS. 

1314 

1315 Description: 

1316 

1317 

1318 Get an array of the unique intents associated with the MS. 

1319 

1320 

1321 Example: 

1322 

1323 msmd.open('my.ms') 

1324 # get the intents associated with the MS 

1325 intents = msmd.intents() 

1326 msmd.done() 

1327 

1328 -------------------------------------------------------------------------------- 

1329 

1330 """ 

1331 return _msmetadata.msmetadata_intents(self) 

1332 

1333 

1334 def intentsforfield(self, *args, **kwargs): 

1335 """ 

1336 intentsforfield(self, _field) -> std::vector< std::string > 

1337 

1338 

1339 

1340 Summary: 

1341 Get an array of the unique intents for the specified field. 

1342 

1343 Description: 

1344 

1345 

1346 Get an array of the unique intents for the specified field. 

1347 

1348 

1349 Input Parameters: 

1350 field Field ID or name for which to return the intents. 

1351 

1352 Example: 

1353 

1354 msmd.open('my.ms') 

1355 # get the intents associated with field 4 

1356 intents = msmd.intentsforfield(4) 

1357 # get intents for field 'MOS' 

1358 intents2 = msmd.intentsforfield('MOS') 

1359 msmd.done() 

1360 

1361 -------------------------------------------------------------------------------- 

1362 

1363 """ 

1364 return _msmetadata.msmetadata_intentsforfield(self, *args, **kwargs) 

1365 

1366 

1367 def intentsforscan(self, *args, **kwargs): 

1368 """ 

1369 intentsforscan(self, _scan, _obsid, _arrayid) -> std::vector< std::string > 

1370 

1371 

1372 

1373 Summary: 

1374 Get an array of the unique intents for the specified scan, obsservation ID, and array ID. 

1375 

1376 Description: 

1377 

1378 

1379 Get an array of the unique intents for the specified scan, observation ID, and array ID. 

1380 

1381 

1382 Input Parameters: 

1383 scan Scan number for which to return the intents. 

1384 obsid Observation ID. A negative value means use all observation IDs. 

1385 arrayid Array ID. A negative value means use all array IDs. 

1386 

1387 Example: 

1388 

1389 msmd.open('my.ms') 

1390 # get the intents associated with scan 4 (all obsids, all arrayids) 

1391 intents = msmd.intentsforscan(4) 

1392 msmd.done() 

1393 

1394 -------------------------------------------------------------------------------- 

1395 

1396 """ 

1397 return _msmetadata.msmetadata_intentsforscan(self, *args, **kwargs) 

1398 

1399 

1400 def intentsforspw(self, *args, **kwargs): 

1401 """ 

1402 intentsforspw(self, _spw) -> std::vector< std::string > 

1403 

1404 

1405 

1406 Summary: 

1407 Get an array of the unique intents for the specified spectral window ID. 

1408 

1409 Description: 

1410 

1411 

1412 Get an array of the unique intents for the specified spectral window ID. 

1413 

1414 

1415 Input Parameters: 

1416 spw Spectral window ID (>=0) for which to return the intents. 

1417 

1418 Example: 

1419 

1420 msmd.open('my.ms') 

1421 # get the intents associated with spectral window ID 3 

1422 intents = msmd.intentsforspw(3) 

1423 msmd.done() 

1424 

1425 -------------------------------------------------------------------------------- 

1426 

1427 """ 

1428 return _msmetadata.msmetadata_intentsforspw(self, *args, **kwargs) 

1429 

1430 

1431 def meanfreq(self, *args, **kwargs): 

1432 """ 

1433 meanfreq(self, _spw, _unit) -> double 

1434 

1435 

1436 

1437 Summary: 

1438 Get the mean frequency for the specified spectral window. 

1439 

1440 Description: 

1441 

1442 

1443 Get the mean frequency for the specified spectral window. 

1444 

1445 

1446 Input Parameters: 

1447 spw Spectral window ID. 

1448 unit Convert frequencies to this unit. 

1449 

1450 Example: 

1451 

1452 msmd.open('my.ms') 

1453 # get the mean frequency for spectral window 2. 

1454 mean_freq = msmd.meanfreq(2) 

1455 msmd.done() 

1456 

1457 -------------------------------------------------------------------------------- 

1458 

1459 """ 

1460 return _msmetadata.msmetadata_meanfreq(self, *args, **kwargs) 

1461 

1462 

1463 def name(self): 

1464 """ 

1465 name(self) -> string 

1466 

1467 

1468 

1469 Summary: 

1470 Get the name of the attached MS. 

1471 

1472 Description: 

1473 

1474 

1475 Get the name of the attached MS. 

1476 

1477 

1478 Example: 

1479 

1480 msmd.open('my.ms') 

1481 # get its name 

1482 myname = msmd.name() 

1483 msmd.done() 

1484 

1485 -------------------------------------------------------------------------------- 

1486 

1487 """ 

1488 return _msmetadata.msmetadata_name(self) 

1489 

1490 

1491 def namesforfields(self, *args, **kwargs): 

1492 """ 

1493 namesforfields(self, _fieldids) -> std::vector< std::string > 

1494 

1495 

1496 

1497 Summary: 

1498 Get the name of the specified field. 

1499 

1500 Description: 

1501 

1502 

1503 Get the name of the specified field. 

1504 

1505 

1506 Input Parameters: 

1507 fieldids Zero-based field IDs for which to get the names (integer or interger array). Unspecified will return all field names. 

1508 

1509 Example: 

1510 

1511 msmd.open('my.ms') 

1512 # get the name for field 8 and 2. 

1513 field_names = msmd.namesforfields([8, 2]) 

1514 # get all field names 

1515 all_field_nams = namesforfields() 

1516 msmd.done() 

1517 

1518 -------------------------------------------------------------------------------- 

1519 

1520 """ 

1521 return _msmetadata.msmetadata_namesforfields(self, *args, **kwargs) 

1522 

1523 

1524 def namesforspws(self, *args, **kwargs): 

1525 """ 

1526 namesforspws(self, _spwids) -> std::vector< std::string > 

1527 

1528 

1529 

1530 Summary: 

1531 Get the name of the specified spws. 

1532 

1533 Description: 

1534 

1535 

1536 Get the name of the specified spw(s). 

1537 

1538 

1539 Input Parameters: 

1540 spwids Zero-based spw ID(s) for which to get the names (integer or interger array). Unspecified will return all spw names. 

1541 

1542 Example: 

1543 

1544 msmd.open('my.ms') 

1545 # get the name for spws 8 and 2. 

1546 spw_names = msmd.namesforspws([8, 2]) 

1547 # get all spw names 

1548 all_spw_names = msmd.namesforspws() 

1549 msmd.done() 

1550 

1551 -------------------------------------------------------------------------------- 

1552 

1553 """ 

1554 return _msmetadata.msmetadata_namesforspws(self, *args, **kwargs) 

1555 

1556 

1557 def nantennas(self): 

1558 """ 

1559 nantennas(self) -> long 

1560 

1561 

1562 

1563 Summary: 

1564 Get the number of antennas associated with the MS. 

1565 

1566 Description: 

1567 

1568 

1569 Get the number of antennas associated with the MS. 

1570 

1571 

1572 Example: 

1573 

1574 msmd.open('my.ms') 

1575 number_of_antennas = msmd.nantennas() 

1576 msmd.done() 

1577 

1578 -------------------------------------------------------------------------------- 

1579 

1580 """ 

1581 return _msmetadata.msmetadata_nantennas(self) 

1582 

1583 

1584 def narrays(self): 

1585 """ 

1586 narrays(self) -> long 

1587 

1588 

1589 

1590 Summary: 

1591 Get the number of arrays associated with the MS from the ARRAY table. 

1592 

1593 Description: 

1594 

1595 

1596 Get the number of arrays associated with the MS from the ARRAY table. 

1597 

1598 

1599 Example: 

1600 

1601 msmd.open('my.ms') 

1602 number_of_array_ids = msmd.narrays() 

1603 msmd.done() 

1604 

1605 -------------------------------------------------------------------------------- 

1606 

1607 """ 

1608 return _msmetadata.msmetadata_narrays(self) 

1609 

1610 

1611 def nbaselines(self, *args, **kwargs): 

1612 """ 

1613 nbaselines(self, _ac) -> long 

1614 

1615 

1616 

1617 Summary: 

1618 Get the number of baselines represented in the main MS table. 

1619 

1620 Description: 

1621 

1622 

1623 Get the number of unique baselines (antenna pairs) represented in the main MS table. This can, in theory, be less than 

1624 n*(n-1)/2 (n being the number of antennas in the ANTENNA table), if data for certain baselines 

1625 are not included in the main MS table. Autocorrelation 'baselines' are included in this count if ac=True. 

1626 

1627 

1628 Input Parameters: 

1629 ac Include auto-correlation 'baselines'? 

1630 

1631 Example: 

1632 

1633 msmd.open('my.ms') 

1634 number_of_baselines = msmd.nbaselines() 

1635 number_of_baselines_including_ac = msmd.nbaselines(True) 

1636 msmd.done() 

1637 

1638 -------------------------------------------------------------------------------- 

1639 

1640 """ 

1641 return _msmetadata.msmetadata_nbaselines(self, *args, **kwargs) 

1642 

1643 

1644 def nchan(self, *args, **kwargs): 

1645 """ 

1646 nchan(self, _spw) -> long 

1647 

1648 

1649 

1650 Summary: 

1651 Get the number of channels associated with the specified spectral window. 

1652 

1653 Description: 

1654 

1655 

1656 Get the number of channels associated with the specified spectral window. 

1657 

1658 

1659 Input Parameters: 

1660 spw Zero-based spw ID for which to get the number of channels. 

1661 

1662 Example: 

1663 

1664 msmd.open('my.ms') 

1665 nchan = msmd.nchan(3) 

1666 msmd.done() 

1667 

1668 -------------------------------------------------------------------------------- 

1669 

1670 """ 

1671 return _msmetadata.msmetadata_nchan(self, *args, **kwargs) 

1672 

1673 

1674 def ncorrforpol(self, *args, **kwargs): 

1675 """ 

1676 ncorrforpol(self, _polid) -> variant * 

1677 

1678 

1679 

1680 Summary: 

1681 Get the number of correlations for the specified polarization ID. 

1682 

1683 Description: 

1684 

1685 

1686 Get the number of correlations for the specified polarization ID. If the specified polarization ID 

1687 is negative, an array of numbers of correlations is returned. The indices of that array represent polarization IDs. 

1688 

1689 

1690 Input Parameters: 

1691 polid Zero-based polarization ID. A negative number will cause all the numbers of correlations to be returned. 

1692 

1693 Example: 

1694 

1695 msmd.open('my.ms') 

1696 # get the number of correlations associated with polarization ID 4 

1697 polid = msmd.ncorrforpol(4) 

1698 # get the array of numbers of correlations from the POLARIZATION table 

1699 polids = msmd.ncorrforpol(-1) 

1700 msmd.done() 

1701 

1702 -------------------------------------------------------------------------------- 

1703 

1704 """ 

1705 return _msmetadata.msmetadata_ncorrforpol(self, *args, **kwargs) 

1706 

1707 

1708 def nfields(self): 

1709 """ 

1710 nfields(self) -> long 

1711 

1712 

1713 

1714 Summary: 

1715 Get the number of fields associated with the MS. 

1716 

1717 Description: 

1718 

1719 

1720 Get the number of fields associated with the MS. 

1721 

1722 

1723 Example: 

1724 

1725 msmd.open('my.ms') 

1726 number_of_fields = msmd.nfields() 

1727 msmd.done() 

1728 

1729 -------------------------------------------------------------------------------- 

1730 

1731 """ 

1732 return _msmetadata.msmetadata_nfields(self) 

1733 

1734 

1735 def nobservations(self): 

1736 """ 

1737 nobservations(self) -> long 

1738 

1739 

1740 

1741 Summary: 

1742 Get the number of observations associated with the MS from the OBSERVATIONS table. 

1743 

1744 Description: 

1745 

1746 

1747 Get the number of observations associated with the MS from the OBSERVATIONS table. 

1748 

1749 

1750 Example: 

1751 

1752 msmd.open('my.ms') 

1753 number_of_obs_ids = msmd.nobservations() 

1754 msmd.done() 

1755 

1756 -------------------------------------------------------------------------------- 

1757 

1758 """ 

1759 return _msmetadata.msmetadata_nobservations(self) 

1760 

1761 

1762 def nspw(self, *args, **kwargs): 

1763 """ 

1764 nspw(self, _includewvr) -> long 

1765 

1766 

1767 

1768 Summary: 

1769 Get the number of spectral windows associated with the MS. 

1770 

1771 Description: 

1772 

1773 

1774 This method will return the number of spectral windows in the associated MS. 

1775 

1776 

1777 Input Parameters: 

1778 includewvr Include wvr spectral windows? If false, exclude wvr windows from count. 

1779 

1780 Example: 

1781 

1782 msmd.open('my.ms') 

1783 number_of_spectral_windows = msmd.nspw() 

1784 msmd.done() 

1785 

1786 -------------------------------------------------------------------------------- 

1787 

1788 """ 

1789 return _msmetadata.msmetadata_nspw(self, *args, **kwargs) 

1790 

1791 

1792 def nstates(self): 

1793 """ 

1794 nstates(self) -> long 

1795 

1796 

1797 

1798 Summary: 

1799 Get the number of states (from the STATE table) associated with the MS. 

1800 

1801 Description: 

1802 

1803 

1804 This method will return the number of states (number of rows in the STATES table) in the associated MS. 

1805 

1806 

1807 Example: 

1808 

1809 msmd.open('my.ms') 

1810 number_of_states = msmd.nstates() 

1811 msmd.done() 

1812 

1813 -------------------------------------------------------------------------------- 

1814 

1815 """ 

1816 return _msmetadata.msmetadata_nstates(self) 

1817 

1818 

1819 def nscans(self): 

1820 """ 

1821 nscans(self) -> long 

1822 

1823 

1824 

1825 Summary: 

1826 Get the number of scans associated with the MS. 

1827 

1828 Description: 

1829 

1830 

1831 Get the number of scans associated with the MS. 

1832 

1833 

1834 Example: 

1835 

1836 msmd.open('my.ms') 

1837 number_of_scans = msmd.nscans() 

1838 msmd.done() 

1839 

1840 -------------------------------------------------------------------------------- 

1841 

1842 """ 

1843 return _msmetadata.msmetadata_nscans(self) 

1844 

1845 

1846 def nsources(self): 

1847 """ 

1848 nsources(self) -> long 

1849 

1850 

1851 

1852 Summary: 

1853 Get the number of unique values from the SOURCE_ID column in the SOURCE table. 

1854 

1855 Description: 

1856 

1857 

1858 Get the number of unique values from the SOURCE_ID column in the SOURCE table. The number of rows in the 

1859 SOURCE table may be greater than this value. 

1860 

1861 

1862 Example: 

1863 

1864 msmd.open('my.ms') 

1865 number_of_unique_source_ids = msmd.nsources() 

1866 msmd.done() 

1867 

1868 -------------------------------------------------------------------------------- 

1869 

1870 """ 

1871 return _msmetadata.msmetadata_nsources(self) 

1872 

1873 

1874 def nrows(self, *args, **kwargs): 

1875 """ 

1876 nrows(self, _autoc, _flagged) -> double 

1877 

1878 

1879 

1880 Summary: 

1881 Get the number of visibilities (from the main table) associated with the MS. 

1882 

1883 Description: 

1884 

1885 

1886 Get the number of visibilities (from the main table) associated with the MS. 

1887 

1888 

1889 Input Parameters: 

1890 autoc Include autocorrelation data? If False, only cross correlation rows will be summed. 

1891 flagged Include flagged data? If False, only unflagged or patially flagged rows will be summed. 

1892 

1893 Example: 

1894 

1895 msmd.open('my.ms') 

1896 # get the total number of rows 

1897 nrows = msmd.nrows() 

1898 # got the number of cross correlation rows 

1899 ncross = msmd.nrows(auto=False) 

1900 # get the number of unflagged rows 

1901 ngood = msmd.nrows(flagged=False) 

1902 # get the number of unflagged cross correlation rows 

1903 ncrossunflagged = msmd.nrows(auto=False, flagged=False) 

1904 msmd.done() 

1905 

1906 -------------------------------------------------------------------------------- 

1907 

1908 """ 

1909 return _msmetadata.msmetadata_nrows(self, *args, **kwargs) 

1910 

1911 

1912 def observers(self): 

1913 """ 

1914 observers(self) -> std::vector< std::string > 

1915 

1916 

1917 

1918 Summary: 

1919 Get an array observers as they are listed in the OBSERVATIONS table. 

1920 

1921 Description: 

1922 

1923 

1924 Get an array of observers as they are listed in the OBSERVATIONS table. 

1925 

1926 

1927 Example: 

1928 

1929 msmd.open('my.ms') 

1930 # get the observers 

1931 observers = msmd.observers() 

1932 msmd.done() 

1933 

1934 -------------------------------------------------------------------------------- 

1935 

1936 """ 

1937 return _msmetadata.msmetadata_observers(self) 

1938 

1939 

1940 def observatorynames(self): 

1941 """ 

1942 observatorynames(self) -> std::vector< std::string > 

1943 

1944 

1945 

1946 Summary: 

1947 Get an array of MS telescope (observatory) names as they are listed in the OBSERVATIONS table. 

1948 

1949 Description: 

1950 

1951 

1952 Get an array of MS telescope (observatory) names as they are listed in the OBSERVATIONS table. 

1953 

1954 

1955 Example: 

1956 

1957 msmd.open('my.ms') 

1958 # get the telescope names 

1959 telescope_names = msmd.telescopenames() 

1960 msmd.done() 

1961 

1962 -------------------------------------------------------------------------------- 

1963 

1964 """ 

1965 return _msmetadata.msmetadata_observatorynames(self) 

1966 

1967 

1968 def observatoryposition(self, *args, **kwargs): 

1969 """ 

1970 observatoryposition(self, _which) -> record * 

1971 

1972 

1973 

1974 Summary: 

1975 Get the position of the specified telescope. 

1976 

1977 Description: 

1978 

1979 

1980 Get the position of the specified telescope. 

1981 

1982 

1983 Input Parameters: 

1984 which Zero-based telescope position in the OBSERVATIONS table (see msmd.telescopenames()). 

1985 

1986 Example: 

1987 

1988 msmd.open('my.ms') 

1989 # get the position of the 0th telescope 

1990 telescope_position = msmd.telescopeposition(0) 

1991 msmd.done() 

1992 

1993 -------------------------------------------------------------------------------- 

1994 

1995 """ 

1996 return _msmetadata.msmetadata_observatoryposition(self, *args, **kwargs) 

1997 

1998 

1999 def open(self, *args, **kwargs): 

2000 """ 

2001 open(self, _msfile, _maxcache) -> bool 

2002 

2003 

2004 

2005 Summary: 

2006 Attach the MS metadata tool to the specified MS 

2007 

2008 Description: 

2009 

2010 

2011 Attach this tool to the specified MS. This method runs a few basic MS validation tests, and if any of these 

2012 fail (which indicates that the MS is invalid), an error occurs and the tool is not attached to the MS. 

2013 Note that it is ultimately the user's responsibility to ensure that the MS is valid. Running the methods 

2014 of this tool on an invalid MS may result in incorrect results or even a crash of CASA. Such invalidities 

2015 include any MS subtable not having appropriate information (eg, an OBSERVATION subtable not having enough rows 

2016 to account for all the OBSERVATION_IDs in the main table). 

2017 

2018 

2019 Input Parameters: 

2020 msfile Name of the existing measurement set 

2021 maxcache Maximum cache size, in megabytes, to use. 

2022 

2023 Example: 

2024 

2025 msmd.open('my.ms') 

2026 # do stuff and close it 

2027 msmd.done() 

2028 

2029 -------------------------------------------------------------------------------- 

2030 

2031 """ 

2032 return _msmetadata.msmetadata_open(self, *args, **kwargs) 

2033 

2034 

2035 def phasecenter(self, *args, **kwargs): 

2036 """ 

2037 phasecenter(self, _fieldid, _epoch) -> record * 

2038 

2039 

2040 

2041 Summary: 

2042 Get the phasecenter direction from a field ID and time if necessary 

2043 

2044 Description: 

2045 

2046 

2047 Get a direction measures for the phasecenter of the field id and time specified 

2048 

2049 

2050 Input Parameters: 

2051 fieldid Zero-based field ID for which to get the phasecenter; default fieldid=0 

2052 epoch Optional time, expressed as a measures epoch dictionary, if field id has a polynomial in time phasecenter or an ephemerides table attached to the ID. Default value means evaluate at the origin TIME in the FIELD table 

2053 

2054 Example: 

2055 

2056 msmd.open('my.ms') 

2057 # get phasecenter for field ID 1 

2058 mydir = msmd.phasecenter(1); 

2059 # if the phasecenter is a polynomial or has an ephemerides attached to 

2060 # it a time is needed to get the phase direction 

2061 ep=me.epoch('utc', '2015/03/15/15:30:55') 

2062 mydir2=msmd.phasecenter(2, ep) 

2063 msmd.done() 

2064 

2065 -------------------------------------------------------------------------------- 

2066 

2067 """ 

2068 return _msmetadata.msmetadata_phasecenter(self, *args, **kwargs) 

2069 

2070 

2071 def pointingdirection(self, *args, **kwargs): 

2072 """ 

2073 pointingdirection(self, _rownum, _interpolate, _initialrow) -> record * 

2074 

2075 

2076 

2077 Summary: 

2078 Get the pointing direction for antennas at the specified row number in the main MS table. 

2079 

2080 Description: 

2081 

2082 

2083 Get the pointing direction for antennas at the specified row number in the main MS table. Returns a record 

2084 containing the time, antenna IDs and corresponding pointing directions. 

2085 

2086 

2087 Input Parameters: 

2088 rownum Row number in the main MS table. 

2089 interpolate Interpolate pointings in case the interval in the main table is shorter than that in the pointing table (often the case in fast-scanning in single dish observaitions) 

2090 initialrow Initial guess of row index in pointing table to start search. 

2091 

2092 Example: 

2093 

2094 msmd.open('my.ms') 

2095 # get the pointing directions for row ID 500 

2096 dirs = msmd.pointingdirection(500) 

2097 msmd.done() 

2098 

2099 -------------------------------------------------------------------------------- 

2100 

2101 """ 

2102 return _msmetadata.msmetadata_pointingdirection(self, *args, **kwargs) 

2103 

2104 

2105 def polidfordatadesc(self, *args, **kwargs): 

2106 """ 

2107 polidfordatadesc(self, _ddid) -> variant * 

2108 

2109 

2110 

2111 Summary: 

2112 Get the polarization ID associated with the specified data description ID. 

2113 

2114 Description: 

2115 

2116 

2117 Get the polarization ID associated with the specified data description ID. If the specified data description ID 

2118 is negative, an array of polarization IDs is returned. The indices of that array represent data description IDs. 

2119 

2120 

2121 Input Parameters: 

2122 ddid Zero-based data description ID. A negative number will cause all the polarization IDs to be returned. 

2123 

2124 Example: 

2125 

2126 msmd.open('my.ms') 

2127 # get the polarization ID associated with data description ID 3 

2128 polid = msmd.polidfordatadesc(3) 

2129 # get the array of polarization IDs in the order they appear in the DATA_DESCRIPTION table 

2130 polids = msmd.polidfordatadesc(-1) 

2131 msmd.done() 

2132 

2133 -------------------------------------------------------------------------------- 

2134 

2135 """ 

2136 return _msmetadata.msmetadata_polidfordatadesc(self, *args, **kwargs) 

2137 

2138 

2139 def projects(self): 

2140 """ 

2141 projects(self) -> std::vector< std::string > 

2142 

2143 

2144 

2145 Summary: 

2146 Get an array projects as they are listed in the OBSERVATIONS table. 

2147 

2148 Description: 

2149 

2150 

2151 Get an array of projects as they are listed in the OBSERVATIONS table. 

2152 

2153 

2154 Example: 

2155 

2156 msmd.open('my.ms') 

2157 # get the projects 

2158 projects = msmd.projects() 

2159 msmd.done() 

2160 

2161 -------------------------------------------------------------------------------- 

2162 

2163 """ 

2164 return _msmetadata.msmetadata_projects(self) 

2165 

2166 

2167 def propermotions(self): 

2168 """ 

2169 propermotions(self) -> record * 

2170 

2171 

2172 

2173 Summary: 

2174 Get the values of the PROPER_MOTION column from the SOURCE table. 

2175 

2176 Description: 

2177 

2178 

2179 Get the values of the DIRECTION column from the SOURCE table. Returns a dictionary in which the 

2180 keys are the associated zero-based row numbers, represented as strings, in the SOURCE table. The 

2181 associated values are two element dictionaries, with keys 'longitude' and 'latitude', containing 

2182 the longitudinal and latidinal components of the proper motion, which are valid quantity dictionaries. 

2183 

2184 

2185 Example: 

2186 

2187 msmd.open('my.ms') 

2188 # get PROPER_MOTION column values from the SOURCE table 

2189 mu = msmd.propermotions() 

2190 msmd.done() 

2191 # the direction associated with zero-based row number 10 

2192 mu10 = mu['10'] 

2193 

2194 -------------------------------------------------------------------------------- 

2195 

2196 """ 

2197 return _msmetadata.msmetadata_propermotions(self) 

2198 

2199 

2200 def refdir(self, *args, **kwargs): 

2201 """ 

2202 refdir(self, _field, _epoch) -> record * 

2203 

2204 

2205 

2206 Summary: 

2207 Get the reference direction from a field ID and time if necessary 

2208 

2209 Description: 

2210 

2211 

2212 Get a direction measure for the reference direction of the field and time specified 

2213 

2214 

2215 Input Parameters: 

2216 field Zero-based field ID or field name for which to get the reference direction; default field=0 

2217 epoch Optional time, expressed as a measures epoch dictionary, if associated field has a polynomial in time reference direction or an ephemerides table attached it. Default value means evaluate at the origin TIME in the FIELD table 

2218 

2219 Example: 

2220 

2221 msmd.open('my.ms') 

2222 # get reference direction for field ID 1 

2223 mydir = msmd.refdir(1); 

2224 # if the reference direction is a polynomial or has an ephemerides attached to 

2225 # it a time is needed to get the reference direction 

2226 ep=me.epoch('utc', '2015/03/15/15:30:55') 

2227 mydir2=msmd.phasecenter(2, ep) 

2228 msmd.done() 

2229 

2230 -------------------------------------------------------------------------------- 

2231 

2232 """ 

2233 return _msmetadata.msmetadata_refdir(self, *args, **kwargs) 

2234 

2235 

2236 def reffreq(self, *args, **kwargs): 

2237 """ 

2238 reffreq(self, _spw) -> record * 

2239 

2240 

2241 

2242 Summary: 

2243 Get the reference frequency of the specified spectral window. 

2244 

2245 Description: 

2246 

2247 

2248 Get the reference frequency of the specified spectral window. The returned frequency is in 

2249 the form of a valid measures dictionary. 

2250 

2251 

2252 Input Parameters: 

2253 spw Zero-based spectral window ID. 

2254 

2255 Example: 

2256 

2257 msmd.open('my.ms') 

2258 # get the reference frequency for spw ID 20 

2259 reffreq = msmd.reffreq(20) 

2260 msmd.done() 

2261 

2262 -------------------------------------------------------------------------------- 

2263 

2264 """ 

2265 return _msmetadata.msmetadata_reffreq(self, *args, **kwargs) 

2266 

2267 

2268 def restfreqs(self, *args, **kwargs): 

2269 """ 

2270 restfreqs(self, _sourceid, _spw) -> variant * 

2271 

2272 

2273 

2274 Summary: 

2275 Get the rest frequencies from the SOURCE table for the specified source and spectral window. 

2276 

2277 Description: 

2278 

2279 

2280 Get the rest frequencies from the SOURCE table for the specified source and spectral window. 

2281 The return value will be a dictionary of frequency measures if the rest frequencies are 

2282 defined for the specified inputs, or False if they do not. 

2283 

2284 

2285 Input Parameters: 

2286 sourceid Zero-based source ID (from the SOURCE::SOURCE_ID column). 

2287 spw Zero-based spectral window ID. 

2288 

2289 Example: 

2290 

2291 msmd.open('my.ms') 

2292 # get the rest frequencies for source ID 2 and spw ID 20 

2293 reffreq = msmd.restfreqs(2, 20) 

2294 msmd.done() 

2295 

2296 -------------------------------------------------------------------------------- 

2297 

2298 """ 

2299 return _msmetadata.msmetadata_restfreqs(self, *args, **kwargs) 

2300 

2301 

2302 def rxbands(self, *args, **kwargs): 

2303 """ 

2304 rxbands(self, _spwids) -> std::vector< long > 

2305 

2306 

2307 

2308 Summary: 

2309 ALMA-specific. Get the values of the receiver bands for the specified spws. 

2310 

2311 Description: 

2312 

2313 

2314 ALMA-only. Returns an integer array containing the receiver band 

2315 of the specified spw(s). A return value of -1 means no receiver 

2316 band number could be determined. The name of the spw is first 

2317 checked to determine if the receiver band value is encoded 

2318 there. If not, the corresponding spectral window ID is sought in 

2319 the ASDM_RECEIVER table, if it exists, and if it has less than 

2320 or equal number of rows compared to the SPECTRAL_WINDOW table. 

2321 If the corresponding spectral window can be found in the 

2322 ASDM_RECEIVER table, then the corresponding frequencyBand column 

2323 value is checked to determine if the receiver band information 

2324 is encoded there. In the case where the spectral window ID is 

2325 present in multiple cells of the spectralWindowId column, the 

2326 first row in which the ID is found is used to determine the 

2327 receiver band. If all these tests fail, -1 is returned for the 

2328 specified spectral window. 

2329 

2330 

2331 Input Parameters: 

2332 spwids Zero-based spw ID(s) for which to get the values (integer or interger array). Unspecified will return all receiver band values. 

2333 

2334 Example: 

2335 

2336 msmd.open('my.ms') 

2337 # get the receiver bands for spws 8 and 2. 

2338 rx_bands = msmd.rxbands([8, 2]) 

2339 # get all receiver bands 

2340 all_rx_bands = msmd.rxbands() 

2341 msmd.done() 

2342 

2343 -------------------------------------------------------------------------------- 

2344 

2345 """ 

2346 return _msmetadata.msmetadata_rxbands(self, *args, **kwargs) 

2347 

2348 

2349 def scannumbers(self, *args, **kwargs): 

2350 """ 

2351 scannumbers(self, _obsid, _arrayid) -> std::vector< long > 

2352 

2353 

2354 

2355 Summary: 

2356 Get an array of the unique scan numbers associated with the MS for the specified observation ID and array ID. 

2357 

2358 Description: 

2359 

2360 

2361 This method will return an array of unique scan numbers in the associated MS for the specified observation ID and array ID. 

2362 

2363 

2364 Input Parameters: 

2365 obsid Observation ID. A negative value indicates all observation IDs should be used. 

2366 arrayid Array ID. A negative value indicates all array IDs should be used. 

2367 

2368 Example: 

2369 

2370 msmd.open('my.ms') 

2371 # scan numbers for all obsids and all arrayids 

2372 scan_numbers = msmd.scannumbers() 

2373 msmd.done() 

2374 

2375 -------------------------------------------------------------------------------- 

2376 

2377 """ 

2378 return _msmetadata.msmetadata_scannumbers(self, *args, **kwargs) 

2379 

2380 

2381 def scansforfield(self, *args, **kwargs): 

2382 """ 

2383 scansforfield(self, _field, _obsid, _arrayid) -> std::vector< long > 

2384 

2385 

2386 

2387 Summary: 

2388 Get an array of the unique scan numbers associated with the specified field, observation ID, and array ID. 

2389 

2390 Description: 

2391 

2392 

2393 Get an array of the unique scan numbers associated with the specified field, observation ID, and array ID. 

2394 

2395 

2396 Input Parameters: 

2397 field Field ID or field name (case sensitive) for which to return the scan numbers. 

2398 obsid Observation ID. A negative value indicates all observation IDs should be used. 

2399 arrayid Array ID. A negative value indicates all array IDs should be used. 

2400 

2401 Example: 

2402 

2403 msmd.open('my.ms') 

2404 # get the scan numbers associated with field 'planet Z' (all obsids, all arrayids) 

2405 scan_numbers = msmd.scansforfield('planet Z') 

2406 # get the scan numbers associated with field ID 5 (all obsids, all arrayids) 

2407 scan_numbers = msmd.scansforfield(5) 

2408 msmd.done() 

2409 

2410 -------------------------------------------------------------------------------- 

2411 

2412 """ 

2413 return _msmetadata.msmetadata_scansforfield(self, *args, **kwargs) 

2414 

2415 

2416 def scansforfields(self, *args, **kwargs): 

2417 """ 

2418 scansforfields(self, _obsid, _arrayid) -> record * 

2419 

2420 

2421 

2422 Summary: 

2423 Get a dictionary of which maps field ID to scan numbers for the specified observation ID and array ID. 

2424 

2425 Description: 

2426 

2427 

2428 Get a dictionary of which maps field ID to scan numbers for the specified observation ID 

2429 and array ID. The keys (field IDs) will be strings. obsid and arrayid must both 

2430 be non-negative. 

2431 

2432 

2433 Input Parameters: 

2434 obsid Observation ID. Must be non-negative. 

2435 arrayid Array ID. Must be non-negative. 

2436 

2437 Example: 

2438 

2439 msmd.open('my.ms') 

2440 # get the field - scan map for arrayID 1 and obsID 2 

2441 field_to_scans = msmd.scansforfields(arrayid=1, obsid=2) 

2442 # access the scans associated with field ID 2 

2443 field_to_scans2 = field_to_scans['2'] 

2444 msmd.done() 

2445 

2446 -------------------------------------------------------------------------------- 

2447 

2448 """ 

2449 return _msmetadata.msmetadata_scansforfields(self, *args, **kwargs) 

2450 

2451 

2452 def scansforintent(self, *args, **kwargs): 

2453 """ 

2454 scansforintent(self, _intent, _obsid, _arrayid) -> std::vector< long > 

2455 

2456 

2457 

2458 Summary: 

2459 Get an array of the unique scan numbers associated with the specified intent, observation ID, and arrayID. 

2460 

2461 Description: 

2462 

2463 

2464 Get an array of the unique scan numbers associated with the specified intent, observation ID, and arrayID. 

2465 The '*' character matches any number of characters from all character classes. 

2466 

2467 

2468 Input Parameters: 

2469 intent Intent (case-sensitive) for which to return the scan numbers. 

2470 obsid Observation ID. A negative value indicates all observation IDs should be used. 

2471 arrayid Array ID. A negative value indicates all array IDs should be used. 

2472 

2473 Example: 

2474 

2475 msmd.open('my.ms') 

2476 # get the scan numbers associated with intent 'detect planet X' (all obsids, all arrayids) 

2477 scan_numbers = msmd.scansforintent('detect planet X', regex=False) 

2478 # got all the scan numbers associated with all intents which contain 'WVR' (all obsids, all arrayids) 

2479 scan_numbers = msmd.scansforintent('*WVR*') 

2480 msmd.done() 

2481 

2482 -------------------------------------------------------------------------------- 

2483 

2484 """ 

2485 return _msmetadata.msmetadata_scansforintent(self, *args, **kwargs) 

2486 

2487 

2488 def scansforspw(self, *args, **kwargs): 

2489 """ 

2490 scansforspw(self, _spw, _obsid, _arrayid) -> std::vector< long > 

2491 

2492 

2493 

2494 Summary: 

2495 Get an array of the unique scan numbers associated with the specified zero-based spectral window ID, observation ID, and array ID. 

2496 

2497 Description: 

2498 

2499 

2500 Get an array of the unique scan numbers associated with the specified zero-based spectral window ID, observation ID, and array ID. 

2501 

2502 

2503 Input Parameters: 

2504 spw Zero-based spectral window ID for which to return the scan numbers. 

2505 obsid Observation ID. A negative value indicates all observation IDs should be used. 

2506 arrayid Array ID. A negative value indicates all array IDs should be used. 

2507 

2508 Example: 

2509 

2510 msmd.open('my.ms') 

2511 # get the scan numbers associated with spectral window ID 14, all obsids, all arrayids 

2512 scan_numbers = msmd.scansforspw(14) 

2513 msmd.done() 

2514 

2515 -------------------------------------------------------------------------------- 

2516 

2517 """ 

2518 return _msmetadata.msmetadata_scansforspw(self, *args, **kwargs) 

2519 

2520 

2521 def scansforspws(self, *args, **kwargs): 

2522 """ 

2523 scansforspws(self, _obsid, _arrayid) -> record * 

2524 

2525 

2526 

2527 Summary: 

2528 Get a dictionary of which maps spw ID to scan numbers for the specified observation ID and array ID. 

2529 

2530 Description: 

2531 

2532 

2533 Get a dictionary of which maps spw ID to scan numbers for the specified observation ID 

2534 and array ID. The keys (spectral window IDs) will be strings. obsid and arrayid must both 

2535 be non-negative. 

2536 

2537 

2538 Input Parameters: 

2539 obsid Observation ID. Must be non-negative. 

2540 arrayid Array ID. Must be non-negative. 

2541 

2542 Example: 

2543 

2544 msmd.open('my.ms') 

2545 # get the spw - scan map for arrayID 1 and obsID 2 

2546 spw_to_scans = msmd.scansforspws(arrayid=1, obsid=2) 

2547 # access the scans associated with spw ID 2 

2548 spw_to_scans2 = spw_to_scans['2'] 

2549 msmd.done() 

2550 

2551 -------------------------------------------------------------------------------- 

2552 

2553 """ 

2554 return _msmetadata.msmetadata_scansforspws(self, *args, **kwargs) 

2555 

2556 

2557 def scansforstate(self, *args, **kwargs): 

2558 """ 

2559 scansforstate(self, _state, _obsid, _arrayid) -> std::vector< long > 

2560 

2561 

2562 

2563 Summary: 

2564 Get an array of the unique scan numbers for the specified state, observation ID, and array ID. 

2565 

2566 Description: 

2567 

2568 

2569 Get an array of the unique scan numbers for the specified state, observation ID, and array ID. 

2570 

2571 

2572 Input Parameters: 

2573 state ID of state for which to return the scan numbers. 

2574 obsid Observation ID. A negative value indicates all observation IDs should be used. 

2575 arrayid Array ID. A negative value indicates all array IDs should be used. 

2576 

2577 Example: 

2578 

2579 msmd.open('my.ms') 

2580 # get the scan numbers associated with state 2, all obsids, all arrayids 

2581 scans = msmd.scansforstate(2) 

2582 msmd.done() 

2583 

2584 -------------------------------------------------------------------------------- 

2585 

2586 """ 

2587 return _msmetadata.msmetadata_scansforstate(self, *args, **kwargs) 

2588 

2589 

2590 def scansfortimes(self, *args, **kwargs): 

2591 """ 

2592 scansfortimes(self, _time, _tol, _obsid, _arrayid) -> std::vector< long > 

2593 

2594 

2595 

2596 Summary: 

2597 Get an array of the unique scan numbers for the specified time range (time-tol to time+tol), observation ID, and array ID. 

2598 

2599 Description: 

2600 

2601 

2602 Get an array of the unique scan numbers for the specified time range (time-tol to time+tol), observation ID, and array ID. 

2603 

2604 

2605 Input Parameters: 

2606 time Time at center of time range. 

2607 tol Time difference on either side of center for specifying range. 

2608 obsid Observation ID. A negative value indicates all observation IDs should be used. 

2609 arrayid Array ID. A negative value indicates all array IDs should be used. 

2610 

2611 Example: 

2612 

2613 msmd.open('my.ms') 

2614 # get the scan numbers associated with the specified time range (all obsids, all array ids) 

2615 scans = msmd.scansfortimes(4.84282937e+09, 20) 

2616 msmd.done() 

2617 

2618 -------------------------------------------------------------------------------- 

2619 

2620 """ 

2621 return _msmetadata.msmetadata_scansfortimes(self, *args, **kwargs) 

2622 

2623 

2624 def schedule(self, *args, **kwargs): 

2625 """ 

2626 schedule(self, _obsid) -> std::vector< std::string > 

2627 

2628 

2629 

2630 Summary: 

2631 Get the schedule information for the specified observation ID. 

2632 

2633 Description: 

2634 

2635 

2636 Get the schedule information for the specified observation ID. 

2637 

2638 

2639 Input Parameters: 

2640 obsid Observation ID. 

2641 

2642 Example: 

2643 

2644 msmd.open('my.ms') 

2645 # get the schdule information for observation ID = 2 

2646 schedule = msmd.schedule()[2] 

2647 msmd.done() 

2648 

2649 -------------------------------------------------------------------------------- 

2650 

2651 """ 

2652 return _msmetadata.msmetadata_schedule(self, *args, **kwargs) 

2653 

2654 

2655 def sideband(self, *args, **kwargs): 

2656 """ 

2657 sideband(self, _spw) -> long 

2658 

2659 

2660 

2661 Summary: 

2662 Get the sideband for the specified spectral window. 

2663 

2664 Description: 

2665 

2666 

2667 Get the sideband for the specified spectral window. 

2668 

2669 

2670 Input Parameters: 

2671 spw Spectral window ID. 

2672 

2673 Example: 

2674 

2675 msmd.open('my.ms') 

2676 # get sideband for spectral window 2. 

2677 sideband = msmd.sideband(2) 

2678 msmd.done() 

2679 

2680 -------------------------------------------------------------------------------- 

2681 

2682 """ 

2683 return _msmetadata.msmetadata_sideband(self, *args, **kwargs) 

2684 

2685 

2686 def sourcedirs(self): 

2687 """ 

2688 sourcedirs(self) -> record * 

2689 

2690 

2691 

2692 Summary: 

2693 Get the values of the DIRECTION column from the SOURCE table. 

2694 

2695 Description: 

2696 

2697 

2698 Get the values of the DIRECTION column from the SOURCE table. Returns a dictionary in which the 

2699 keys are the associated row numbers, represented as strings, in the SOURCE table. Each value 

2700 in the returned dictionary is a valid direction measure. 

2701 

2702 

2703 Example: 

2704 

2705 msmd.open('my.ms') 

2706 # get DIRECTION column values from the SOURCE table 

2707 sourcedirs = msmd.sourcedirs() 

2708 msmd.done() 

2709 # the direction associated with zero-based row number 10 

2710 dir10 = sourcedirs['10'] 

2711 # convert it to B1950, using the measure interface 

2712 dir10_B1950 = me.convert(dir10, 'B1950') 

2713 

2714 -------------------------------------------------------------------------------- 

2715 

2716 """ 

2717 return _msmetadata.msmetadata_sourcedirs(self) 

2718 

2719 

2720 def sourcetimes(self): 

2721 """ 

2722 sourcetimes(self) -> record * 

2723 

2724 

2725 

2726 Summary: 

2727 Get the values of the TIME column from the SOURCE table. 

2728 

2729 Description: 

2730 

2731 

2732 Get the values of the TIME column from the SOURCE table. Returns a dictionary in which the 

2733 keys are the associated row numbers, represented as strings, in the SOURCE table. Each value 

2734 in the returned dictionary is a valid time quantity. 

2735 

2736 

2737 Example: 

2738 

2739 msmd.open('my.ms') 

2740 # get TIME column values from the SOURCE table 

2741 sourcetimes = msmd.sourcetimes() 

2742 msmd.done() 

2743 # the time associated with zero-based row number 10 

2744 time10 = sourcetimes['10'] 

2745 

2746 -------------------------------------------------------------------------------- 

2747 

2748 """ 

2749 return _msmetadata.msmetadata_sourcetimes(self) 

2750 

2751 

2752 def sourceidforfield(self, *args, **kwargs): 

2753 """ 

2754 sourceidforfield(self, _field) -> long 

2755 

2756 

2757 

2758 Summary: 

2759 Get the source ID from the field table for the specified field ID. 

2760 

2761 Description: 

2762 

2763 

2764 Get the source ID from the field table for the specified field ID. 

2765 

2766 

2767 Input Parameters: 

2768 field Zero-based field ID for which to return the source ID from the field table. 

2769 

2770 Example: 

2771 

2772 msmd.open('my.ms') 

2773 # get source ID associated with field ID 2 

2774 sourceid = msmd.sourceidforfield(2) 

2775 msmd.done() 

2776 

2777 -------------------------------------------------------------------------------- 

2778 

2779 """ 

2780 return _msmetadata.msmetadata_sourceidforfield(self, *args, **kwargs) 

2781 

2782 

2783 def sourceidsfromsourcetable(self): 

2784 """ 

2785 sourceidsfromsourcetable(self) -> std::vector< long > 

2786 

2787 

2788 

2789 Summary: 

2790 Get the values of the SOURCE_ID column from the SOURCE table. 

2791 

2792 Description: 

2793 

2794 

2795 Get the values of the SOURCE_ID column from the SOURCE table. It is unfortunate that the SOURCE 

2796 table has a column named SOURCE_ID, because implicitly the 'ID' of a row in an MS subtable is 

2797 generally meant to reflect a row number in that table, but that is not the case for the SOURCE table. 

2798 

2799 

2800 Example: 

2801 

2802 msmd.open('my.ms') 

2803 # get SOURCE_ID column values from the SOURCE table 

2804 sourceids = msmd.sourceidsfromsourcetable() 

2805 msmd.done() 

2806 

2807 -------------------------------------------------------------------------------- 

2808 

2809 """ 

2810 return _msmetadata.msmetadata_sourceidsfromsourcetable(self) 

2811 

2812 

2813 def sourcenames(self): 

2814 """ 

2815 sourcenames(self) -> std::vector< std::string > 

2816 

2817 

2818 

2819 Summary: 

2820 Get the values of the SOURCE_NAME column from the SOURCE table. 

2821 

2822 Description: 

2823 

2824 

2825 Get the values of the SOURCE_NAME column from the SOURCE table. 

2826 

2827 

2828 Example: 

2829 

2830 msmd.open('my.ms') 

2831 # get SOURCE_NAME column values from the SOURCE table 

2832 sourcenames = msmd.sourcenames() 

2833 msmd.done() 

2834 

2835 -------------------------------------------------------------------------------- 

2836 

2837 """ 

2838 return _msmetadata.msmetadata_sourcenames(self) 

2839 

2840 

2841 def spwsforbaseband(self, *args, **kwargs): 

2842 """ 

2843 spwsforbaseband(self, _baseband, _sqldmode) -> variant * 

2844 

2845 

2846 

2847 Summary: 

2848 Get the spws associated with the specified baseband or dictionary that maps baseband to spws. 

2849 

2850 Description: 

2851 

2852 

2853 Get the spectral windows associated with the specified baseband or dictionary that maps baseband to spectral windows. 

2854 

2855 

2856 Input Parameters: 

2857 baseband Baseband number. If <0, return a dictionary mapping basebands to spws. 

2858 sqldmode If 'include', include SQLD windows, if 'exclude', exclude SQLD windows, if 'only', include only SQLD windows. Case insenstive, inimum match honored. 

2859 

2860 Example: 

2861 

2862 msmd.open('my.ms') 

2863 # get the spectral window IDs associated with all the basebands in this dataset 

2864 basebandtospwdict = msmd.spwsforbasebands() 

2865 # get an array of spws associated with baseband 2. 

2866 spwsforbb2 = msmd.spwsforbasebands(2) 

2867 msmd.done() 

2868 

2869 -------------------------------------------------------------------------------- 

2870 

2871 """ 

2872 return _msmetadata.msmetadata_spwsforbaseband(self, *args, **kwargs) 

2873 

2874 

2875 def spwfordatadesc(self, *args, **kwargs): 

2876 """ 

2877 spwfordatadesc(self, _ddid) -> variant * 

2878 

2879 

2880 

2881 Summary: 

2882 Get the spectral window ID associated with the specified data description ID. 

2883 

2884 Description: 

2885 

2886 

2887 Get the spectral window ID associated with the specified data description ID. If the specified data description ID 

2888 is negative, an array of spectral window IDs is returned. The indices of that array represent data description IDs. 

2889 

2890 

2891 Input Parameters: 

2892 ddid Zero-based data description ID. A negative number will cause all the spectral window IDs to be returned. 

2893 

2894 Example: 

2895 

2896 msmd.open('my.ms') 

2897 # get the spectral window ID associated with data description ID 3 

2898 spw = msmd.spwfordatadesc(3) 

2899 # get the array of spectral window IDs in the order they appear in the DATA_DESCRIPTION table 

2900 spws = msmd.spwfordatadesc(-1) 

2901 msmd.done() 

2902 

2903 -------------------------------------------------------------------------------- 

2904 

2905 """ 

2906 return _msmetadata.msmetadata_spwfordatadesc(self, *args, **kwargs) 

2907 

2908 

2909 def spwsforfield(self, *args, **kwargs): 

2910 """ 

2911 spwsforfield(self, _field) -> std::vector< long > 

2912 

2913 

2914 

2915 Summary: 

2916 Get an array of the unique spectral window IDs for the specified field. 

2917 

2918 Description: 

2919 

2920 

2921 Get an array of the unique spectral window IDs for the specified field. 

2922 

2923 

2924 Input Parameters: 

2925 field Field (case sensitive string or zero-based integer ID) for which to return the spectral window IDs. 

2926 

2927 Example: 

2928 

2929 msmd.open('my.ms') 

2930 # get the spectral window IDs associated with field 'Fomalhaut' 

2931 spws = msmd.spwsforfield('Fomalhaut') 

2932 # get spectral window IDs associated with field ID 2 

2933 spws = msmd.spwsforfield(2) 

2934 msmd.done() 

2935 

2936 -------------------------------------------------------------------------------- 

2937 

2938 """ 

2939 return _msmetadata.msmetadata_spwsforfield(self, *args, **kwargs) 

2940 

2941 

2942 def spwsforfields(self): 

2943 """ 

2944 spwsforfields(self) -> record * 

2945 

2946 

2947 

2948 Summary: 

2949 Get a dictionary which maps field IDs to spectral window IDs. 

2950 

2951 Description: 

2952 

2953 

2954 Get a dictionary which maps field IDs to spectral window IDs. The field IDs are keys in the 

2955 returned dictionary. To access a particular element, one must ensure the key is a string. 

2956 

2957 

2958 Example: 

2959 

2960 msmd.open('my.ms') 

2961 # get the map of field IDs to spw IDs 

2962 field_to_spw_map = msmd.spwsforfields() 

2963 spws_for_field_5 = field_to_spw_map[str(5)] 

2964 msmd.done() 

2965 

2966 -------------------------------------------------------------------------------- 

2967 

2968 """ 

2969 return _msmetadata.msmetadata_spwsforfields(self) 

2970 

2971 

2972 def spwsforintent(self, *args, **kwargs): 

2973 """ 

2974 spwsforintent(self, _intent) -> std::vector< long > 

2975 

2976 

2977 

2978 Summary: 

2979 Get an array of the unique spectral window IDs for the specified intent. 

2980 

2981 Description: 

2982 

2983 

2984 Get an array of the unique spectral window IDs for the specified intent. The '*' character matches any number of characters from all character classes. 

2985 

2986 

2987 Input Parameters: 

2988 intent Intent (case sensitive) for which to return the spectral window IDs. 

2989 

2990 Example: 

2991 

2992 msmd.open('my.ms') 

2993 # get the spectral window IDs associated with 'MY COOL INTENT' 

2994 spws = msmd.spwsforintent('MY COOL INTENT') 

2995 # got all the spw IDs associated with all intents which contain 'WVR' 

2996 scan_numbers = msmd.spwsforintent('*WVR*') 

2997 msmd.done() 

2998 msmd.done() 

2999 

3000 -------------------------------------------------------------------------------- 

3001 

3002 """ 

3003 return _msmetadata.msmetadata_spwsforintent(self, *args, **kwargs) 

3004 

3005 

3006 def spwsfornames(self, *args, **kwargs): 

3007 """ 

3008 spwsfornames(self, _spwids) -> record * 

3009 

3010 

3011 

3012 Summary: 

3013 Get the IDs of the specified spw names. 

3014 

3015 Description: 

3016 

3017 

3018 Get the IDs of the specified spw(s). Returns a dictionary where the keys 

3019 are the requested spectral window names that are present in the data set 

3020 and the values are arrays of the spectral window IDs corresponding to the 

3021 name. If a specified name is not present, a warning message is logged and 

3022 that name is not included in the returned dictionary. Specifying no names 

3023 results in a dictionary containing the name to spw ID mapping for the 

3024 entire data set. 

3025 

3026 

3027 Input Parameters: 

3028 spwids Names of the spws for which IDs are needed (string or string array). Unspecified will return all spw names. 

3029 

3030 Example: 

3031 

3032 msmd.open('my.ms') 

3033 # get the IDs for spws named 'CO' and 'HCN' 

3034 spw_ids = msmd.spwsfornames(['CO', 'HCN']) 

3035 # get the complete spw name to ID map 

3036 spw_names_to_ids = msmd.spwsfornames() 

3037 msmd.done() 

3038 

3039 -------------------------------------------------------------------------------- 

3040 

3041 """ 

3042 return _msmetadata.msmetadata_spwsfornames(self, *args, **kwargs) 

3043 

3044 

3045 def spwsforscan(self, *args, **kwargs): 

3046 """ 

3047 spwsforscan(self, _scan, _obsid, _arrayid) -> std::vector< long > 

3048 

3049 

3050 

3051 Summary: 

3052 Get an array of the unique spectral window IDs for the specified scan number, observation ID, and array ID. 

3053 

3054 Description: 

3055 

3056 

3057 Get an array of the unique spectral window IDs for the specified scan number, observation ID, and array ID. 

3058 

3059 

3060 Input Parameters: 

3061 scan Scan number for which to return the spectral window IDs. 

3062 obsid Observation ID. A negative value means that all observation IDs should be used. 

3063 arrayid Array ID. A negative value means that all array IDs should be used. 

3064 

3065 Example: 

3066 

3067 msmd.open('my.ms') 

3068 # get the spectral window IDs associated with scan number 20, all obsids, all arrayids. 

3069 spws = msmd.spwsforscan(20) 

3070 msmd.done() 

3071 

3072 -------------------------------------------------------------------------------- 

3073 

3074 """ 

3075 return _msmetadata.msmetadata_spwsforscan(self, *args, **kwargs) 

3076 

3077 

3078 def spwsforscans(self, *args, **kwargs): 

3079 """ 

3080 spwsforscans(self, _obsid, _arrayid) -> record * 

3081 

3082 

3083 

3084 Summary: 

3085 Get a dictionary of which maps scan number to spectral windows for the specified observation ID and array ID. 

3086 

3087 Description: 

3088 

3089 

3090 Get a dictionary of which maps scan number to spectral windows for the specified observation ID and array ID. The keys (scan 

3091 numbers) will be strings. obsid and arrayid must both be non-negative. 

3092 

3093 

3094 Input Parameters: 

3095 obsid Observation ID. Must be non-negative. 

3096 arrayid Array ID. Must be non-negative. 

3097 

3098 Example: 

3099 

3100 msmd.open('my.ms') 

3101 # get the scan - spw map for arrayID 1 and obsID 2 

3102 scan_to_spws = msmd.spwsforscans(arrayid=1, obsid=2) 

3103 # access the spws associated with scan 2 

3104 spws_for_scan2 = scan_to_spws['2'] 

3105 msmd.done() 

3106 

3107 -------------------------------------------------------------------------------- 

3108 

3109 """ 

3110 return _msmetadata.msmetadata_spwsforscans(self, *args, **kwargs) 

3111 

3112 

3113 def subwindows(self, *args, **kwargs): 

3114 """ 

3115 subwindows(self, _spwids) -> std::vector< long > 

3116 

3117 

3118 

3119 Summary: 

3120 ALMA-specific. Get the values of the subwindows for the specified spws. 

3121 

3122 Description: 

3123 

3124 

3125 ALMA-only. Returns an integer array containing the subwindow of 

3126 the specified spw(s). The spw name is checked to determine if 

3127 the subwindow value is encoded within it. A return value of -1 

3128 indicates that a subwindow number could be determined. 

3129 

3130 

3131 Input Parameters: 

3132 spwids Zero-based spw ID(s) for which to get the values (integer or interger array). Unspecified will return all receiver band values. 

3133 

3134 Example: 

3135 

3136 msmd.open('my.ms') 

3137 # get the subwindows for spws 8 and 2. 

3138 sws = msmd.subwindows([8, 2]) 

3139 # get all subwindows 

3140 all_sws = msmd.subwindows() 

3141 msmd.done() 

3142 

3143 -------------------------------------------------------------------------------- 

3144 

3145 """ 

3146 return _msmetadata.msmetadata_subwindows(self, *args, **kwargs) 

3147 

3148 

3149 def statesforscan(self, *args, **kwargs): 

3150 """ 

3151 statesforscan(self, _scan, _obsid, _arrayid) -> std::vector< long > 

3152 

3153 

3154 

3155 Summary: 

3156 Get an array of the unique state IDs for the specified scan number, observation ID, and array ID. 

3157 

3158 Description: 

3159 

3160 

3161 Get an array of the unique state IDs for the specified scan number, observation ID, and array ID. 

3162 

3163 

3164 Input Parameters: 

3165 scan Scan number for which to return the state IDs. 

3166 obsid Observation ID. A negative value means that all observation IDs should be used. 

3167 arrayid Array ID. A negative value means that all array IDs should be used. 

3168 

3169 Example: 

3170 

3171 msmd.open('my.ms') 

3172 # get the state IDs associated with scan number 251, all obsids, all arrayids 

3173 states = msmd.statesforscan(251) 

3174 msmd.done() 

3175 

3176 -------------------------------------------------------------------------------- 

3177 

3178 """ 

3179 return _msmetadata.msmetadata_statesforscan(self, *args, **kwargs) 

3180 

3181 

3182 def statesforscans(self, *args, **kwargs): 

3183 """ 

3184 statesforscans(self, _obsid, _arrayid) -> record * 

3185 

3186 

3187 

3188 Summary: 

3189 Get a dictionary which maps scan numbers to state IDs for the specified array and observation IDs. 

3190 

3191 Description: 

3192 

3193 

3194 Get a dictionary which maps scan numbers to state IDs for the specified array and observation IDs. The returned dictionary 

3195 will have scan numbers, as strings, as keys. 

3196 

3197 

3198 Input Parameters: 

3199 obsid Observation ID, must be nonnegative. 

3200 arrayid Array ID, must be nonnegative. 

3201 

3202 Example: 

3203 

3204 msmd.open('my.ms') 

3205 # get the map of scan numbers to state IDs for arrayID=1, obsID=2 

3206 scans_to_states = msmd.statesforscans(obsID=2, arrayID=1) 

3207 states_for_scan_5 = scans_to_states[str(5)] 

3208 msmd.done() 

3209 

3210 -------------------------------------------------------------------------------- 

3211 

3212 """ 

3213 return _msmetadata.msmetadata_statesforscans(self, *args, **kwargs) 

3214 

3215 

3216 def summary(self): 

3217 """ 

3218 summary(self) -> record * 

3219 

3220 

3221 

3222 Summary: 

3223 Get dictionary summarizing the MS. 

3224 

3225 Description: 

3226 

3227 

3228 Get dictionary summarizing the MS. 

3229 

3230 

3231 Example: 

3232 

3233 msmd.open('my.ms') 

3234 # get the summary 

3235 summary = msmd.summary() 

3236 msmd.done() 

3237 

3238 -------------------------------------------------------------------------------- 

3239 

3240 """ 

3241 return _msmetadata.msmetadata_summary(self) 

3242 

3243 

3244 def tdmspws(self): 

3245 """ 

3246 tdmspws(self) -> std::vector< long > 

3247 

3248 

3249 

3250 Summary: 

3251 Get an array of spectral window IDs used for TDM. These are windows that have 64, 128, or 256 channels. 

3252 

3253 Description: 

3254 

3255 

3256 

3257 Get an array of spectral window IDs used for TDM. These are windows that have 64, 128, or 256 channels. 

3258 

3259 

3260 Example: 

3261 

3262 msmd.open('my.ms') 

3263 # get the spectral window IDs used for TDM. 

3264 tdm_spws = msmd.tdmspws() 

3265 msmd.done() 

3266 

3267 -------------------------------------------------------------------------------- 

3268 

3269 """ 

3270 return _msmetadata.msmetadata_tdmspws(self) 

3271 

3272 

3273 def timerangeforobs(self, *args, **kwargs): 

3274 """ 

3275 timerangeforobs(self, _obsid) -> record * 

3276 

3277 

3278 

3279 Summary: 

3280 Get the time range for the specified observation ID 

3281 

3282 Description: 

3283 

3284 

3285 Get the time range for the specified observation ID. The return value is a dictionary containing 

3286 keys 'begin' and 'end'. Each of the associated value are dictionaries representing epochs which 

3287 are valid measure records. The values are taken directly from the OBSERVATION subtable; no 

3288 half-intervals are added or subtracted. 

3289 

3290 

3291 Input Parameters: 

3292 obsid Zero-based observation ID for which to get the time range. 

3293 

3294 Example: 

3295 

3296 msmd.open('my.ms') 

3297 # get the time range associated with observation ID 3 

3298 timerange = msmd.timerangeforobs(3) 

3299 msmd.done() 

3300 

3301 -------------------------------------------------------------------------------- 

3302 

3303 """ 

3304 return _msmetadata.msmetadata_timerangeforobs(self, *args, **kwargs) 

3305 

3306 

3307 def timesforfield(self, *args, **kwargs): 

3308 """ 

3309 timesforfield(self, _field) -> std::vector< double > 

3310 

3311 

3312 

3313 Summary: 

3314 Get an array of the unique times for the specified field. 

3315 

3316 Description: 

3317 

3318 

3319 Get an array of the unique times associated with the specified field ID. The times correspond to those in the TIME column, so are values of the time system associated with that column and have units associated with that column. Only unique times are returned; duplicates are dropped. Providing a negative field ID will result in an exception being thrown. 

3320 

3321 

3322 Input Parameters: 

3323 field Zero-based field ID for which to return the times. 

3324 

3325 Example: 

3326 

3327 msmd.open('my.ms') 

3328 # get the times associated with field 3 

3329 times = msmd.timesforfield(3) 

3330 msmd.done() 

3331 

3332 -------------------------------------------------------------------------------- 

3333 

3334 """ 

3335 return _msmetadata.msmetadata_timesforfield(self, *args, **kwargs) 

3336 

3337 

3338 def timesforintent(self, *args, **kwargs): 

3339 """ 

3340 timesforintent(self, _intent) -> std::vector< double > 

3341 

3342 

3343 

3344 Summary: 

3345 Get an array of the unique times for the specified intent. 

3346 

3347 Description: 

3348 

3349 

3350 Get an array of the unique times associated with the specified intent. The times correspond to those in the TIME column, so are values of the time system associated with that column and have units associated with that column. Only unique times are returned; duplicates are dropped. 

3351 

3352 

3353 Input Parameters: 

3354 intent Intent for which to return the times. 

3355 

3356 Example: 

3357 

3358 msmd.open('my.ms') 

3359 # get the times associated with intent 'myintent' 

3360 times = msmd.timesforintent('myintent') 

3361 msmd.done() 

3362 

3363 -------------------------------------------------------------------------------- 

3364 

3365 """ 

3366 return _msmetadata.msmetadata_timesforintent(self, *args, **kwargs) 

3367 

3368 

3369 def timesforscan(self, *args, **kwargs): 

3370 """ 

3371 timesforscan(self, _scan, _obsid, _arrayid, _perspw) -> variant * 

3372 

3373 

3374 

3375 Summary: 

3376 Get the unique times for the specified scan number, observation ID, and array ID. 

3377 

3378 Description: 

3379 

3380 

3381 Get the unique times for the specified scan number, observation ID, and array ID. If perspw=True, the returned data structure is 

3382 a dictionary that has keys representing zero-based spectral window IDs and values representing the unique values of the TIME column 

3383 corrsponding to the specified scan and that corresponding spectral window ID. If False, an array of unique values from the TIME 

3384 column for the specified scan is returned; there is no separation into spectral window IDs. 

3385 

3386 

3387 Input Parameters: 

3388 scan Scan number for which to return the times. 

3389 obsid Observation ID. A negative value indicates all observation IDs should be used. 

3390 arrayid Array ID. A negative value indicates all array IDs should be used. 

3391 perspw Return output dictionary with keys representing spectral window IDs (True), or an array of all times (False). 

3392 

3393 Example: 

3394 

3395 msmd.open('my.ms') 

3396 # get the times associated with scan number 10, all obsids, all arrayids. 

3397 times = msmd.timesforscan(10) 

3398 msmd.done() 

3399 

3400 -------------------------------------------------------------------------------- 

3401 

3402 """ 

3403 return _msmetadata.msmetadata_timesforscan(self, *args, **kwargs) 

3404 

3405 

3406 def timesforscans(self, *args, **kwargs): 

3407 """ 

3408 timesforscans(self, _scans, _obsid, _arrayid) -> std::vector< double > 

3409 

3410 

3411 

3412 Summary: 

3413 Get an array of the unique times for the specified scan numbers, observation ID, and array ID. 

3414 

3415 Description: 

3416 

3417 

3418 Get an array of the unique times for the specified scan numbers, observation ID, and array ID. The times correspond to those in the TIME column, so are values of the time system associated with that column and have units associated with that column. Only unique times are returned; duplicates are dropped. For the scans parameter, a single non-negative integer or a list of non-negative integers, all of which are valid scan numbers in the MS, must be supplied. 

3419 

3420 

3421 Input Parameters: 

3422 scans Scan number(s) for which to return the times. 

3423 obsid Observation ID. A negative value indicates all observation IDs should be used. 

3424 arrayid Array ID. A negative value indicates all array IDs should be used. 

3425 

3426 Example: 

3427 

3428 msmd.open('my.ms') 

3429 # get the times associated with scan numbers 10 and 20, all obsids, all arrayids 

3430 times = msmd.timesforscans([10,20]) 

3431 msmd.done() 

3432 

3433 -------------------------------------------------------------------------------- 

3434 

3435 """ 

3436 return _msmetadata.msmetadata_timesforscans(self, *args, **kwargs) 

3437 

3438 

3439 def timesforspws(self, *args, **kwargs): 

3440 """ 

3441 timesforspws(self, _spw) -> variant * 

3442 

3443 

3444 

3445 Summary: 

3446 Get the unique times corresponding to the specified spectral window(s). 

3447 

3448 Description: 

3449 

3450 

3451 Get the unique times corresponding to the specified spectral window(s). The input indicates the 

3452 spws for which times are to be retrieved, and can be a single integer or an array of 

3453 integers. If a single, non-negative integer, an array of unique times associated with 

3454 that spectral window are returned. Otherwise, a dictionary of times associated with the 

3455 specified spectral windows are returned, with the spws (as strings) as the keys and the 

3456 times as the values. A negative integer will cause a dictionary of all spws and their 

3457 associated times to be returned. 

3458 

3459 

3460 Input Parameters: 

3461 spw Zero-based spectral window ID(s). A negative integer will cause the all the times for all spws to be returned. 

3462 

3463 Example: 

3464 

3465 msmd.open('my.ms') 

3466 # get the times associated with spws 10 and 20 

3467 times = msmd.timesforspws([10,20]) 

3468 # print the times for spw 10 

3469 print times['10'] 

3470 msmd.done() 

3471 

3472 -------------------------------------------------------------------------------- 

3473 

3474 """ 

3475 return _msmetadata.msmetadata_timesforspws(self, *args, **kwargs) 

3476 

3477 

3478 def transitions(self, *args, **kwargs): 

3479 """ 

3480 transitions(self, _sourceid, _spw) -> variant * 

3481 

3482 

3483 

3484 Summary: 

3485 Get the spectral transitions from the SOURCE table for the specified source and spectral window. 

3486 

3487 Description: 

3488 

3489 

3490 Get the spectral transitions from the SOURCE table for the specified source and spectral window. 

3491 The return value will be an array of transitions if the transitions are 

3492 defined for the specified inputs, or False if they do not. 

3493 

3494 

3495 Input Parameters: 

3496 sourceid Zero-based source ID (from the SOURCE::SOURCE_ID column). 

3497 spw Zero-based spectral window ID. 

3498 

3499 Example: 

3500 

3501 msmd.open('my.ms') 

3502 # get the transitions for source ID 2 and spw ID 20 

3503 reffreq = msmd.transitions(2, 20) 

3504 msmd.done() 

3505 

3506 -------------------------------------------------------------------------------- 

3507 

3508 """ 

3509 return _msmetadata.msmetadata_transitions(self, *args, **kwargs) 

3510 

3511 

3512 def wvrspws(self, *args, **kwargs): 

3513 """ 

3514 wvrspws(self, _complement) -> std::vector< long > 

3515 

3516 

3517 

3518 Summary: 

3519 Get an array of spectral window IDs used for WVR. These are windows that have 4 channels. 

3520 

3521 Description: 

3522 

3523 

3524 

3525 Get an array of spectral window IDs used for WVR. These are windows that have 4 channels. 

3526 If complement is True, return the complement set instead (all non-wvr spw IDs). WVR windows 

3527 are identified using the algorithm 

3528 1. check for water vapor radiometer (WVR) spectral windows using the spectral window 

3529 name 'WVR#NOMINAL' and report these. 

3530 2. If no SPWs match that string, then the names are checked for 'WVR' and are reported instead. 

3531 

3532 

3533 Input Parameters: 

3534 complement If True, return all non-wvr spws. 

3535 

3536 Example: 

3537 

3538 msmd.open('my.ms') 

3539 # get the spectral window IDs used for WVR. 

3540 wvr_spws = msmd.wvrspws() 

3541 msmd.done() 

3542 

3543 -------------------------------------------------------------------------------- 

3544 

3545 """ 

3546 return _msmetadata.msmetadata_wvrspws(self, *args, **kwargs) 

3547 

3548 __swig_destroy__ = _msmetadata.delete_msmetadata 

3549 __del__ = lambda self: None 

3550msmetadata_swigregister = _msmetadata.msmetadata_swigregister 

3551msmetadata_swigregister(msmetadata) 

3552 

3553# This file is compatible with both classic and new-style classes. 

3554 

3555