Coverage for /wheeldirectory/casa-6.7.2-31-py3.12.el8/lib/py/lib/python3.12/site-packages/casatools/__casac__/msmetadata.py: 52%

298 statements  

« prev     ^ index     » next       coverage.py v7.10.1, created at 2025-07-31 10:44 +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, or 

154 3. the product of the number of polarizations and the number of 

155 channels it contains exceeds 256. 

156 

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

158 a channel average window, nor an FDM window. 

159 

160 

161 

162 Input Parameters: 

163 chavg Get channel average spectral windows? 

164 fdm Get FDM spectral windows? 

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

166 tdm Get TDM spectral windows? 

167 wvr Get WVR spectral windows? 

168 complement Return the complement of the selected set? 

169 

170 Example: 

171 

172 msmd.open('my.ms') 

173 # get all square law detector spectral window IDs 

174 msmd.almaspws(sqld=True) 

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

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

177 

178 -------------------------------------------------------------------------------- 

179 

180 """ 

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

182 

183 

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

185 """ 

186 antennadiameter(self, _antenna) -> record * 

187 

188 

189 

190 Summary: 

191 Get the diameter for the specified antenna. 

192 

193 Description: 

194 

195 

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

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

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

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

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

201 that antenna ID. 

202 

203 

204 Input Parameters: 

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

206 

207 Example: 

208 

209 msmd.open('my.ms') 

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

211 diameter = msmd.antennadiameter('VB2') 

212 msmd.done() 

213 

214 -------------------------------------------------------------------------------- 

215 

216 """ 

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

218 

219 

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

221 """ 

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

223 

224 

225 

226 Summary: 

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

228 

229 Description: 

230 

231 

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

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

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

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

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

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

238 

239 

240 Input Parameters: 

241 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. 

242 mindiameter Minimum antenna diameter, expressed as a quantity. 

243 maxdiameter Maximum antenna diameter, expressed as a quantity. 

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

245 

246 Example: 

247 

248 msmd.open('my.ms') 

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

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

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

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

253 msmd.done() 

254 

255 -------------------------------------------------------------------------------- 

256 

257 """ 

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

259 

260 

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

262 """ 

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

264 

265 

266 

267 Summary: 

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

269 

270 Description: 

271 

272 

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

274 all antenna names are returned. 

275 

276 

277 Input Parameters: 

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

279 

280 Example: 

281 

282 msmd.open('my.ms') 

283 # get the name associated with antenna ID 31 

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

285 msmd.done() 

286 

287 -------------------------------------------------------------------------------- 

288 

289 """ 

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

291 

292 

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

294 """ 

295 antennaoffset(self, _which) -> record * 

296 

297 

298 

299 Summary: 

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

301 

302 Description: 

303 

304 

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

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

307 antenna name. The returned 

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

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

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

311 

312 

313 Input Parameters: 

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

315 

316 Example: 

317 

318 msmd.open('my.ms') 

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

320 antennna_offset = msmd.antennaoffset(3) 

321 # get the offset of antenna DV02 

322 antennna_offset = msmd.antennaoffset('DV02') 

323 msmd.done() 

324 

325 -------------------------------------------------------------------------------- 

326 

327 """ 

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

329 

330 

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

332 """ 

333 antennaposition(self, _which) -> record * 

334 

335 

336 

337 Summary: 

338 Get the position of the specified antenna. 

339 

340 Description: 

341 

342 

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

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

345 

346 

347 Input Parameters: 

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

349 

350 Example: 

351 

352 msmd.open('my.ms') 

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

354 antennna_position = msmd.antennaposition(3) 

355 # get the position of the antenna named DV07 

356 antennna_position = msmd.antennaposition('DV07') 

357 msmd.done() 

358 

359 -------------------------------------------------------------------------------- 

360 

361 """ 

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

363 

364 

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

366 """ 

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

368 

369 

370 

371 Summary: 

372 Get the station names of the specified antennas. 

373 

374 Description: 

375 

376 

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

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

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

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

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

382 

383 

384 Input Parameters: 

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

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

387 

388 Example: 

389 

390 msmd.open('my.ms') 

391 # get all station names 

392 stations = msmd.antennastations(-1) 

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

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

395 msmd.done() 

396 

397 -------------------------------------------------------------------------------- 

398 

399 """ 

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

401 

402 

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

404 """ 

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

406 

407 

408 

409 Summary: 

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

411 

412 Description: 

413 

414 

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

416 

417 

418 Input Parameters: 

419 scan Scan number for which to return the intents. 

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

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

422 

423 Example: 

424 

425 msmd.open('my.ms') 

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

427 antennas = msmd.antennasforscan(4) 

428 msmd.done() 

429 

430 -------------------------------------------------------------------------------- 

431 

432 """ 

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

434 

435 

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

437 """ 

438 bandwidths(self, _spw) -> casac::variant * 

439 

440 

441 

442 Summary: 

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

444 

445 Description: 

446 

447 

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

449 

450 

451 Input Parameters: 

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

453 

454 Example: 

455 

456 msmd.open('my.ms') 

457 # get bandwdith for spectral window 2. 

458 baseband = msmd.bandwidth(2) 

459 msmd.done() 

460 

461 -------------------------------------------------------------------------------- 

462 

463 """ 

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

465 

466 

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

468 """ 

469 baseband(self, _spw) -> long 

470 

471 

472 

473 Summary: 

474 Get the baseband for the specified spectral window. 

475 

476 Description: 

477 

478 

479 Get the baseband for the specified spectral window. 

480 

481 

482 Input Parameters: 

483 spw Spectral window ID. 

484 

485 Example: 

486 

487 msmd.open('my.ms') 

488 # get baseband for spectral window 2. 

489 baseband = msmd.baseband(2) 

490 msmd.done() 

491 

492 -------------------------------------------------------------------------------- 

493 

494 """ 

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

496 

497 

498 def baselines(self): 

499 """ 

500 baselines(self) -> casac::variant * 

501 

502 

503 

504 Summary: 

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

506 

507 Description: 

508 

509 

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

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

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

513 

514 

515 Example: 

516 

517 msmd.open('my.ms') 

518 # get the baseline matrix for this data set 

519 baselines = msmd.baselines() 

520 msmd.done() 

521 

522 -------------------------------------------------------------------------------- 

523 

524 """ 

525 return _msmetadata.msmetadata_baselines(self) 

526 

527 

528 def chanavgspws(self): 

529 """ 

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

531 

532 

533 

534 Summary: 

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

536 

537 Description: 

538 

539 

540 

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

542 

543 

544 Example: 

545 

546 msmd.open('my.ms') 

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

548 chan_avg_spws = msmd.chanavgspws() 

549 msmd.done() 

550 

551 -------------------------------------------------------------------------------- 

552 

553 """ 

554 return _msmetadata.msmetadata_chanavgspws(self) 

555 

556 

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

558 """ 

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

560 

561 

562 

563 Summary: 

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

565 

566 Description: 

567 

568 

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

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

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

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

573 

574 

575 Input Parameters: 

576 spw Spectral window ID. 

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

578 asvel Should return values be equivalent velocity widths? 

579 

580 Example: 

581 

582 msmd.open('my.ms') 

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

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

585 msmd.done() 

586 

587 -------------------------------------------------------------------------------- 

588 

589 """ 

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

591 

592 

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

594 """ 

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

596 

597 

598 

599 Summary: 

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

601 

602 Description: 

603 

604 

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

606 

607 

608 Input Parameters: 

609 spw Spectral window ID. 

610 unit Convert frequencies to this unit. 

611 

612 Example: 

613 

614 msmd.open('my.ms') 

615 # get the channel frequencies for spectral window 2. 

616 chan_freqs = msmd.chanfreqs(2) 

617 msmd.done() 

618 

619 -------------------------------------------------------------------------------- 

620 

621 """ 

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

623 

624 

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

626 """ 

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

