Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatasks/exportasdm.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 exportasdm.xml ################ 

2##################### 93407dc85aee418fc32630beafea5dfc ############################## 

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_exportasdm import exportasdm as _exportasdm_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 _exportasdm: 

15 """ 

16 exportasdm ---- Convert a CASA visibility file (MS) into an ALMA or EVLA Science Data Model 

17 

18  

19 Convert a CASA visibility file (MS) into an ALMA or EVLA Science Data Model 

20 

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

22 

23 vis Name of input visibility file 

24 Default: none 

25  

26 Example: vis='ngc5921.ms' 

27 asdm Name of output ASDM directory (on disk) 

28 Default: none 

29 datacolumn Which data column(s) to use for processing 

30 (case-insensitive). 

31 Default: 'corrected' 

32 Options: 'data', 'model', 'corrected', 

33 'all','float_data', 'lag_data', 

34 'float_data,data', 'lag_data,data' 

35  

36 Example: datacolumn='data' 

37  

38 NOTE: 'all' = whichever of the above that are 

39 present. If the requested column does not exist, 

40 the task will exit with an error. 

41 archiveid The X0 in uid://X0/X1/X2 

42 Default: 'S0' 

43 rangeid The X1 in uid://X0/X1/X2 

44 Default: 'X1' 

45 subscanduration Maximum duration of a subscan in the output ASDM 

46 Default: 24h 

47 sbduration Maximum duration of a scheduling block (and therefore 

48 exec block) in the output ASDM 

49 Default: '2700s' 

50  

51 The sbduration parameter controls the number of 

52 execution blocks (EBs) into which exportasdm 

53 subdivides the visibilities from your input 

54 MS. If the total observation time in the MS is 

55 shorter than what is given in sbduration, a 

56 single EB will be created. 

57 apcorrected Data to be marked as having atmospheric phase correction 

58 Default: False 

59 Options: False|True 

60 verbose Produce log output? 

61 Default: True 

62 Options: True|False 

63 RETURNS bool 

64 

65 --------- examples ----------------------------------------------------------- 

66 

67  

68  

69 For more information, see the task pages of exportasdm in CASA Docs: 

70  

71 https://casa.nrao.edu/casadocs/ 

72  

73  

74 

75 

76 """ 

77 

78 _info_group_ = """import/export""" 

79 _info_desc_ = """Convert a CASA visibility file (MS) into an ALMA or EVLA Science Data Model""" 

80 

81 def __call__( self, vis='', asdm='', datacolumn='data', archiveid='S0', rangeid='X1', subscanduration='24h', sbduration='2700s', apcorrected=False, verbose=True ): 

82 schema = {'vis': {'type': 'cReqPath', 'coerce': _coerce.expand_path}, 'asdm': {'type': 'cPath', 'coerce': _coerce.expand_path}, 'datacolumn': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'DATA', 'model', 'corrected', 'CORRECTED', 'MODEL', 'data' ]}, 'archiveid': {'type': 'cStr', 'coerce': _coerce.to_str}, 'rangeid': {'type': 'cStr', 'coerce': _coerce.to_str}, 'subscanduration': {'type': 'cStr', 'coerce': _coerce.to_str}, 'sbduration': {'type': 'cStr', 'coerce': _coerce.to_str}, 'apcorrected': {'type': 'cBool'}, 'verbose': {'type': 'cBool'}} 

83 doc = {'vis': vis, 'asdm': asdm, 'datacolumn': datacolumn, 'archiveid': archiveid, 'rangeid': rangeid, 'subscanduration': subscanduration, 'sbduration': sbduration, 'apcorrected': apcorrected, 'verbose': verbose} 

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

85 _logging_state_ = _start_log( 'exportasdm', [ 'vis=' + repr(_pc.document['vis']), 'asdm=' + repr(_pc.document['asdm']), 'datacolumn=' + repr(_pc.document['datacolumn']), 'archiveid=' + repr(_pc.document['archiveid']), 'rangeid=' + repr(_pc.document['rangeid']), 'subscanduration=' + repr(_pc.document['subscanduration']), 'sbduration=' + repr(_pc.document['sbduration']), 'apcorrected=' + repr(_pc.document['apcorrected']), 'verbose=' + repr(_pc.document['verbose']) ] ) 

86 task_result = None 

87 try: 

88 task_result = _exportasdm_t( _pc.document['vis'], _pc.document['asdm'], _pc.document['datacolumn'], _pc.document['archiveid'], _pc.document['rangeid'], _pc.document['subscanduration'], _pc.document['sbduration'], _pc.document['apcorrected'], _pc.document['verbose'] ) 

89 except Exception as exc: 

90 _except_log('exportasdm', exc) 

91 raise 

92 finally: 

93 task_result = _end_log( _logging_state_, 'exportasdm', task_result ) 

94 return task_result 

95 

96exportasdm = _exportasdm( ) 

97