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

2##################### 284ba2a1cc4b6c7ef2f46d6558118056 ############################## 

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_fixplanets import fixplanets as _fixplanets_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 _fixplanets: 

15 """ 

16 fixplanets ---- Changes FIELD and SOURCE table entries based on user-provided direction or POINTING table, optionally fixes the UVW coordinates 

17 

18  

19 This task's main purpose is to correct observations which were 

20 performed with correct pointing and correlation but for which 

21 incorrect direction information was entered in the FIELD and SOURCE 

22 table of the MS. If you actually want to change the phase center of 

23 the visibilties in an MS, you should use task fixvis. 

24 

25 --------- parameter descriptions --------------------------------------------- 

26 

27 vis Name of input visibility file 

28 Default: none 

29  

30 Example: vis='ngc5921.ms' 

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

32 Default: '' (all fields) 

33  

34 Use 'go listobs' to obtain the list id's or 

35 names. If field string is a non-negative integer, 

36 it is assumed a field index, otherwise, it is 

37 assumed a field name. 

38  

39 Examples: 

40 field='0~2'; field ids 0,1,2 

41 field='0,4,5~7'; field ids 0,4,5,6,7 

42 field='3C286,3C295'; field named 3C286 and 

43 3C295 

44 field = '3,4C*'; field id 3, all names 

45 starting with 4C 

46 fixuvw Recalculate Fourier-plane u,v,w coordinates? 

47 Default: False 

48 Options: False|True 

49 direction If set, do not use pointing table but set direction to 

50 this value 

51 Default: '' (use pointing table) 

52  

53 Example: 'J2000 19h30m00 -40d00m00' 

54  

55 The direction can either be given explicitly or 

56 as the path to a JPL Horizons 

57 ephemeris. Alternatively, the ephemeris table can 

58 also be provided using getephemtable task. For more 

59 information, see the task pages of fixplanets in 

60 the CASA Docs. 

61 refant Reference antenna name(s); a prioritized list may be 

62 specified 

63 Default: 0 (antenna ID 0) 

64  

65 Examples:  

66 refant='4' (antenna with index 4) 

67 refant='VA04' (VLA antenna #4) 

68 refant='EA02,EA23,EA13' (EVLA antenna EA02, 

69 use EA23 and EA13 as alternates if/when EA02 

70 drops out) 

71  

72 Use taskname=listobs for antenna listing 

73 reftime If using pointing table information, use it from this 

74 timestamp 

75 Default: 'first' 

76  

77 Examples:  

78 * 'median' will use the median timestamp for 

79 the given field using only the unflagged 

80 maintable rows 

81 * '2012/07/11/08:41:32' will use the given 

82 timestamp (must be within the observaton 

83 time) 

84 

85 --------- examples ----------------------------------------------------------- 

86 

87  

88  

89 For more information, see the task pages of fixplanets in CASA Docs: 

90  

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

92 

93 

94 """ 

95 

96 _info_group_ = """manipulation, calibration""" 

97 _info_desc_ = """Changes FIELD and SOURCE table entries based on user-provided direction or POINTING table, optionally fixes the UVW coordinates""" 

98 

99 def __call__( self, vis='', field=[ ], fixuvw=False, direction='', refant=int(0), reftime='first' ): 

100 schema = {'vis': {'type': 'cReqPath', 'coerce': _coerce.expand_path}, 'field': {'type': 'cVariant', 'coerce': [_coerce.to_variant]}, 'fixuvw': {'type': 'cBool'}, 'direction': {'type': 'cVariant', 'coerce': [_coerce.to_variant]}, 'refant': {'type': 'cVariant', 'coerce': [_coerce.to_variant]}, 'reftime': {'type': 'cStr', 'coerce': _coerce.to_str}} 

101 doc = {'vis': vis, 'field': field, 'fixuvw': fixuvw, 'direction': direction, 'refant': refant, 'reftime': reftime} 

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

103 _logging_state_ = _start_log( 'fixplanets', [ 'vis=' + repr(_pc.document['vis']), 'field=' + repr(_pc.document['field']), 'fixuvw=' + repr(_pc.document['fixuvw']), 'direction=' + repr(_pc.document['direction']), 'refant=' + repr(_pc.document['refant']), 'reftime=' + repr(_pc.document['reftime']) ] ) 

104 task_result = None 

105 try: 

106 task_result = _fixplanets_t( _pc.document['vis'], _pc.document['field'], _pc.document['fixuvw'], _pc.document['direction'], _pc.document['refant'], _pc.document['reftime'] ) 

107 except Exception as exc: 

108 _except_log('fixplanets', exc) 

109 raise 

110 finally: 

111 task_result = _end_log( _logging_state_, 'fixplanets', task_result ) 

112 return task_result 

113 

114fixplanets = _fixplanets( ) 

115