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

2##################### b97c8caa49b03fa97c3ecc3acb949cc7 ############################## 

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_listsdm import listsdm as _listsdm_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 _listsdm: 

15 """ 

16 listsdm ---- Lists observation information present in an SDM directory. 

17 

18 Given an SDM directory, this task will print observation information to the logger and return a dictionary keyed by scan. 

19 

20 --------- parameter descriptions --------------------------------------------- 

21 

22 sdm Name of input SDM directory 

23 RETURNS void 

24 

25 --------- examples ----------------------------------------------------------- 

26 

27  

28  

29 The listsdm task reads SDM XML tables, processes the 

30 observation information contained therein, and prints this 

31 information to the CASA log. It will also return a dictionary 

32 keyed on scan number. The dictionary contains the following 

33 information: 

34  

35 'baseband' list of baseband name(s) 

36 'chanwidth' list of channel widths (Hz) 

37 'end' observation end time (UTC) 

38 'field' field ID 

39 'intent' scan intent(s) 

40 'nchan' list of number of channels 

41 'nsubs' number of subscans 

42 'reffreq' list of reference frequencies (Hz) 

43 'source' source name 

44 'spws' list of spectral windows 

45 'start' observation start time (UTC) 

46 'timerange' start time - end time range (UTC) 

47  

48 Example: 

49  

50 myscans = listsdm(sdm='AS1039_sb1382796_2_000.55368.51883247685') 

51  

52 Prints information about the requested SDM to the CASA logger 

53 and returns a dictionary with scan information in 'myscans'. 

54  

55 Keyword argument: 

56  

57 sdm -- Name of input SDM directory. 

58 example: sdm='AG836_sb1377811_1.55345.300883159725' 

59  

60  

61 

62 

63 """ 

64 

65 _info_group_ = """information""" 

66 _info_desc_ = """Lists observation information present in an SDM directory.""" 

67 

68 def __call__( self, sdm='' ): 

69 schema = {'sdm': {'type': 'cReqPath', 'coerce': _coerce.expand_path}} 

70 doc = {'sdm': sdm} 

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

72 _logging_state_ = _start_log( 'listsdm', [ 'sdm=' + repr(_pc.document['sdm']) ] ) 

73 task_result = None 

74 try: 

75 task_result = _listsdm_t( _pc.document['sdm'] ) 

76 except Exception as exc: 

77 _except_log('listsdm', exc) 

78 raise 

79 finally: 

80 task_result = _end_log( _logging_state_, 'listsdm', task_result ) 

81 return task_result 

82 

83listsdm = _listsdm( ) 

84