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

27 statements  

« prev     ^ index     » next       coverage.py v7.6.4, created at 2024-11-01 07:19 +0000

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

2##################### 9fcdaf90a9119a91d27be1bef9c08703 ############################## 

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_importnro import importnro as _importnro_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 _importnro: 

15 """ 

16 importnro ---- Convert NOSTAR data into a CASA visibility file (MS) 

17 

18  

19 Task importnro enables one to convert the data obtained with the 

20 NRO45m telescope into the CASA MS2 format. At this moment, only the 

21 OTF data (NOSTAR data) obtained with the SAM45 spectrometer is 

22 supported, and the OTF data obtained with the other spectrometers 

23 (e.g., AOS) and the PSW data (NEWSTAR data) are outside of scope 

24 (Jan./25/2017) 

25 

26 --------- parameter descriptions --------------------------------------------- 

27 

28 infile Name of input NOSTAR data 

29 Default: none 

30 outputvis Root name of the ms to be created. Note the .ms is NOT 

31 added  

32 Default: none 

33  

34 Example: outputvis='myms.ms' 

35 overwrite Over write an existing MS(s) 

36 Default: False (do not overwrite) 

37 Options: False|True 

38 parallel Turn on parallel execution 

39 Default: False (serial execution) 

40 Options: False|True 

41 RETURNS bool 

42 

43 --------- examples ----------------------------------------------------------- 

44 

45  

46 FOR MORE INFORMATION, SEE THE TASK PAGES OF IMPORTNRO IN CASA DOCS: 

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

48  

49 

50 

51 """ 

52 

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

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

55 

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

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

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

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

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

61 task_result = None 

62 try: 

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

64 except Exception as exc: 

65 _except_log('importnro', exc) 

66 raise 

67 finally: 

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

69 return task_result 

70 

71importnro = _importnro( ) 

72