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

168 statements  

« prev     ^ index     » next       coverage.py v7.6.4, created at 2024-10-31 19:10 +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, '_utils')).lstrip('.') 

13 try: 

14 return importlib.import_module(mname) 

15 except ImportError: 

16 return importlib.import_module('_utils') 

17 _utils = 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('_utils', [dirname(__file__)]) 

26 except ImportError: 

27 import _utils 

28 return _utils 

29 try: 

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

31 finally: 

32 if fp is not None: 

33 fp.close() 

34 return _mod 

35 _utils = swig_import_helper() 

36 del swig_import_helper 

37else: 

38 import _utils 

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 utils(_object): 

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

100 

101 __swig_setmethods__ = {} 

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

103 __swig_getmethods__ = {} 

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

105 __repr__ = _swig_repr 

106 

107 def __init__(self): 

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

109 this = _utils.new_utils() 

110 try: 

111 self.this.append(this) 

112 except __builtin__.Exception: 

113 self.this = this 

114 

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

116 """ 

117 getrc(self, _rcvar) -> string 

118 

119 

120 

121 Input Parameters: 

122 rcvar Returns the value of the rc variable given. If no value is give it returns the root directory of CASA. 

123 

124 -------------------------------------------------------------------------------- 

125 

126 """ 

127 return _utils.utils_getrc(self, *args, **kwargs) 

128 

129 

130 def removetable(self, *args, **kwargs): 

131 """ 

132 removetable(self, _tablenames) -> bool 

133 

134 

135 

136 Input Parameters: 

137 tablenames Removes tables safely 

138 

139 -------------------------------------------------------------------------------- 

140 

141 """ 

142 return _utils.utils_removetable(self, *args, **kwargs) 

143 

144 

145 def tableinfo(self, *args, **kwargs): 

146 """ 

147 tableinfo(self, _tablename) -> record * 

148 

149 

150 

151 Summary: 

152 Get information about a particular table 

153 

154 Description: 

155 

156 

157 Currently this only returns the pid of the process locking the table (lockpid), if the lock 

158 is permanent (lockperm), and the status (lockstatus) -- 'not in use', 'open', 'read', 'write', 

159 or 'unknown'. However, the hope is that this will eventually return a complete description of 

160 the table. 

161 

162 

163 Input Parameters: 

164 tablename path to table 

165 

166 -------------------------------------------------------------------------------- 

167 

168 """ 

169 return _utils.utils_tableinfo(self, *args, **kwargs) 

170 

171 

172 def lockedtables(self): 

173 """ 

174 lockedtables(self) -> std::vector< std::string > 

175 

176 

177 

178 Summary: 

179 get the tables locked by this process 

180 

181 -------------------------------------------------------------------------------- 

182 

183 """ 

184 return _utils.utils_lockedtables(self) 

185 

186 

187 def hostinfo(self): 

188 """ 

189 hostinfo(self) -> record * 

190 

191 

192 

193 Summary: 

194 returns host information 

195 

196 -------------------------------------------------------------------------------- 

197 

198 """ 

199 return _utils.utils_hostinfo(self) 

200 

201 

202 def c_exception(self): 

203 """ 

204 c_exception(self) -> string 

205 

206 

207 

208 Summary: 

209 Returns detailed information about last C-level exception 

210 

211 Description: 

212 

213 Returns detailed information from the last CASA C++ exception (i.e., AipsError). The 

214 exception message and the stack trace (mangled; use the shell's c++filt to demangle) 

215 from the last CASA C++ exception. The information is from the last one generated 

216 and may not represent an exception from the last action; c_exception_clear can be 

217 used to remove stale information. The information's exception might also 

218 have been caught in the C++ code and not have been translated into a Python-level 

219 exception. 

220 

221 

222 -------------------------------------------------------------------------------- 

223 

224 """ 

225 return _utils.utils_c_exception(self) 

226 

227 

228 def c_exception_clear(self): 

229 """ 

230 c_exception_clear(self) 

231 

232 

233 

234 Summary: 

235 Clears information about last C-level exception 

236 

237 Description: 

238 

239 Clears the CASA C++ exception information. This allows the user to be sure that 

240 information retrieved using c_exception is not from an exception in the 

241 distant past. 

242 

243 

244 -------------------------------------------------------------------------------- 

245 

246 """ 

247 return _utils.utils_c_exception_clear(self) 

248 

249 

250 def _trigger_segfault(self, *args, **kwargs): 

