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

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 defintent.xml ################# 

2##################### 781e9e4936e3834044f58bb5e8841622 ############################## 

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_defintent import defintent as _defintent_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 _defintent: 

15 """ 

16 defintent ---- Manually set scan intents 

17 

18  

19 Allows the user to manually set scan intents 

20 

21 --------- parameter descriptions --------------------------------------------- 

22 

23 vis Name of input visibility file (MS) 

24 Default: none 

25  

26 Example: vis='ngc5921.ms' 

27 intent select intent to add 

28 mode Intent modification mode (set/append) 

29 outputvis Creates an output ms with all the changes from the task leaving the original vis untouched. 

30 scan Select Scan to apply the new intents to 

31 field Select field using field id(s) or field name(s) 

32 obsid Select ObsId 

33 RETURNS void 

34 

35 --------- examples ----------------------------------------------------------- 

36 

37  

38  

39 For more information, see the task pages of clearcal in CASA Docs: 

40  

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

42  

43  

44 

45 

46 """ 

47 

48 _info_group_ = """calibration""" 

49 _info_desc_ = """Manually set scan intents""" 

50 

51 def __call__( self, vis='', intent='', mode='', outputvis='', scan='', field='', obsid='' ): 

52 schema = {'vis': {'type': 'cReqPath', 'coerce': _coerce.expand_path}, 'intent': {'type': 'cStr', 'coerce': _coerce.to_str}, 'mode': {'type': 'cStr', 'coerce': _coerce.to_str}, 'outputvis': {'type': 'cStr', 'coerce': _coerce.to_str}, 'scan': {'type': 'cStr', 'coerce': _coerce.to_str}, 'field': {'type': 'cStr', 'coerce': _coerce.to_str}, 'obsid': {'type': 'cStr', 'coerce': _coerce.to_str}} 

53 doc = {'vis': vis, 'intent': intent, 'mode': mode, 'outputvis': outputvis, 'scan': scan, 'field': field, 'obsid': obsid} 

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

55 _logging_state_ = _start_log( 'defintent', [ 'vis=' + repr(_pc.document['vis']), 'intent=' + repr(_pc.document['intent']), 'mode=' + repr(_pc.document['mode']), 'outputvis=' + repr(_pc.document['outputvis']), 'scan=' + repr(_pc.document['scan']), 'field=' + repr(_pc.document['field']), 'obsid=' + repr(_pc.document['obsid']) ] ) 

56 task_result = None 

57 try: 

58 task_result = _defintent_t( _pc.document['vis'], _pc.document['intent'], _pc.document['mode'], _pc.document['outputvis'], _pc.document['scan'], _pc.document['field'], _pc.document['obsid'] ) 

59 except Exception as exc: 

60 _except_log('defintent', exc) 

61 raise 

62 finally: 

63 task_result = _end_log( _logging_state_, 'defintent', task_result ) 

64 return task_result 

65 

66defintent = _defintent( ) 

67