628 

629 

630 

631 Summary: 

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

633 

634 Description: 

635 

636 

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

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

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

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

641 

642 

643 Input Parameters: 

644 spw Spectral window ID. 

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

646 asvel Should return values be equivalent velocity resolutions? 

647 

648 Example: 

649 

650 msmd.open('my.ms') 

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

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

653 msmd.done() 

654 

655 -------------------------------------------------------------------------------- 

656 

657 """ 

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

659 

660 

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

662 """ 

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

664 

665 

666 

667 Summary: 

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

669 

670 Description: 

671 

672 

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

674 

675 

676 Input Parameters: 

677 spw Spectral window ID. 

678 unit Convert frequencies to this unit. 

679 

680 Example: 

681 

682 msmd.open('my.ms') 

683 # get the channel widths for spectral window 2. 

684 chan_freqs = msmd.chanwidths(2) 

685 msmd.done() 

686 

687 -------------------------------------------------------------------------------- 

688 

689 """ 

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

691 

692 

693 def close(self): 

694 """ 

695 close(self) -> bool 

696 

697 

698 

699 Summary: 

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

701 

702 Description: 

703 

704 

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

706 

707 

708 Example: 

709 

710 msmd.open('my.ms') 

711 # do things with tool 

712 # finish, close tool and free up resources. 

713 msmd.close() 

714 

715 -------------------------------------------------------------------------------- 

716 

717 """ 

718 return _msmetadata.msmetadata_close(self) 

719 

720 

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

722 """ 

723 corrbit(self, _spw) -> casac::variant * 

724 

725 

726 

727 Summary: 

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

729 

730 Description: 

731 

732 

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

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

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

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

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

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

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

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

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

742 of the spws specified. 

743 

744 

745 Input Parameters: 

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

747 

748 Example: 

749 

750 msmd.open('my.ms') 

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

752 cb = msmd.corrbit(spw=2) 

753 msmd.done() 

754 

755 -------------------------------------------------------------------------------- 

756 

757 """ 

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

759 

760 

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

762 """ 

763 corrprodsforpol(self, _pol) -> casac::variant * 

764 

765 

766 

767 Summary: 

768 Get the correlation products associated with the specified polarization ID 

769 

770 Description: 

771 

772 

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

774 

775 

776 Input Parameters: 

777 pol Polarization ID. Must be nonnegative. 

778 

779 Example: 

780 

781 msmd.open('my.ms') 

782 # get correlation products for polarization ID 3 

783 corrprods = msmd.corrprodsforpol(3) 

784 msmd.done() 

785 

786 -------------------------------------------------------------------------------- 

787 

788 """ 

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

790 

791 

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

793 """ 

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

795 

796 

797 

798 Summary: 

799 Get the correlation types associated with the specified polarization ID 

800 

801 Description: 

802 

803 

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

805 

806 

807 Input Parameters: 

808 pol Polarization ID. Must be nonnegative. 

809 

810 Example: 

811 

812 msmd.open('my.ms') 

813 # get correlation types for polarization ID 3 

814 corrtypes = msmd.corrtypesforpol(3) 

815 msmd.done() 

816 

817 -------------------------------------------------------------------------------- 

818 

819 """ 

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

821 

822 

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

824 """ 

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

826 

827 

828 

829 Summary: 

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

831 

832 Description: 

833 

834 

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

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

837 in the selection. 

838 

839 

840 Input Parameters: 

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

842 pol Polarization ID. Less than zero implies any. 

843 

844 Example: 

845 

846 msmd.open('my.ms') 

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

848 msmd.datadescids(spw=2) 

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

850 # polarization ID 3 

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

852 msmd.done() 

853 

854 -------------------------------------------------------------------------------- 

855 

856 """ 

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

858 

859 

860 def done(self): 

861 """ 

862 done(self) -> bool 

863 

864 

865 

866 Summary: 

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

868 

869 Description: 

870 

871 

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

873 

874 

875 Example: 

876 

877 msmd.open('my.ms') 

878 # do things with tool 

879 # finish, close tool and free up resources. 

880 msmd.done() 

881 

882 -------------------------------------------------------------------------------- 

883 

884 """ 

885 return _msmetadata.msmetadata_done(self) 

886 

887 

888 def effexposuretime(self): 

889 """ 

890 effexposuretime(self) -> record * 

891 

892 

893 

894 Summary: 

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

896 

897 Description: 

898 

899 

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

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

902 autocorrelations or rows where FLAG_ROW is false, thusly: 

903 

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

905 

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

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

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

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

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

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

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

913 

914 

915 Example: 

916 

917 msmd.open('my.ms') 

918 # get the effective exposure time. 

919 exposure_time = msmd.effexposuretime() 

920 msmd.done() 

921 

922 -------------------------------------------------------------------------------- 

923 

924 """ 

925 return _msmetadata.msmetadata_effexposuretime(self) 

926 

927 

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

929 """ 

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

931 

932 

933 

934 Summary: 

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

936 

937 Description: 

938 

939 

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

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

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

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

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

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

946 

947 

948 Input Parameters: 

949 scan Scan number. 

950 spwid Spectral window ID. 

951 polid Polarization ID. 

952 obsid Observation ID. 

953 arrayid Array ID. 

954 

955 Example: 

956 

957 msmd.open('my.ms') 

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

959 # for obsid=0 and arrayid=0 

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

961 msmd.done() 

962 

963 -------------------------------------------------------------------------------- 

964 

965 """ 

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

967 

968 

969 def fdmspws(self): 

970 """ 

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

972 

973 

974 

975 Summary: 

976 Get an array of spectral window IDs used for FDM. 

977 

978 Description: 

979 

980 

981 Get an array of spectral window IDs used for FDM. These windows 

982 are defined by the rules in the description of the method 

983 almaspws(). 

984 

985 

986 Example: 

987 

988 msmd.open('my.ms') 

989 # get the spectral window IDs used for FDM. 

990 fdm_spws = msmd.fdmspws() 

991 msmd.done() 

992 

993 -------------------------------------------------------------------------------- 

994 

995 """ 

996 return _msmetadata.msmetadata_fdmspws(self) 

997 

998 

999 def fieldnames(self): 

1000 """ 

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

1002 

1003 

1004 

1005 Summary: 

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

1007 

1008 Description: 

1009 

1010 

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

1012 

1013 

1014 Example: 

1015 

1016 msmd.open('my.ms') 

1017 # get list of field names in the ms 

1018 fieldnames = msmd.fieldnames() 

1019 msmd.done() 

1020 

1021 -------------------------------------------------------------------------------- 

1022 

1023 """ 

1024 return _msmetadata.msmetadata_fieldnames(self) 

1025 

1026 

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

1028 """ 

1029 fieldsforintent(self, _intent, _asnames) -> casac::variant * 

1030 

1031 

1032 

1033 Summary: 

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

1035 

1036 Description: 

1037 

1038 

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

1040 

1041 

1042 Input Parameters: 

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

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

1045 

1046 Example: 

1047 

1048 msmd.open('my.ms') 

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

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

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

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

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

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

1055 msmd.done() 

1056 

1057 -------------------------------------------------------------------------------- 

1058 

1059 """ 

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

1061 

1062 

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

1064 """ 

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

1066 

1067 

1068 

1069 Summary: 

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

1071 

1072 Description: 

1073 

1074 

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

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

1077 

1078 

1079 Input Parameters: 

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

1081 

1082 Example: 

1083 

1084 msmd.open('my.ms') 

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

1086 fields = msmd.fieldsforname('Enceladus') 

1087 msmd.done() 

1088 

1089 -------------------------------------------------------------------------------- 

1090 

1091 """ 

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

1093 

1094 

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

1096 """ 

1097 fieldsforscan(self, _scan, _asnames, _obsid, _arrayid) -> casac::variant * 

1098 

1099 

1100 