251 """ 

252 _trigger_segfault(self, _faultType) -> bool 

253 

254 

255 

256 Summary: 

257 Crashes casa with segfault. 

258 

259 Description: 

260 

261 

262 This triggers a segfault for testing the crash reporter. Obviously you 

263 shouldn't call this unless that's what you want. It's in here for 

264 development/debugging purposes and ought to be removed before you see this. 

265 

266 

267 Input Parameters: 

268 faultType How to kill the program 

269 

270 -------------------------------------------------------------------------------- 

271 

272 """ 

273 return _utils.utils__trigger_segfault(self, *args, **kwargs) 

274 

275 

276 def tryit(self, *args, **kwargs): 

277 """ 

278 tryit(self, _input) -> double 

279 

280 

281 

282 Description: 

283 

284 

285 test variant convesion 

286 

287 Input Parameters: 

288 input testing variant 

289 

290 -------------------------------------------------------------------------------- 

291 

292 """ 

293 return _utils.utils_tryit(self, *args, **kwargs) 

294 

295 

296 def maxint(self): 

297 """ 

298 maxint(self) -> long 

299 

300 

301 

302 Description: 

303 

304 maximum number an C++ int can hold 

305 

306 -------------------------------------------------------------------------------- 

307 

308 """ 

309 return _utils.utils_maxint(self) 

310 

311 

312 def minint(self): 

313 """ 

314 minint(self) -> long 

315 

316 

317 

318 Description: 

319 

320 minimum number an C++ int can hold 

321 

322 -------------------------------------------------------------------------------- 

323 

324 """ 

325 return _utils.utils_minint(self) 

326 

327 

328 def maxlong(self): 

329 """ 

330 maxlong(self) -> long 

331 

332 

333 

334 Description: 

335 

336 maximum number an C++ long can hold 

337 

338 -------------------------------------------------------------------------------- 

339 

340 """ 

341 return _utils.utils_maxlong(self) 

342 

343 

344 def minlong(self): 

345 """ 

346 minlong(self) -> long 

347 

348 

349 

350 Description: 

351 

352 minimum number an C++ long can hold 

353 

354 -------------------------------------------------------------------------------- 

355 

356 """ 

357 return _utils.utils_minlong(self) 

358 

359 

360 def initialize(self, *args, **kwargs): 

361 """ 

362 initialize(self, _python_path, _distro_data_path, _default_path, _nogui, _agg, _pipeline, _cachedir) -> bool 

363 

364 

365 

366 Summary: 

367 initialize CASAtools 

368 

369 Description: 

370 

371 

372 returns true if initalization was performed; returns false if initialization was already done 

373 

374 Input Parameters: 

375 python_path path to python executable 

376 distro_data_path path to the data provided by the casadata pkg 

377 default_path directories that should constitute the default data path 

378 nogui are guis disabled at startup 

379 agg was the graphical backend disabled at startup 

380 pipeline was the pipeline included at startup 

381 cachedir the cachedir used in configuration at startup 

382 

383 -------------------------------------------------------------------------------- 

384 

385 """ 

386 return _utils.utils_initialize(self, *args, **kwargs) 

387 

388 

389 def rundata(self): 

390 """ 

391 rundata(self) -> string 

392 

393 

394 

395 Summary: 

396 path to the measures data 

397 

398 Description: 

399 

400 path to the measures data. This function is deprecated measurespath should be used instead. 

401 

402 -------------------------------------------------------------------------------- 

403 

404 """ 

405 return _utils.utils_rundata(self) 

406 

407 

408 def measurespath(self): 

409 """ 

410 measurespath(self) -> string 

411 

412 

413 

414 Summary: 

415 path to the measures data 

416 

417 Description: 

418 

419 path to the measures data 

420 

421 -------------------------------------------------------------------------------- 

422 

423 """ 

424 return _utils.utils_measurespath(self) 

425 

426 

427 def setrundata(self, *args, **kwargs): 

428 """ 

429 setrundata(self, _path) 

430 

431 

432 

433 Summary: 

434 set path to the measures data 

435 

436 Description: 

437 

438 

439 Set path to the measures data. Must be called during initalization 

440 before Measures module is initialized. This function is deprecated. 

441 setmeasurespath should be used instead. 

442 

443 Input Parameters: 

444 path path to IERS data 

445 

446 -------------------------------------------------------------------------------- 

447 

448 """ 

449 return _utils.utils_setrundata(self, *args, **kwargs) 

450 

451 

452 def setmeasurespath(self, *args, **kwargs): 

453 """ 

454 setmeasurespath(self, _path) 

455 

456 

457 

458 Summary: 

459 set path to the measures data 

460 

461 Description: 

462 

463 

464 Set path to the measures data. Must be called during initalization 

465 before Measures module is initialized. 

466 

467 Input Parameters: 

468 path path to IERS data 

469 

470 -------------------------------------------------------------------------------- 

471 

472 """ 

