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

27 statements  

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

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

2##################### ec65ab2cf2f174bd09d7fa23ffac8585 ############################## 

3from __future__ import absolute_import 

4import numpy 

5from casatools.typecheck import CasaValidator as _val_ctor 

6_pc = _val_ctor( ) 

7from casatools.coercetype import coerce as _coerce 

8from casatools.errors import create_error_string 

9from .private.task_importasap import importasap as _importasap_t 

10from casatasks.private.task_logging import start_log as _start_log 

11from casatasks.private.task_logging import end_log as _end_log 

12from casatasks.private.task_logging import except_log as _except_log 

13 

14class _importasap: 

15 """ 

16 importasap ---- Convert ASAP Scantable data into a CASA visibility file (MS) 

17 

18  

19 Convert ASAP Scantable data into a CASA visibility file (MS) 

20 

21 --------- parameter descriptions --------------------------------------------- 

22 

23 infile Name of input ASAP Scantable data 

24 Default: none 

25  

26 Example: infile='mydata.asap' 

27 outputvis Name of output visibility file 

28 Default: '' (same as vis) 

29  

30 Example: outputvis='myms.ms' 

31  

32 NOTE: Note the .ms is NOT added 

33 flagbackup Back up flag column before applying flags. 

34 Default: True 

35 Options: True|False 

36 overwrite Over write an existing MS(s) 

37 Default: False (do not overwrite) 

38 Options: False|True 

39 parallel Turn on parallel execution 

40 Default: False (serial execution) 

41 Options: False|True 

42 RETURNS bool 

43 

44 --------- examples ----------------------------------------------------------- 

45 

46  

47  

48  

49 

50 

51 """ 

52 

53 _info_group_ = """single dish, import/export""" 

54 _info_desc_ = """Convert ASAP Scantable data into a CASA visibility file (MS)""" 

55 

56 def __call__( self, infile='', outputvis='', flagbackup=True, overwrite=False, parallel=False ): 

57 schema = {'infile': {'type': 'cReqPath', 'coerce': _coerce.expand_path}, 'outputvis': {'type': 'cStr', 'coerce': _coerce.to_str}, 'flagbackup': {'type': 'cBool'}, 'overwrite': {'type': 'cBool'}, 'parallel': {'type': 'cBool'}} 

58 doc = {'infile': infile, 'outputvis': outputvis, 'flagbackup': flagbackup, 'overwrite': overwrite, 'parallel': parallel} 

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

60 _logging_state_ = _start_log( 'importasap', [ 'infile=' + repr(_pc.document['infile']), 'outputvis=' + repr(_pc.document['outputvis']), 'flagbackup=' + repr(_pc.document['flagbackup']), 'overwrite=' + repr(_pc.document['overwrite']), 'parallel=' + repr(_pc.document['parallel']) ] ) 

61 task_result = None 

62 try: 

63 task_result = _importasap_t( _pc.document['infile'], _pc.document['outputvis'], _pc.document['flagbackup'], _pc.document['overwrite'], _pc.document['parallel'] ) 

64 except Exception as exc: 

65 _except_log('importasap', exc) 

66 raise 

67 finally: 

68 task_result = _end_log( _logging_state_, 'importasap', task_result ) 

69 return task_result 

70 

71importasap = _importasap( ) 

72