1101 Summary: 

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

1103 

1104 Description: 

1105 

1106 

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

1108 

1109 

1110 Input Parameters: 

1111 scan Scan number for which to return the fields. 

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

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

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

1115 

1116 Example: 

1117 

1118 msmd.open('my.ms') 

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

1120 field_names = msmd.fieldsforscan(5, True) 

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

1122 field_IDs = msmd.fieldsforscan(5, False) 

1123 msmd.done() 

1124 

1125 -------------------------------------------------------------------------------- 

1126 

1127 """ 

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

1129 

1130 

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

1132 """ 

1133 fieldsforscans(self, _scans, _asnames, _obsid, _arrayid, _asmap) -> casac::variant * 

1134 

1135 

1136 

1137 Summary: 

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

1139 

1140 Description: 

1141 

1142 

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

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

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

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

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

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

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

1150 

1151 

1152 Input Parameters: 

1153 scans Scan numbers for which to return the fields. 

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

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

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

1157 asmap Return a dictionary mapping scan numbers to fields? 

1158 

1159 Example: 

1160 

1161 msmd.open('my.ms') 

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

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

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

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

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

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

1168 msmd.done() 

1169 

1170 -------------------------------------------------------------------------------- 

1171 

1172 """ 

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

1174 

1175 

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

1177 """ 

1178 fieldsforsource(self, _source, _asnames) -> casac::variant * 

1179 

1180 

1181 

1182 Summary: 

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

1184 

1185 Description: 

1186 

1187 

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

1189 

1190 

1191 Input Parameters: 

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

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

1194 

1195 Example: 

1196 

1197 msmd.open('my.ms') 

1198 # get the field names for source ID 1 

1199 field_names = msmd.fieldsforsource(1, True) 

1200 # get the field IDs for source ID 1 

1201 field_IDs = msmd.fieldsforsource(1, False) 

1202 msmd.done() 

1203 

1204 -------------------------------------------------------------------------------- 

1205 

1206 """ 

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

1208 

1209 

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

1211 """ 

1212 fieldsforsources(self, _asnames) -> record * 

1213 

1214 

1215 

1216 Summary: 

1217 Get a map of source IDs to fields. 

1218 

1219 Description: 

1220 

1221 

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

1223 

1224 

1225 Input Parameters: 

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

1227 

1228 Example: 

1229 

1230 msmd.open('my.ms') 

1231 # get the source to field name map 

1232 sources_to_fields = msmd.fieldsforsources(True) 

1233 # access the field names for source 1 

1234 field = sources_to_fields['1'] 

1235 msmd.done() 

1236 

1237 -------------------------------------------------------------------------------- 

1238 

1239 """ 

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

1241 

1242 

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

1244 """ 

1245 fieldsforspw(self, _spw, _asnames) -> casac::variant * 

1246 

1247 

1248 

1249 Summary: 

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

1251 

1252 Description: 

1253 

1254 

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

1256 

1257 

1258 Input Parameters: 

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

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

1261 

1262 Example: 

1263 

1264 msmd.open('my.ms') 

1265 # get the field names for spectral window 1 

1266 field_names = msmd.fieldsforspw(1, True) 

1267 # get the field IDs for spectral window 1 

1268 field_IDs = msmd.fieldsforspw(1, False) 

1269 msmd.done() 

1270 

1271 -------------------------------------------------------------------------------- 

1272 

1273 """ 

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

1275 

1276 

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

1278 """ 

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

1280 

1281 

1282 

1283 Summary: 

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

1285 

1286 Description: 

1287 

1288 

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

1290 

1291 

1292 Input Parameters: 

1293 time Time at center of time range. 

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

1295 

1296 Example: 

1297 

1298 msmd.open('my.ms') 

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

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

1301 msmd.done() 

1302 

1303 -------------------------------------------------------------------------------- 

1304 

1305 """ 

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

1307 

1308 

1309 def intents(self): 

1310 """ 

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

1312 

1313 

1314 

1315 Summary: 

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

1317 

1318 Description: 

1319 

1320 

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

1322 

1323 

1324 Example: 

1325 

1326 msmd.open('my.ms') 

1327 # get the intents associated with the MS 

1328 intents = msmd.intents() 

1329 msmd.done() 

1330 

1331 -------------------------------------------------------------------------------- 

1332 

1333 """ 

1334 return _msmetadata.msmetadata_intents(self) 

1335 

1336 

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

1338 """ 

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

1340 

1341 

1342 

1343 Summary: 

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

1345 

1346 Description: 

1347 

1348 

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

1350 

1351 

1352 Input Parameters: 

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

1354 

1355 Example: 

1356 

1357 msmd.open('my.ms') 

1358 # get the intents associated with field 4 

1359 intents = msmd.intentsforfield(4) 

1360 # get intents for field 'MOS' 

1361 intents2 = msmd.intentsforfield('MOS') 

1362 msmd.done() 

1363 

1364 -------------------------------------------------------------------------------- 

1365 

1366 """ 

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

1368 

1369 

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

1371 """ 

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

1373 

1374 

1375 

1376 Summary: 

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

1378 

1379 Description: 

1380 

1381 

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

1383 

1384 

1385 Input Parameters: 

1386 scan Scan number for which to return the intents. 

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

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

1389 

1390 Example: 

1391 

1392 msmd.open('my.ms') 

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

1394 intents = msmd.intentsforscan(4) 

1395 msmd.done() 

1396 

1397 -------------------------------------------------------------------------------- 

1398 

1399 """ 

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

1401 

1402 

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

1404 """ 

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

1406 

1407 

1408 

1409 Summary: 

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

1411 

1412 Description: 

1413 

1414 

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

1416 

1417 

1418 Input Parameters: 

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

1420 

1421 Example: 

1422 

1423 msmd.open('my.ms') 

1424 # get the intents associated with spectral window ID 3 

1425 intents = msmd.intentsforspw(3) 

1426 msmd.done() 

1427 

1428 -------------------------------------------------------------------------------- 

1429 

1430 """ 

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

1432 

1433 

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

1435 """ 

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

1437 

1438 

1439 

1440 Summary: 

1441 Get the mean frequency for the specified spectral window. 

1442 

1443 Description: 

1444 

1445 

1446 Get the mean frequency for the specified spectral window. 

1447 

1448 

1449 Input Parameters: 

1450 spw Spectral window ID. 

1451 unit Convert frequencies to this unit. 

1452 

1453 Example: 

1454 

1455 msmd.open('my.ms') 

1456 # get the mean frequency for spectral window 2. 

1457 mean_freq = msmd.meanfreq(2) 

1458 msmd.done() 

1459 

1460 -------------------------------------------------------------------------------- 

1461 

1462 """ 

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

1464 

1465 

1466 def name(self): 

1467 """ 

1468 name(self) -> string 

1469 

1470 

1471 

1472 Summary: 

1473 Get the name of the attached MS. 

1474 

1475 Description: 

1476 

1477 

1478 Get the name of the attached MS. 

1479 

1480 

1481 Example: 

1482 

1483 msmd.open('my.ms') 

1484 # get its name 

1485 myname = msmd.name() 

1486 msmd.done() 

1487 

1488 -------------------------------------------------------------------------------- 

1489 

1490 """ 

1491 return _msmetadata.msmetadata_name(self) 

1492 

1493 

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

1495 """ 

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

1497 

1498 

1499 

1500 Summary: 

1501 Get the name of the specified field. 

1502 

1503 Description: 

1504 

1505 

1506 Get the name of the specified field. 

1507 

1508 

1509 Input Parameters: 

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

1511 

1512 Example: 

1513 

1514 msmd.open('my.ms') 

1515 # get the name for field 8 and 2. 

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

1517 # get all field names 

1518 all_field_nams = namesforfields() 

1519 msmd.done() 

1520 

1521 -------------------------------------------------------------------------------- 

1522 

