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

2##################### 2a2a5ff8548784bd9160433c24381183 ############################## 

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_fixvis import fixvis as _fixvis_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 _fixvis: 

15 """ 

16 fixvis ---- Recalculates (u, v, w) and/or changes Phase Center 

17 

18  

19 Recalculates (u, v, w) and/or changes Phase Center. 

20  

21 If the phase center is changed, the corresponding modifications 

22 are applied to the visibility columns given by the parameter 

23 "datacolumn" which is by default set to "all" (DATA, CORRECTED, 

24 and MODEL). 

25 

26 --------- parameter descriptions --------------------------------------------- 

27 

28 vis Name of input visibility file 

29 Default: none 

30  

31 Example: vis='ngc5921.ms' 

32 outputvis Name of output visibility file 

33 Default: '' (same as vis) 

34  

35 Example: outputvis='ngc5921_out.ms' 

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

37 Default: '' (all fields) 

38  

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

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

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

42 assumed a field name. 

43  

44 Examples: 

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

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

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

48 3C295 

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

50 starting with 4C 

51 refcode Reference frame to convert UVW coordinates to 

52 Default: '' (refcode of PHASE_DIR in the FIELD 

53 table) 

54  

55 Example: refcode='B1950' 

56 reuse Base UVW calculation on the old values? 

57 Default: True 

58 Options: True|False 

59  

60 Note: ignored if parameter 'phasecenter' is set 

61 phasecenter If set to a valid direction: change the phase center for 

62 the given field to this value 

63 If given without the equinox, e.g. '0h01m00s 

64 +00d12m00s', the parameter is interpreted as a 

65 pair of offsets in RA and DEC to the present 

66 phasecenter. 

67  

68 Example: phasecenter='J2000 9h25m00s 

69 -05d12m00s' 

70  

71 Note: The RA offset can be given in units of time 

72 or angle. If given as a time (i.e. as a single 

73 number with a time unit as in, e.g., 12s or in 

74 the XXhXXmXXs or XX:XX:XX.XXX formats), it is 

75 applied as is. If given as an angle (e.g., 

76 0.01deg), it is divided by the cos(DEC) before it 

77 is applied. 

78 distances (experimental) List of the distances (as quanta) of the 

79 fields selected by field. 

80 Default: [] (the distances of all fields are 

81 assumed to be infinity.) 

82  

83 If not a list but just a single value is given, 

84 this is applied to all fields. 

85  

86 Examples:  

87 distances=['2E6km', '3E6km']  

88 distances='15au' 

89 datacolumn when applying a phase center shift, modify visibilities 

90 only in this/these column(s) 

91 Default: 'all' (DATA, CORRECTED, and MODEL) 

92  

93 Example: datacolumn='DATA,CORRECTED' (will not 

94 modify MODEL) 

95 

96 --------- examples ----------------------------------------------------------- 

97 

98  

99  

100 For more information, see the task pages of fixvis in CASA Docs: 

101  

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

103 

104 

105 """ 

106 

107 _info_group_ = """manipulation""" 

108 _info_desc_ = """Recalculates (u, v, w) and/or changes Phase Center """ 

109 

110 def __call__( self, vis='', outputvis='', field=[ ], refcode='', reuse=True, phasecenter='', distances=[ ], datacolumn='all' ): 

111 schema = {'vis': {'type': 'cReqPath', 'coerce': _coerce.expand_path}, 'outputvis': {'type': 'cStr', 'coerce': _coerce.to_str}, 'field': {'type': 'cVariant', 'coerce': [_coerce.to_variant]}, 'refcode': {'type': 'cStr', 'coerce': _coerce.to_str}, 'reuse': {'type': 'cBool'}, 'phasecenter': {'type': 'cStr', 'coerce': _coerce.to_str}, 'distances': {'type': 'cVariant', 'coerce': [_coerce.to_variant]}, 'datacolumn': {'type': 'cStr', 'coerce': _coerce.to_str}} 

112 doc = {'vis': vis, 'outputvis': outputvis, 'field': field, 'refcode': refcode, 'reuse': reuse, 'phasecenter': phasecenter, 'distances': distances, 'datacolumn': datacolumn} 

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

114 _logging_state_ = _start_log( 'fixvis', [ 'vis=' + repr(_pc.document['vis']), 'outputvis=' + repr(_pc.document['outputvis']), 'field=' + repr(_pc.document['field']), 'refcode=' + repr(_pc.document['refcode']), 'reuse=' + repr(_pc.document['reuse']), 'phasecenter=' + repr(_pc.document['phasecenter']), 'distances=' + repr(_pc.document['distances']), 'datacolumn=' + repr(_pc.document['datacolumn']) ] ) 

115 task_result = None 

116 try: 

117 task_result = _fixvis_t( _pc.document['vis'], _pc.document['outputvis'], _pc.document['field'], _pc.document['refcode'], _pc.document['reuse'], _pc.document['phasecenter'], _pc.document['distances'], _pc.document['datacolumn'] ) 

118 except Exception as exc: 

119 _except_log('fixvis', exc) 

120 raise 

121 finally: 

122 task_result = _end_log( _logging_state_, 'fixvis', task_result ) 

123 return task_result 

124 

125fixvis = _fixvis( ) 

126