473 return _utils.utils_setmeasurespath(self, *args, **kwargs) 

474 

475 

476 def defaultpath(self): 

477 """ 

478 defaultpath(self) -> std::vector< std::string > 

479 

480 

481 

482 Summary: 

483 returns the default data path 

484 

485 Description: 

486 

487 

488 Returns the default data path. This path is used unless the user has set the current path to something else using the setpath function. 

489 

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

491 

492 """ 

493 return _utils.utils_defaultpath(self) 

494 

495 

496 def setpath(self, *args, **kwargs): 

497 """ 

498 setpath(self, _dirs) -> bool 

499 

500 

501 

502 Summary: 

503 sets the data path to the specified list of directories 

504 

505 Description: 

506 

507 

508 Sets the data path to the specified list of directories. Returns true if all directories were added 

509 returns false otherwise. 

510 

511 Input Parameters: 

512 dirs directories that should constitute the data path 

513 

514 -------------------------------------------------------------------------------- 

515 

516 """ 

517 return _utils.utils_setpath(self, *args, **kwargs) 

518 

519 

520 def getpath(self): 

521 """ 

522 getpath(self) -> std::vector< std::string > 

523 

524 

525 

526 Summary: 

527 retrieves the data path 

528 

529 Description: 

530 

531 

532 Returns the list of directories that are currently in the data path. 

533 

534 -------------------------------------------------------------------------------- 

535 

536 """ 

537 return _utils.utils_getpath(self) 

538 

539 

540 def clearpath(self): 

541 """ 

542 clearpath(self) 

543 

544 

545 

546 Summary: 

547 removes all directories from the data path 

548 

549 Description: 

550 

551 

552 Removes all directories from the data path. 

553 

554 -------------------------------------------------------------------------------- 

555 

556 """ 

557 return _utils.utils_clearpath(self) 

558 

559 

560 def resolve(self, *args, **kwargs): 

561 """ 

562 resolve(self, _path) -> string 

563 

564 

565 

566 Summary: 

567 resolve a complete path from a subdirectory using the data path 

568 

569 Description: 

570 

571 

572 If the provided path already represents a file or a directory, it is returned. If it does not, 

573 this function tries to find a complete path by matching up this partial directory with the 

574 elements of the data path. 

575 

576 Input Parameters: 

577 path path to be expanded 

578 

579 -------------------------------------------------------------------------------- 

580 

581 """ 

582 return _utils.utils_resolve(self, *args, **kwargs) 

583 

584 

585 def getnogui(self): 

586 """ 

587 getnogui(self) -> bool 

588 

589 

590 

591 Summary: 

592 gets the nogui config value 

593 

594 Description: 

595 

596 

597 Returns the value of the nogui parameter used at startup. Defaults to False. 

598 

599 

600 -------------------------------------------------------------------------------- 

601 

602 """ 

603 return _utils.utils_getnogui(self) 

604 

605 

606 def getagg(self): 

607 """ 

608 getagg(self) -> bool 

609 

610 

611 

612 Summary: 

613 gets the agg config value 

614 

615 Description: 

616 

617 

618 Returns the value of the agg parameter used at startup. Defaults to False. 

619 

620 

621 -------------------------------------------------------------------------------- 

622 

623 """ 

624 return _utils.utils_getagg(self) 

625 

626 

627 def getpipeline(self): 

628 """ 

629 getpipeline(self) -> bool 

630 

631 

632 

633 Summary: 

634 gets the pipeline config value 

635 

636 Description: 

637 

638 

639 Returns the value of the pipeline parameter used at startup. Defaults to False. 

640 

641 

642 -------------------------------------------------------------------------------- 

643 

644 """ 

645 return _utils.utils_getpipeline(self) 

646 

647 

648 def getcachedir(self): 

649 """ 

650 getcachedir(self) -> string 

651 

652 

653 

654 Summary: 

655 gets the cachedir config value 

656 

657 Description: 

658 

659 

660 Returns the value of the cachedir parameter used at startup. 

661 

662 

663 -------------------------------------------------------------------------------- 

664 

665 """ 

666 return _utils.utils_getcachedir(self) 

667 

668 

669 def registry(self): 

670 """ 

671 registry(self) -> record * 

672 

673 

674 

675 Summary: 

676 retrieve registry information 

677 

678 Description: 

679 

680 

681 returns record containing the URI for the CASAtools registry which can be used by other unix processes to access the registry 

682 

683 -------------------------------------------------------------------------------- 

684 

685 """ 

686 return _utils.utils_registry(self) 

687 

688 

689 def services(self): 

690 """ 

691 services(self) -> record * 

692 

693 

694 

695 Summary: 

696 retrieve registered services 

697 

698 Description: 

699 

700 

701 returns record containing the information about the services that have been registered with CASAtools 

702 

703 -------------------------------------------------------------------------------- 

704 

705 """ 