1523 """ 

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

1525 

1526 

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

1528 """ 

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

1530 

1531 

1532 

1533 Summary: 

1534 Get the name of the specified spws. 

1535 

1536 Description: 

1537 

1538 

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

1540 

1541 

1542 Input Parameters: 

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

1544 

1545 Example: 

1546 

1547 msmd.open('my.ms') 

1548 # get the name for spws 8 and 2. 

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

1550 # get all spw names 

1551 all_spw_names = msmd.namesforspws() 

1552 msmd.done() 

1553 

1554 -------------------------------------------------------------------------------- 

1555 

1556 """ 

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

1558 

1559 

1560 def nantennas(self): 

1561 """ 

1562 nantennas(self) -> long 

1563 

1564 

1565 

1566 Summary: 

1567 Get the number of antennas associated with the MS. 

1568 

1569 Description: 

1570 

1571 

1572 Get the number of antennas associated with the MS. 

1573 

1574 

1575 Example: 

1576 

1577 msmd.open('my.ms') 

1578 number_of_antennas = msmd.nantennas() 

1579 msmd.done() 

1580 

1581 -------------------------------------------------------------------------------- 

1582 

1583 """ 

1584 return _msmetadata.msmetadata_nantennas(self) 

1585 

1586 

1587 def narrays(self): 

1588 """ 

1589 narrays(self) -> long 

1590 

1591 

1592 

1593 Summary: 

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

1595 

1596 Description: 

1597 

1598 

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

1600 

1601 

1602 Example: 

1603 

1604 msmd.open('my.ms') 

1605 number_of_array_ids = msmd.narrays() 

1606 msmd.done() 

1607 

1608 -------------------------------------------------------------------------------- 

1609 

1610 """ 

1611 return _msmetadata.msmetadata_narrays(self) 

1612 

1613 

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

1615 """ 

1616 nbaselines(self, _ac) -> long 

1617 

1618 

1619 

1620 Summary: 

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

1622 

1623 Description: 

1624 

1625 

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

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

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

1629 

1630 

1631 Input Parameters: 

1632 ac Include auto-correlation 'baselines'? 

1633 

1634 Example: 

1635 

1636 msmd.open('my.ms') 

1637 number_of_baselines = msmd.nbaselines() 

1638 number_of_baselines_including_ac = msmd.nbaselines(True) 

1639 msmd.done() 

1640 

1641 -------------------------------------------------------------------------------- 

1642 

1643 """ 

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

1645 

1646 

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

1648 """ 

1649 nchan(self, _spw) -> long 

1650 

1651 

1652 

1653 Summary: 

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

1655 

1656 Description: 

1657 

1658 

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

1660 

1661 

1662 Input Parameters: 

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

1664 

1665 Example: 

1666 

1667 msmd.open('my.ms') 

1668 nchan = msmd.nchan(3) 

1669 msmd.done() 

1670 

1671 -------------------------------------------------------------------------------- 

1672 

1673 """ 

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

1675 

1676 

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

1678 """ 

1679 ncorrforpol(self, _polid) -> casac::variant * 

1680 

1681 

1682 

1683 Summary: 

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

1685 

1686 Description: 

1687 

1688 

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

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

1691 

1692 

1693 Input Parameters: 

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

1695 

1696 Example: 

1697 

1698 msmd.open('my.ms') 

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

1700 polid = msmd.ncorrforpol(4) 

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

1702 polids = msmd.ncorrforpol(-1) 

1703 msmd.done() 

1704 

1705 -------------------------------------------------------------------------------- 

1706 

1707 """ 

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

1709 

1710 

1711 def nfields(self): 

1712 """ 

1713 nfields(self) -> long 

1714 

1715 

1716 

1717 Summary: 

1718 Get the number of fields associated with the MS. 

1719 

1720 Description: 

1721 

1722 

1723 Get the number of fields associated with the MS. 

1724 

1725 

1726 Example: 

1727 

1728 msmd.open('my.ms') 

1729 number_of_fields = msmd.nfields() 

1730 msmd.done() 

1731 

1732 -------------------------------------------------------------------------------- 

1733 

1734 """ 

1735 return _msmetadata.msmetadata_nfields(self) 

1736 

1737 

1738 def nobservations(self): 

1739 """ 

1740 nobservations(self) -> long 

1741 

1742 

1743 

1744 Summary: 

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

1746 

1747 Description: 

1748 

1749 

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

1751 

1752 

1753 Example: 

1754 

1755 msmd.open('my.ms') 

1756 number_of_obs_ids = msmd.nobservations() 

1757 msmd.done() 

1758 

1759 -------------------------------------------------------------------------------- 

1760 

1761 """ 

1762 return _msmetadata.msmetadata_nobservations(self) 

1763 

1764 

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

1766 """ 

1767 nspw(self, _includewvr) -> long 

1768 

1769 

1770 

1771 Summary: 

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

1773 

1774 Description: 

1775 

1776 

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

1778 

1779 

1780 Input Parameters: 

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

1782 

1783 Example: 

1784 

1785 msmd.open('my.ms') 

1786 number_of_spectral_windows = msmd.nspw() 

1787 msmd.done() 

1788 

1789 -------------------------------------------------------------------------------- 

1790 

1791 """ 

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

1793 

1794 

1795 def nstates(self): 

1796 """ 

1797 nstates(self) -> long 

1798 

1799 

1800 

1801 Summary: 

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

1803 

1804 Description: 

1805 

1806 

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

1808 

1809 

1810 Example: 

1811 

1812 msmd.open('my.ms') 

1813 number_of_states = msmd.nstates() 

1814 msmd.done() 

1815 

1816 -------------------------------------------------------------------------------- 

1817 

1818 """ 

1819 return _msmetadata.msmetadata_nstates(self) 

1820 

1821 

1822 def nscans(self): 

1823 """ 

1824 nscans(self) -> long 

1825 

1826 

1827 

1828 Summary: 

1829 Get the number of scans associated with the MS. 

1830 

1831 Description: 

1832 

1833 

1834 Get the number of scans associated with the MS. 

1835 

1836 

1837 Example: 

1838 

1839 msmd.open('my.ms') 

1840 number_of_scans = msmd.nscans() 

1841 msmd.done() 

1842 

1843 -------------------------------------------------------------------------------- 

1844 

1845 """ 

1846 return _msmetadata.msmetadata_nscans(self) 

1847 

1848 

1849 def nsources(self): 

1850 """ 

1851 nsources(self) -> long 

1852 

1853 

1854 

1855 Summary: 

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

1857 

1858 Description: 

1859 

1860 

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

1862 SOURCE table may be greater than this value. 

1863 

1864 

1865 Example: 

1866 

1867 msmd.open('my.ms') 

1868 number_of_unique_source_ids = msmd.nsources() 

1869 msmd.done() 

1870 

1871 -------------------------------------------------------------------------------- 

1872 

1873 """ 

1874 return _msmetadata.msmetadata_nsources(self) 

1875 

1876 

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

1878 """ 

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

1880 

1881 

1882 

1883 Summary: 

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

1885 

1886 Description: 

1887 

1888 

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

1890 

1891 

1892 Input Parameters: 

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

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

1895 

1896 Example: 

1897 

1898 msmd.open('my.ms') 

1899 # get the total number of rows 

1900 nrows = msmd.nrows() 

1901 # got the number of cross correlation rows 

1902 ncross = msmd.nrows(auto=False) 

1903 # get the number of unflagged rows 

1904 ngood = msmd.nrows(flagged=False) 

1905 # get the number of unflagged cross correlation rows 

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

1907 msmd.done() 

1908 

1909 -------------------------------------------------------------------------------- 

1910 

1911 """ 

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

1913 

1914 

1915 def observers(self): 

1916 """ 

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

1918 

1919 

1920 

1921 Summary: 

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

1923 

1924 Description: 

1925 

1926 

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

1928 

