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

27 statements  

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

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

2##################### fd7e58d81ab4ab0e310f3539c4d4f84b ############################## 

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_importgmrt import importgmrt as _importgmrt_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 _importgmrt: 

15 """ 

16 importgmrt ---- Convert a UVFITS file to a CASA visibility data set 

17 

18  

19 Convert a GRMT FITS file to a CASA visiblity data set. 

20 Also read GMRT flag file(s) and flag data based on the contents of the 

21 files. 

22  

23 

24 --------- parameter descriptions --------------------------------------------- 

25 

26 fitsfile Name of input UV FITS file 

27 Default: none 

28  

29 Example: fitsimage='3C273XC1.fits' 

30 flagfile List of files containing flagging information. 

31 Default: none 

32  

33 Examples: 

34 flagfile='3c273XC1.flag' 

35 flagfile=['3c273Cc1_1.flag','3c273Cc2_1.flag','] 

36 vis Name of input visibility file 

37 Default: none 

38  

39 Example: vis='ngc5921.ms' 

40 

41 --------- examples ----------------------------------------------------------- 

42 

43  

44 FOR MORE INFORMATION, SEE THE TASK PAGES OF IMPORTGMRT IN CASA DOCS: 

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

46  

47 

48 

49 """ 

50 

51 _info_group_ = """import/export""" 

52 _info_desc_ = """Convert a UVFITS file to a CASA visibility data set""" 

53 

54 def __call__( self, fitsfile='', flagfile='', vis='' ): 

55 schema = {'fitsfile': {'type': 'cReqPath', 'coerce': _coerce.expand_path}, 'flagfile': {'anyof': [{'type': 'cStr', 'coerce': _coerce.to_str}, {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}]}, 'vis': {'type': 'cStr', 'coerce': _coerce.to_str}} 

56 doc = {'fitsfile': fitsfile, 'flagfile': flagfile, 'vis': vis} 

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

58 _logging_state_ = _start_log( 'importgmrt', [ 'fitsfile=' + repr(_pc.document['fitsfile']), 'flagfile=' + repr(_pc.document['flagfile']), 'vis=' + repr(_pc.document['vis']) ] ) 

59 task_result = None 

60 try: 

61 task_result = _importgmrt_t( _pc.document['fitsfile'], _pc.document['flagfile'], _pc.document['vis'] ) 

62 except Exception as exc: 

63 _except_log('importgmrt', exc) 

64 raise 

65 finally: 

66 task_result = _end_log( _logging_state_, 'importgmrt', task_result ) 

67 return task_result 

68 

69importgmrt = _importgmrt( ) 

70