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

2##################### fc127278a648878086dac0aee00fe5cf ############################## 

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_splattotable import splattotable as _splattotable_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 _splattotable: 

15 """ 

16 splattotable ---- Convert a downloaded Splatalogue spectral line list to a casa table. 

17 

18  

19 This task reads a spectral line list(s) downloaded from Splatalogue 

20 (www.splatalogue.net) and loads it into a CASA table which can be 

21 queried via eg the slsearch task. 

22 

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

24 

25 filenames Files containing Splatalogue lists. 

26  

27 The downloaded files must be in a specific format 

28 for this task to succeed. Fro details, see the splattotable 

29 task pages on CASA Docs 

30 (https://casa.nrao.edu/casadocs/) 

31 table Output table name. Must be specified. 

32 RETURNS bool 

33 

34 --------- examples ----------------------------------------------------------- 

35 

36  

37 For more information, see the task pages of splattotable in CASA Docs: 

38  

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

40 

41 

42 """ 

43 

44 _info_group_ = """import/export""" 

45 _info_desc_ = """Convert a downloaded Splatalogue spectral line list to a casa table.""" 

46 

47 def __call__( self, filenames=[ ], table='' ): 

48 schema = {'filenames': {'type': 'cReqPathVec', 'coerce': [_coerce.to_list,_coerce.expand_pathvec]}, 'table': {'type': 'cStr', 'coerce': _coerce.to_str}} 

49 doc = {'filenames': filenames, 'table': table} 

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

51 _logging_state_ = _start_log( 'splattotable', [ 'filenames=' + repr(_pc.document['filenames']), 'table=' + repr(_pc.document['table']) ] ) 

52 task_result = None 

53 try: 

54 task_result = _splattotable_t( _pc.document['filenames'], _pc.document['table'] ) 

55 except Exception as exc: 

56 _except_log('splattotable', exc) 

57 raise 

58 finally: 

59 task_result = _end_log( _logging_state_, 'splattotable', task_result ) 

60 return task_result 

61 

62splattotable = _splattotable( ) 

63