1929 

1930 Example: 

1931 

1932 msmd.open('my.ms') 

1933 # get the observers 

1934 observers = msmd.observers() 

1935 msmd.done() 

1936 

1937 -------------------------------------------------------------------------------- 

1938 

1939 """ 

1940 return _msmetadata.msmetadata_observers(self) 

1941 

1942 

1943 def observatorynames(self): 

1944 """ 

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

1946 

1947 

1948 

1949 Summary: 

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

1951 

1952 Description: 

1953 

1954 

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

1956 

1957 

1958 Example: 

1959 

1960 msmd.open('my.ms') 

1961 # get the telescope names 

1962 telescope_names = msmd.telescopenames() 

1963 msmd.done() 

1964 

1965 -------------------------------------------------------------------------------- 

1966 

1967 """ 

1968 return _msmetadata.msmetadata_observatorynames(self) 

1969 

1970 

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

1972 """ 

1973 observatoryposition(self, _which) -> record * 

1974 

1975 

1976 

1977 Summary: 

1978 Get the position of the specified telescope. 

1979 

1980 Description: 

1981 

1982 

1983 Get the position of the specified telescope. 

1984 

1985 

1986 Input Parameters: 

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

1988 

1989 Example: 

1990 

1991 msmd.open('my.ms') 

1992 # get the position of the 0th telescope 

1993 telescope_position = msmd.telescopeposition(0) 

1994 msmd.done() 

1995 

1996 -------------------------------------------------------------------------------- 

1997 

1998 """ 

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

2000 

2001 

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

2003 """ 

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

2005 

2006 

2007 

2008 Summary: 

2009 Attach the MS metadata tool to the specified MS 

2010 

2011 Description: 

2012 

2013 

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

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

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

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

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

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

2020 

2021 

2022 Input Parameters: 

2023 msfile Name of the existing measurement set 

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

2025 

2026 Example: 

2027 

2028 msmd.open('my.ms') 

2029 # do stuff and close it 

2030 msmd.done() 

2031 

2032 -------------------------------------------------------------------------------- 

2033 

2034 """ 

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

2036 

2037 

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

2039 """ 

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

2041 

2042 

2043 

2044 Summary: 

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

2046 

2047 Description: 

2048 

2049 

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

2051 

2052 

2053 Input Parameters: 

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

2055 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 

2056 

2057 Example: 

2058 

2059 msmd.open('my.ms') 

2060 # get phasecenter for field ID 1 

2061 mydir = msmd.phasecenter(1); 

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

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

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

2065 mydir2=msmd.phasecenter(2, ep) 

2066 msmd.done() 

2067 

2068 -------------------------------------------------------------------------------- 

2069 

2070 """ 

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

2072 

2073 

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

2075 """ 

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

2077 

2078 

2079 

2080 Summary: 

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

2082 

2083 Description: 

2084 

2085 

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

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

2088 

2089 

2090 Input Parameters: 

2091 rownum Row number in the main MS table. 

2092 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) 

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

2094 

2095 Example: 

2096 

2097 msmd.open('my.ms') 

2098 # get the pointing directions for row ID 500 

2099 dirs = msmd.pointingdirection(500) 

2100 msmd.done() 

2101 

2102 -------------------------------------------------------------------------------- 

2103 

2104 """ 

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

2106 

2107 

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

2109 """ 

2110 polidfordatadesc(self, _ddid) -> casac::variant * 

2111 

2112 

2113 

2114 Summary: 

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

2116 

2117 Description: 

2118 

2119 

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

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

2122 

2123 

2124 Input Parameters: 

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

2126 

2127 Example: 

2128 

2129 msmd.open('my.ms') 

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

2131 polid = msmd.polidfordatadesc(3) 

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

2133 polids = msmd.polidfordatadesc(-1) 

2134 msmd.done() 

2135 

2136 -------------------------------------------------------------------------------- 

2137 

2138 """ 

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

2140 

2141 

2142 def projects(self): 

2143 """ 

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

2145 

2146 

2147 

2148 Summary: 

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

2150 

2151 Description: 

2152 

2153 

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

2155 

2156 

2157 Example: 

2158 

2159 msmd.open('my.ms') 

2160 # get the projects 

2161 projects = msmd.projects() 

2162 msmd.done() 

2163 

2164 -------------------------------------------------------------------------------- 

2165 

2166 """ 

2167 return _msmetadata.msmetadata_projects(self) 

2168 

2169 

2170 def propermotions(self): 

2171 """ 

2172 propermotions(self) -> record * 

2173 

2174 

2175 

2176 Summary: 

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

2178 

2179 Description: 

2180 

2181 

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

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

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

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

2186 

2187 

2188 Example: 

2189 

2190 msmd.open('my.ms') 

2191 # get PROPER_MOTION column values from the SOURCE table 

2192 mu = msmd.propermotions() 

2193 msmd.done() 

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

2195 mu10 = mu['10'] 

2196 

2197 -------------------------------------------------------------------------------- 

2198 

2199 """ 

2200 return _msmetadata.msmetadata_propermotions(self) 

2201 

2202 

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

2204 """ 

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

2206 

2207 

2208 

2209 Summary: 

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

2211 

2212 Description: 

2213 

2214 

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

2216 

2217 

2218 Input Parameters: 

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

2220 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 

2221 

2222 Example: 

2223 

2224 msmd.open('my.ms') 

2225 # get reference direction for field ID 1 

2226 mydir = msmd.refdir(1); 

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

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

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

2230 mydir2=msmd.phasecenter(2, ep) 

2231 msmd.done() 

2232 

2233 -------------------------------------------------------------------------------- 

2234 

2235 """ 

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

2237 

2238 

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

2240 """ 

2241 reffreq(self, _spw) -> record * 

2242 

2243 

2244 

2245 Summary: 

2246 Get the reference frequency of the specified spectral window. 

2247 

2248 Description: 

2249 

2250 

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

2252 the form of a valid measures dictionary. 

2253 

2254 

2255 Input Parameters: 

2256 spw Zero-based spectral window ID. 

2257 

2258 Example: 

2259 

2260 msmd.open('my.ms') 

2261 # get the reference frequency for spw ID 20 

2262 reffreq = msmd.reffreq(20) 

2263 msmd.done() 

2264 

2265 -------------------------------------------------------------------------------- 

2266 

2267 """ 

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

2269 

2270 

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

2272 """ 

2273 restfreqs(self, _sourceid, _spw) -> casac::variant * 

2274 

2275 

2276 

2277 Summary: 

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

2279 

2280 Description: 

2281 

2282 

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

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

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

2286 

2287 

2288 Input Parameters: 

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

2290 spw Zero-based spectral window ID. 

2291 

2292 Example: 

2293 

2294 msmd.open('my.ms') 

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

2296 reffreq = msmd.restfreqs(2, 20) 

2297 msmd.done() 

2298 

2299 -------------------------------------------------------------------------------- 

2300 

2301 """ 

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

2303 

2304 

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

2306 """ 

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

2308 

2309 

2310 

2311 Summary: 

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

2313 

2314 Description: 

2315 

2316 

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

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

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

2320 checked to determine if the receiver band value is encoded 

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

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

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

2324 If the corresponding spectral window can be found in the 

2325 ASDM_RECEIVER table, then the corresponding frequencyBand column 

2326 value is checked to determine if the receiver band information 

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

2328 present in multiple cells of the spectralWindowId column, the 

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

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

2331 specified spectral window. 

2332 

2333 

2334 Input Parameters: 

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

2336 

2337 Example: 

2338 

2339 msmd.open('my.ms') 

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

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

2342 # get all receiver bands 

2343 all_rx_bands = msmd.rxbands() 

2344 msmd.done() 

2345 

2346 -------------------------------------------------------------------------------- 

2347 

2348 """ 

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

2350 

2351 

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

2353 """ 

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

2355 

2356 

