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

27 statements  

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

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

2##################### 0c3a13a91049d6b017e5c5d3709f67d1 ############################## 

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_listfits import listfits as _listfits_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 _listfits: 

15 """ 

16 listfits ---- List the HDU and typical data rows of a fits file: 

17 

18  

19 List the HDU and typical data rows of a fits file: 

20 The list will be given in the logger. 

21  

22 

23 --------- parameter descriptions --------------------------------------------- 

24 

25 fitsfile Name of input fits file 

26 RETURNS void 

27 

28 --------- examples ----------------------------------------------------------- 

29 

30  

31  

32 The HDU and typical data rows in a fits file are listed in the logger. 

33  

34 Keyword arguments: 

35 fitsfile -- Name of input fits file 

36 default: none; example: fitsfile='ngc5921.uvfits' 

37  

38 

39 

40 """ 

41 

42 _info_group_ = """information""" 

43 _info_desc_ = """List the HDU and typical data rows of a fits file:""" 

44 

45 def __call__( self, fitsfile='' ): 

46 schema = {'fitsfile': {'type': 'cReqPath', 'coerce': _coerce.expand_path}} 

47 doc = {'fitsfile': fitsfile} 

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

49 _logging_state_ = _start_log( 'listfits', [ 'fitsfile=' + repr(_pc.document['fitsfile']) ] ) 

50 task_result = None 

51 try: 

52 task_result = _listfits_t( _pc.document['fitsfile'] ) 

53 except Exception as exc: 

54 _except_log('listfits', exc) 

55 raise 

56 finally: 

57 task_result = _end_log( _logging_state_, 'listfits', task_result ) 

58 return task_result 

59 

60listfits = _listfits( ) 

61