706 return _utils.utils_services(self) 

707 

708 

709 def remove_service(self, *args, **kwargs): 

710 """ 

711 remove_service(self, _uri) -> bool 

712 

713 

714 

715 Summary: 

716 remove a service using its URI 

717 

718 Description: 

719 

720 

721 Remove a service from the registry using the URI for the 

722 service. The URI should be a string that looks something 

723 like '0.0.0.0:34101'. This function returns true if the 

724 removal was successful. Otherwise, it returns false. 

725 

726 Input Parameters: 

727 uri uri (Address) of the service to remove. 

728 

729 -------------------------------------------------------------------------------- 

730 

731 """ 

732 return _utils.utils_remove_service(self, *args, **kwargs) 

733 

734 

735 def shutdown(self): 

736 """ 

737 shutdown(self) 

738 

739 

740 

741 Summary: 

742 shutdown signal from python 

743 

744 Description: 

745 

746 

747 python is shutting down cleanup anything that is outstanding 

748 

749 -------------------------------------------------------------------------------- 

750 

751 """ 

752 return _utils.utils_shutdown(self) 

753 

754 

755 def getpython(self): 

756 """ 

757 getpython(self) -> string 

758 

759 

760 

761 Summary: 

762 get path to python executable 

763 

764 -------------------------------------------------------------------------------- 

765 

766 """ 

767 return _utils.utils_getpython(self) 

768 

769 

770 def version(self): 

771 """ 

772 version(self) -> std::vector< long > 

773 

774 

775 

776 Summary: 

777 returns four element vector for the version 

778 

779 Description: 

780 

781 

782 

783 Returns a four element vector representing the version (major, minor, patch and feature). 

784 

785 -------------------------------------------------------------------------------- 

786 

787 """ 

788 return _utils.utils_version(self) 

789 

790 

791 def version_variant(self): 

792 """ 

793 version_variant(self) -> string 

794 

795 

796 

797 Summary: 

798 returns the target instrument f.e. ALMA or VLA 

799 

800 Description: 

801 

802 

803 

804 Returns the target instrument. This helps distinguish versions that otherwise may have the same version number 

805 

806 -------------------------------------------------------------------------------- 

807 

808 """ 

809 return _utils.utils_version_variant(self) 

810 

811 

812 def version_desc(self): 

813 """ 

814 version_desc(self) -> string 

815 

816 

817 

818 Summary: 

819 returns the descriptive version string, e.g. DEV or REL 

820 

821 Description: 

822 

823 

824 

825 The descriptive string describes a particular packaged version. During a development 

826 cycle there are different sorts of packaged distributions. For example, a development 

827 version ('DEV') or a release version ('REL'). 

828 

829 -------------------------------------------------------------------------------- 

830 

831 """ 

832 return _utils.utils_version_desc(self) 

833 

834 

835 def version_info(self): 

836 """ 

837 version_info(self) -> string 

838 

839 

840 

841 Summary: 

842 Returns the complete version description as a string. 

843 

844 Description: 

845 

846 

847 

848 Returns a description string that includes the version information and the descriptive string.. 

849 

850 -------------------------------------------------------------------------------- 

851 

852 """ 

853 return _utils.utils_version_info(self) 

854 

855 

856 def version_string(self): 

857 """ 

858 version_string(self) -> string 

859 

860 

861 

862 Summary: 

863 Returns the complete version description as a string but without the description (i.e. git hash) string. 

864 

865 Description: 

866 

867 

868 

869 Returns a description string that includes the version information and the descriptive string.. 

870 

871 -------------------------------------------------------------------------------- 

872 

873 """ 

874 return _utils.utils_version_string(self) 

875 

876 

877 def compare_version(self, *args, **kwargs): 

878 """ 

879 compare_version(self, _comparitor, _vec) -> bool 

880 

881 

882 

883 Summary: 

884 Returns the complete version description as a string. 

885 

886 Description: 

887 

888 

889 

890 Returns a description string that includes the version information and the descriptive string.. 

891 

892 Input Parameters: 

893 comparitor what sort of comparison to do, one of >, <, <=, >=, ==, = != 

894 vec vector to use to compare current version number against vec 

895 

896 -------------------------------------------------------------------------------- 

897 

898 """ 

899 return _utils.utils_compare_version(self, *args, **kwargs) 

900 

901 __swig_destroy__ = _utils.delete_utils 

902 __del__ = lambda self: None 

903utils_swigregister = _utils.utils_swigregister 

904utils_swigregister(utils) 

905 

906# This file is compatible with both classic and new-style classes. 

907 

908