2357 

2358 Summary: 

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

2360 

2361 Description: 

2362 

2363 

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

2365 

2366 

2367 Input Parameters: 

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

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

2370 

2371 Example: 

2372 

2373 msmd.open('my.ms') 

2374 # scan numbers for all obsids and all arrayids 

2375 scan_numbers = msmd.scannumbers() 

2376 msmd.done() 

2377 

2378 -------------------------------------------------------------------------------- 

2379 

2380 """ 

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

2382 

2383 

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

2385 """ 

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

2387 

2388 

2389 

2390 Summary: 

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

2392 

2393 Description: 

2394 

2395 

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

2397 

2398 

2399 Input Parameters: 

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

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

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

2403 

2404 Example: 

2405 

2406 msmd.open('my.ms') 

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

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

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

2410 scan_numbers = msmd.scansforfield(5) 

2411 msmd.done() 

2412 

2413 -------------------------------------------------------------------------------- 

2414 

2415 """ 

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

2417 

2418 

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

2420 """ 

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

2422 

2423 

2424 

2425 Summary: 

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

2427 

2428 Description: 

2429 

2430 

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

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

2433 be non-negative. 

2434 

2435 

2436 Input Parameters: 

2437 obsid Observation ID. Must be non-negative. 

2438 arrayid Array ID. Must be non-negative. 

2439 

2440 Example: 

2441 

2442 msmd.open('my.ms') 

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

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

2445 # access the scans associated with field ID 2 

2446 field_to_scans2 = field_to_scans['2'] 

2447 msmd.done() 

2448 

2449 -------------------------------------------------------------------------------- 

2450 

2451 """ 

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

2453 

2454 

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

2456 """ 

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

2458 

2459 

2460 

2461 Summary: 

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

2463 

2464 Description: 

2465 

2466 

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

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

2469 

2470 

2471 Input Parameters: 

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

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

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

2475 

2476 Example: 

2477 

2478 msmd.open('my.ms') 

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

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

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

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

2483 msmd.done() 

2484 

2485 -------------------------------------------------------------------------------- 

2486 

2487 """ 

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

2489 

2490 

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

2492 """ 

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

2494 

2495 

2496 

2497 Summary: 

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

2499 

2500 Description: 

2501 

2502 

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

2504 

2505 

2506 Input Parameters: 

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

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

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

2510 

2511 Example: 

2512 

2513 msmd.open('my.ms') 

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

2515 scan_numbers = msmd.scansforspw(14) 

2516 msmd.done() 

2517 

2518 -------------------------------------------------------------------------------- 

2519 

2520 """ 

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

2522 

2523 

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

2525 """ 

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

2527 

2528 

2529 

2530 Summary: 

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

2532 

2533 Description: 

2534 

2535 

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

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

2538 be non-negative. 

2539 

2540 

2541 Input Parameters: 

2542 obsid Observation ID. Must be non-negative. 

2543 arrayid Array ID. Must be non-negative. 

2544 

2545 Example: 

2546 

2547 msmd.open('my.ms') 

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

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

2550 # access the scans associated with spw ID 2 

2551 spw_to_scans2 = spw_to_scans['2'] 

2552 msmd.done() 

2553 

2554 -------------------------------------------------------------------------------- 

2555 

2556 """ 

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

2558 

2559 

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

2561 """ 

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

2563 

2564 

2565 

2566 Summary: 

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

2568 

2569 Description: 

2570 

2571 

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

2573 

2574 

2575 Input Parameters: 

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

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

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

2579 

2580 Example: 

2581 

2582 msmd.open('my.ms') 

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

2584 scans = msmd.scansforstate(2) 

2585 msmd.done() 

2586 

2587 -------------------------------------------------------------------------------- 

2588 

2589 """ 

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

2591 

2592 

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

2594 """ 

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

2596 

2597 

2598 

2599 Summary: 

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

2601 

2602 Description: 

2603 

2604 

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

2606 

2607 

2608 Input Parameters: 

2609 time Time at center of time range. 

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

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

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

2613 

2614 Example: 

2615 

2616 msmd.open('my.ms') 

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

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

2619 msmd.done() 

2620 

2621 -------------------------------------------------------------------------------- 

2622 

2623 """ 

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

2625 

2626 

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

2628 """ 

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

2630 

2631 

2632 

2633 Summary: 

2634 Get the schedule information for the specified observation ID. 

2635 

2636 Description: 

2637 

2638 

2639 Get the schedule information for the specified observation ID. 

2640 

2641 

2642 Input Parameters: 

2643 obsid Observation ID. 

2644 

2645 Example: 

2646 

2647 msmd.open('my.ms') 

2648 # get the schdule information for observation ID = 2 

2649 schedule = msmd.schedule()[2] 

2650 msmd.done() 

2651 

2652 -------------------------------------------------------------------------------- 

2653 

2654 """ 

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

2656 

2657 

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

2659 """ 

2660 sideband(self, _spw) -> long 

2661 

2662 

2663 

2664 Summary: 

2665 Get the sideband for the specified spectral window. 

2666 

2667 Description: 

2668 

2669 

2670 Get the sideband for the specified spectral window. 

2671 

2672 

2673 Input Parameters: 

2674 spw Spectral window ID. 

2675 

2676 Example: 

2677 

2678 msmd.open('my.ms') 

2679 # get sideband for spectral window 2. 

2680 sideband = msmd.sideband(2) 

2681 msmd.done() 

2682 

2683 -------------------------------------------------------------------------------- 

2684 

2685 """ 

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

2687 

2688 

2689 def sourcedirs(self): 

2690 """ 

2691 sourcedirs(self) -> record * 

2692 

2693 

2694 

2695 Summary: 

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

2697 

2698 Description: 

2699 

2700 

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

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

2703 in the returned dictionary is a valid direction measure. 

2704 

2705 

2706 Example: 

2707 

2708 msmd.open('my.ms') 

2709 # get DIRECTION column values from the SOURCE table 

2710 sourcedirs = msmd.sourcedirs() 

2711 msmd.done() 

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

2713 dir10 = sourcedirs['10'] 

2714 # convert it to B1950, using the measure interface 

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

2716 

2717 -------------------------------------------------------------------------------- 

2718 

2719 """ 

2720 return _msmetadata.msmetadata_sourcedirs(self) 

2721 

2722 

2723 def sourcetimes(self): 

2724 """ 

2725 sourcetimes(self) -> record * 

2726 

2727 

2728 

2729 Summary: 

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

2731 

2732 Description: 

2733 

2734 

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

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

2737 in the returned dictionary is a valid time quantity. 

2738 

2739 

2740 Example: 

2741 

2742 msmd.open('my.ms') 

2743 # get TIME column values from the SOURCE table 

2744 sourcetimes = msmd.sourcetimes() 

2745 msmd.done() 

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

2747 time10 = sourcetimes['10'] 

2748 

2749 -------------------------------------------------------------------------------- 

2750 

2751 """ 

2752 return _msmetadata.msmetadata_sourcetimes(self) 

2753 

2754 

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

2756 """ 

2757 sourceidforfield(self, _field) -> long 

2758 

2759 

2760 

2761 Summary: 

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

2763 

2764 Description: 

2765 

2766 

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

2768 

2769 

2770 Input Parameters: 

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

2772 

2773 Example: 

2774 

2775 msmd.open('my.ms') 

2776 # get source ID associated with field ID 2 

2777 sourceid = msmd.sourceidforfield(2) 

2778 msmd.done() 

2779 

2780 -------------------------------------------------------------------------------- 

2781 

2782 """ 

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

2784 

2785 

2786 def sourceidsfromsourcetable(self): 

2787 """ 

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

2789 

2790 

2791 

2792 Summary: 

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

2794 

2795 Description: 

2796 

2797 

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

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

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

2801 

2802 

2803 Example: 

2804 

2805 msmd.open('my.ms') 

2806 # get SOURCE_ID column values from the SOURCE table 

2807 sourceids = msmd.sourceidsfromsourcetable() 

2808 msmd.done() 

2809 

2810 -------------------------------------------------------------------------------- 

2811 

2812 """ 

2813 return _msmetadata.msmetadata_sourceidsfromsourcetable(self) 

2814 

2815 

2816 def sourcenames(self): 

2817 """ 

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

2819 

2820 

2821 

2822 Summary: 

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

2824 

2825 Description: 

2826 

2827 

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

2829 

2830 

2831 Example: 

2832 

2833 msmd.open('my.ms') 

2834 # get SOURCE_NAME column values from the SOURCE table 

2835 sourcenames = msmd.sourcenames() 

2836 msmd.done() 

2837 

2838 -------------------------------------------------------------------------------- 

2839 

2840 """ 

2841 return _msmetadata.msmetadata_sourcenames(self) 

2842 

2843 

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

2845 """ 

2846 spwsforbaseband(self, _baseband, _sqldmode) -> casac::variant * 

2847 

2848 

2849 

2850 Summary: 

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

2852 

2853 Description: 

2854 

2855 

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

2857 

2858 

2859 Input Parameters: 

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

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

2862 

2863 Example: 

2864 

2865 msmd.open('my.ms') 

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

2867 basebandtospwdict = msmd.spwsforbasebands() 

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

2869 spwsforbb2 = msmd.spwsforbasebands(2) 

2870 msmd.done() 

2871 

2872 -------------------------------------------------------------------------------- 

2873 

2874 """ 

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

2876 

2877 

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

2879 """ 

2880 spwfordatadesc(self, _ddid) -> casac::variant * 

2881 

2882 

2883 

2884 Summary: 

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

2886 

2887 Description: 

2888 

2889 

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

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

2892 

2893 

2894 Input Parameters: 

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

2896 

2897 Example: 

2898 

2899 msmd.open('my.ms') 

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

2901 spw = msmd.spwfordatadesc(3) 

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

2903 spws = msmd.spwfordatadesc(-1) 

2904 msmd.done() 

2905 

2906 -------------------------------------------------------------------------------- 

2907 

2908 """ 

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

2910 

2911 

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

2913 """ 

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

2915 

2916 

2917 

2918 Summary: 

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

2920 

2921 Description: 

2922 

2923 

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

2925 

2926 

2927 Input Parameters: 

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

2929 

2930 Example: 

2931 

2932 msmd.open('my.ms') 

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

2934 spws = msmd.spwsforfield('Fomalhaut') 

2935 # get spectral window IDs associated with field ID 2 

2936 spws = msmd.spwsforfield(2) 

2937 msmd.done() 

2938 

2939 -------------------------------------------------------------------------------- 

2940 

2941 """ 

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

2943 

2944 

2945 def spwsforfields(self): 

2946 """ 

2947 spwsforfields(self) -> record * 

2948 

2949 

2950 

2951 Summary: 

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

2953 

2954 Description: 

2955 

2956 

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

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

2959 

2960 

2961 Example: 

2962 

2963 msmd.open('my.ms') 

2964 # get the map of field IDs to spw IDs 

2965 field_to_spw_map = msmd.spwsforfields() 

2966 spws_for_field_5 = field_to_spw_map[str(5)] 

2967 msmd.done() 

2968 

2969 -------------------------------------------------------------------------------- 

2970 

2971 """ 

2972 return _msmetadata.msmetadata_spwsforfields(self) 

2973 

2974 

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

2976 """ 

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

2978 

2979 

2980 

2981 Summary: 

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

2983 

2984 Description: 

2985 

2986 

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

2988 

2989 

2990 Input Parameters: 

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

2992 

2993 Example: 

2994 

2995 msmd.open('my.ms') 

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

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

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

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

3000 msmd.done() 

3001 msmd.done() 

3002 

3003 -------------------------------------------------------------------------------- 

3004 

3005 """ 

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

3007 

3008 

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

3010 """ 

3011 spwsfornames(self, _spwids) -> record * 

3012 

3013 

3014 

3015 Summary: 

3016 Get the IDs of the specified spw names. 

3017 

3018 Description: 

3019 

3020 

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

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

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

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

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

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

3027 entire data set. 

3028 

3029 

3030 Input Parameters: 

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

3032 

3033 Example: 

3034 

3035 msmd.open('my.ms') 

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

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

3038 # get the complete spw name to ID map 

3039 spw_names_to_ids = msmd.spwsfornames() 

3040 msmd.done() 

3041 

3042 -------------------------------------------------------------------------------- 

3043 

3044 """ 

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

3046 

3047 

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

3049 """ 

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

3051 

3052 

3053 

3054 Summary: 

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

3056 

3057 Description: 

3058 

3059 

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

3061 

3062 

3063 Input Parameters: 

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

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

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

3067 

3068 Example: 

3069 

3070 msmd.open('my.ms') 

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

3072 spws = msmd.spwsforscan(20) 

3073 msmd.done() 

3074 

3075 -------------------------------------------------------------------------------- 

3076 

3077 """ 

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

3079 

3080 

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

3082 """ 

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

3084 

3085 

3086 

3087 Summary: 

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

3089 

3090 Description: 

3091 

3092 

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

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

3095 

3096 

3097 Input Parameters: 

3098 obsid Observation ID. Must be non-negative. 

3099 arrayid Array ID. Must be non-negative. 

3100 

3101 Example: 

3102 

3103 msmd.open('my.ms') 

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

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

3106 # access the spws associated with scan 2 

3107 spws_for_scan2 = scan_to_spws['2'] 

3108 msmd.done() 

3109 

3110 -------------------------------------------------------------------------------- 

3111 

3112 """ 

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

3114 

3115 

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

3117 """ 

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

3119 

3120 

3121 

3122 Summary: 

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

3124 

3125 Description: 

3126 

3127 

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

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

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

3131 indicates that a subwindow number could be determined. 

3132 

3133 

3134 Input Parameters: 

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

3136 

3137 Example: 

3138 

3139 msmd.open('my.ms') 

3140 # get the subwindows for spws 8 and 2. 

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

3142 # get all subwindows 

3143 all_sws = msmd.subwindows() 

3144 msmd.done() 

3145 

3146 -------------------------------------------------------------------------------- 

3147 

3148 """ 

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

3150 

3151 

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

3153 """ 

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

3155 

3156 

3157 

3158 Summary: 

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

3160 

3161 Description: 

3162 

3163 

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

3165 

3166 

3167 Input Parameters: 

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

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

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

3171 

3172 Example: 

3173 

3174 msmd.open('my.ms') 

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

3176 states = msmd.statesforscan(251) 

3177 msmd.done() 

3178 

3179 -------------------------------------------------------------------------------- 

3180 

3181 """ 

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

3183 

3184 

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

3186 """ 

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

3188 

3189 

3190 

3191 Summary: 

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

3193 

3194 Description: 

3195 

3196 

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

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

3199 

3200 

3201 Input Parameters: 

3202 obsid Observation ID, must be nonnegative. 

3203 arrayid Array ID, must be nonnegative. 

3204 

3205 Example: 

3206 

3207 msmd.open('my.ms') 

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

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

3210 states_for_scan_5 = scans_to_states[str(5)] 

3211 msmd.done() 

3212 

3213 -------------------------------------------------------------------------------- 

3214 

3215 """ 

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

3217 

3218 

3219 def summary(self): 

3220 """ 

3221 summary(self) -> record * 

3222 

3223 

3224 

3225 Summary: 

3226 Get dictionary summarizing the MS. 

3227 

3228 Description: 

3229 

3230 

3231 Get dictionary summarizing the MS. 

3232 

3233 

3234 Example: 

3235 

3236 msmd.open('my.ms') 

3237 # get the summary 

3238 summary = msmd.summary() 

3239 msmd.done() 

3240 

3241 -------------------------------------------------------------------------------- 

3242 

3243 """ 

3244 return _msmetadata.msmetadata_summary(self) 

3245 

3246 

3247 def tdmspws(self): 

3248 """ 

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

3250 

3251 

3252 

3253 Summary: 

3254 Get an array of spectral window IDs used for TDM. 

3255 

3256 Description: 

3257 

3258 

3259 Get an array of spectral window IDs used for TDM. These windows 

3260 are defined by the rules in the description of the method 

3261 almaspws(). 

3262 

3263 

3264 Example: 

3265 

3266 msmd.open('my.ms') 

3267 # get the spectral window IDs used for TDM. 

3268 tdm_spws = msmd.tdmspws() 

3269 msmd.done() 

3270 

3271 -------------------------------------------------------------------------------- 

3272 

3273 """ 

3274 return _msmetadata.msmetadata_tdmspws(self) 

3275 

3276 

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

3278 """ 

3279 timerangeforobs(self, _obsid) -> record * 

3280 

3281 

3282 

3283 Summary: 

3284 Get the time range for the specified observation ID 

3285 

3286 Description: 

3287 

3288 

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

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

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

3292 half-intervals are added or subtracted. 

3293 

3294 

3295 Input Parameters: 

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

3297 

3298 Example: 

3299 

3300 msmd.open('my.ms') 

3301 # get the time range associated with observation ID 3 

3302 timerange = msmd.timerangeforobs(3) 

3303 msmd.done() 

3304 

3305 -------------------------------------------------------------------------------- 

3306 

3307 """ 

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

3309 

3310 

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

3312 """ 

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

3314 

3315 

3316 

3317 Summary: 

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

3319 

3320 Description: 

3321 

3322 

3323 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. 

3324 

3325 

3326 Input Parameters: 

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

3328 

3329 Example: 

3330 

3331 msmd.open('my.ms') 

3332 # get the times associated with field 3 

3333 times = msmd.timesforfield(3) 

3334 msmd.done() 

3335 

3336 -------------------------------------------------------------------------------- 

3337 

3338 """ 

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

3340 

3341 

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

3343 """ 

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

3345 

3346 

3347 

3348 Summary: 

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

3350 

3351 Description: 

3352 

3353 

3354 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. 

3355 

3356 

3357 Input Parameters: 

3358 intent Intent for which to return the times. 

3359 

3360 Example: 

3361 

3362 msmd.open('my.ms') 

3363 # get the times associated with intent 'myintent' 

3364 times = msmd.timesforintent('myintent') 

3365 msmd.done() 

3366 

3367 -------------------------------------------------------------------------------- 

3368 

3369 """ 

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

3371 

3372 

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

3374 """ 

3375 timesforscan(self, _scan, _obsid, _arrayid, _perspw) -> casac::variant * 

3376 

3377 

3378 

3379 Summary: 

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

3381 

3382 Description: 

3383 

3384 

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

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

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

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

3389 

3390 

3391 Input Parameters: 

3392 scan Scan number for which to return the times. 

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

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

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

3396 

3397 Example: 

3398 

3399 msmd.open('my.ms') 

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

3401 times = msmd.timesforscan(10) 

3402 msmd.done() 

3403 

3404 -------------------------------------------------------------------------------- 

3405 

3406 """ 

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

3408 

3409 

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

3411 """ 

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

3413 

3414 

3415 

3416 Summary: 

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

3418 

3419 Description: 

3420 

3421 

3422 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. 

3423 

3424 

3425 Input Parameters: 

3426 scans Scan number(s) for which to return the times. 

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

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

3429 

3430 Example: 

3431 

3432 msmd.open('my.ms') 

3433 # get the times associated with scan numbers 10 and 20, all obsids, all arrayids 

3434 times = msmd.timesforscans([10,20]) 

3435 msmd.done() 

3436 

3437 -------------------------------------------------------------------------------- 

3438 

3439 """ 

3440 return _msmetadata.msmetadata_timesforscans(self, *args, **kwargs) 

3441 

3442 

3443 def timesforspws(self, *args, **kwargs): 

3444 """ 

3445 timesforspws(self, _spw) -> casac::variant * 

3446 

3447 

3448 

3449 Summary: 

3450 Get the unique times corresponding to the specified spectral window(s). 

3451 

3452 Description: 

3453 

3454 

3455 Get the unique times corresponding to the specified spectral window(s). The input indicates the 

3456 spws for which times are to be retrieved, and can be a single integer or an array of 

3457 integers. If a single, non-negative integer, an array of unique times associated with 

3458 that spectral window are returned. Otherwise, a dictionary of times associated with the 

3459 specified spectral windows are returned, with the spws (as strings) as the keys and the 

3460 times as the values. A negative integer will cause a dictionary of all spws and their 

3461 associated times to be returned. 

3462 

3463 

3464 Input Parameters: 

3465 spw Zero-based spectral window ID(s). A negative integer will cause the all the times for all spws to be returned. 

3466 

3467 Example: 

3468 

3469 msmd.open('my.ms') 

3470 # get the times associated with spws 10 and 20 

3471 times = msmd.timesforspws([10,20]) 

3472 # print the times for spw 10 

3473 print times['10'] 

3474 msmd.done() 

3475 

3476 -------------------------------------------------------------------------------- 

3477 

3478 """ 

3479 return _msmetadata.msmetadata_timesforspws(self, *args, **kwargs) 

3480 

3481 

3482 def transitions(self, *args, **kwargs): 

3483 """ 

3484 transitions(self, _sourceid, _spw) -> casac::variant * 

3485 

3486 

3487 

3488 Summary: 

3489 Get the spectral transitions from the SOURCE table for the specified source and spectral window. 

3490 

3491 Description: 

3492 

3493 

3494 Get the spectral transitions from the SOURCE table for the specified source and spectral window. 

3495 The return value will be an array of transitions if the transitions are 

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

3497 

3498 

3499 Input Parameters: 

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

3501 spw Zero-based spectral window ID. 

3502 

3503 Example: 

3504 

3505 msmd.open('my.ms') 

3506 # get the transitions for source ID 2 and spw ID 20 

3507 reffreq = msmd.transitions(2, 20) 

3508 msmd.done() 

3509 

3510 -------------------------------------------------------------------------------- 

3511 

3512 """ 

3513 return _msmetadata.msmetadata_transitions(self, *args, **kwargs) 

3514 

3515 

3516 def wvrspws(self, *args, **kwargs): 

3517 """ 

3518 wvrspws(self, _complement) -> std::vector< long > 

3519 

3520 

3521 

3522 Summary: 

3523 Get an array of spectral window IDs used for WVR. These are windows that have 4 channels. 

3524 

3525 Description: 

3526 

3527 

3528 

3529 Get an array of spectral window IDs used for WVR. These are windows that have 4 channels. 

3530 If complement is True, return the complement set instead (all non-wvr spw IDs). WVR windows 

3531 are identified using the algorithm 

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

3533 name 'WVR#NOMINAL' and report these. 

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

3535 

3536 

3537 Input Parameters: 

3538 complement If True, return all non-wvr spws. 

3539 

3540 Example: 

3541 

3542 msmd.open('my.ms') 

3543 # get the spectral window IDs used for WVR. 

3544 wvr_spws = msmd.wvrspws() 

3545 msmd.done() 

3546 

3547 -------------------------------------------------------------------------------- 

3548 

3549 """ 

3550 return _msmetadata.msmetadata_wvrspws(self, *args, **kwargs) 

3551 

3552 __swig_destroy__ = _msmetadata.delete_msmetadata 

3553 __del__ = lambda self: None 

3554msmetadata_swigregister = _msmetadata.msmetadata_swigregister 

3555msmetadata_swigregister(msmetadata) 

3556 

3557# This file is compatible with both classic and new-style classes. 

3558 

3559