Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatools/synthesisutils.py: 85%

46 statements  

« prev     ^ index     » next       coverage.py v7.6.4, created at 2024-11-01 07:19 +0000

1##################### generated by xml-casa (v2) from synthesisutils.xml ############ 

2##################### 19f133338e28509761eee6c6c563b16d ############################## 

3from __future__ import absolute_import 

4from .__casac__.synthesisutils import synthesisutils as _synthesisutils 

5 

6from .errors import create_error_string 

7from .typecheck import CasaValidator as _validator 

8_pc = _validator( ) 

9from .coercetype import coerce as _coerce 

10from .synthesisimstore import synthesisimstore as _wrap_synthesisimstore 

11 

12class synthesisutils: 

13 _info_group_ = """synthesisutils""" 

14 _info_desc_ = """tool for synthesis imaging""" 

15 ### self 

16 def __init__(self, *args, **kwargs): 

17 """This is used to construct {tt synthesisutils} tool. 

18 """ 

19 self._swigobj = kwargs.get('swig_object',None) 

20 if self._swigobj is None: 

21 self._swigobj = _synthesisutils() 

22 

23 def contdatapartition(self, selpars={ }, npart=int(1)): 

24 """ 

25 """ 

26 return self._swigobj.contdatapartition(selpars, npart) 

27 

28 def advisechansel(self, freqstart=[ ], freqend=[ ], freqstep=[ ], freqframe='LSRK', ephemtable='', msname='', fieldid=int(0), getfreqrange=False, spwselection=''): 

29 """It is a helper function, for cube imaging, that allows you to 

30 determine the spectral window data selection you may need to cover a 

31 given range of frequencies. 

32  

33 In the mode with getfreqrange=False, the freqstep can be used (i.e., set to the channel width) to achieve the extra padding needed for data selection at the beginning and end of the desired cube range in order to retrieve all channels that will potentially contribute to the edge channels of the cube (to maximize S/N). If freqstep is not specified, it is taken as zero, and the output channel range will typically be slightly smaller. 

34  

35 The meaning of freqframe parameter is dependent on the value of getfreqrange. 

36 When getfreqrange=False, frequency parameters are considered as input parameters that are known to be in the frame specified by freqframe; but when getfreqrange=True, the frequency parameters are output parameters that will be determined in the frame specified by freqframe. In the former case, the frequencies will be converted to the frame of the data as a function of time in order to locate which channels match. 

37  

38 You need to specify the field_id for which this calculation is 

39 being done. 

40  

41 If the parameter {tt getfreqrange=True} then the reverse is requested. You set {tt spwselection} to be the range of data selection you want to use and you'll get the range of frequency covered in the frame you set. The freqstart and freqend output values correspond to the frequency of the extreme edges of the requested channel range. 

42 Inputs 

43 ---------------- 

44 freqstart 

45 Begining of frequency range 

46 allowed: double, string, quantity 

47 example: freqstart='1.0GHz' 

48 Default: 

49 ---------------- 

50 freqend 

51 End of frequency range 

52 allowed: double, string, quantity 

53 example: freqend='2.0GHz' 

54 Default:'' 

55 ----------------- 

56 freqstep 

57 spectral channel resolution of intended image 

58 allowed: double, string, quantity 

59 example: freqstep='1.0MHz' 

60 Default:'' 

61 ----------------- 

62 freqframe 

63 frame in which frequency is being expressed in other parameters. For solar system moving sources if the frame of the source is intended then this parameter can be 'SOURCE' 

64 allowed : one of the following strings 'LSRK', 'LSRD', 'BARY', 'GEO', 'TOPO', 'GALACTO', 'LGROUP','CMB', 'SOURCE' 

65 Default: 'LSRK' 

66 ---------------- 

67 msname 

68 name of a valid measurement set. 

69 allowed: string 

70 Default: '' 

71 ----------------- 

72 ephemtable 

73 when freqframe='SOURCE' this parameter is used 

74 name of a valid ephemeris table or 'TRACKFIELD' to use the ephemeris table attached to the FIELD subtable of the ms or one of the following solar system object: 'MERCURY', 'VENUS', 'MARS', 'JUPITER', 'SATURN', 'URANUS', 'NEPTUNE', 'PLUTO', 'SUN', 'MOON' 

75 allowed: string 

76 Default: '' 

77 ----------------- 

78 fieldid 

79 fieldid to use (needed to get the direction on the sky for any spectral frame conversion) 

80 allowed: integer 

81 Default: 0 

82 ------------------- 

83 getfreqrange 

84 if set then freqrange is returned in the frame requested for the data selected 

85 allowed: bool 

86 Default: False 

87 ----------------- 

88 spwselection 

89 if getfreqrange=True then this is needed to find the range of frequency in the frame requested. It should have the spectral window selection syntax as defined in the msselection (Casa memo 3) 

90 allowed: string 

91 Default: '' 

92 """ 

93 return self._swigobj.advisechansel(freqstart, freqend, freqstep, freqframe, ephemtable, msname, fieldid, getfreqrange, spwselection) 

94 

95 def cubedatapartition(self, selpars={ }, npart=int(1), fstart=[ ], fend=[ ], frame='LSRK'): 

96 """returns a dictionary with data spectral parttiion that maps data to nparts 

97 of the input range frequency... usually to be used for doing data selection 

98 when imaging a cube from fstart to fend in npart subcubes 

99 """ 

100 return self._swigobj.cubedatapartition(selpars, npart, fstart, fend, frame) 

101 

102 def cubeimagepartition(self, impars={ }, npart=int(1)): 

103 """ 

104 """ 

105 return self._swigobj.cubeimagepartition(impars, npart) 

106 

107 def cubedataimagepartition(self, selpars={ }, incsys={ }, npart=int(1), nchannel=int(1)): 

108 """ 

109 """ 

110 return self._swigobj.cubedataimagepartition(selpars, incsys, npart, nchannel) 

111 

112 def checkselectionparams(self, selpars={ }): 

113 """ 

114 """ 

115 return self._swigobj.checkselectionparams(selpars) 

116 

117 def checkimageparams(self, impars={ }): 

118 """ 

119 """ 

120 return self._swigobj.checkimageparams(impars) 

121 

122 def checkgridparams(self, gridpars={ }): 

123 """ 

124 """ 

125 return self._swigobj.checkgridparams(gridpars) 

126 

127 def updateimpars(self, impars={ }): 

128 """ 

129 """ 

130 return self._swigobj.updateimpars(impars) 

131 

132 def getOptimumSize(self, size=int(100)): 

133 """ 

134 """ 

135 return self._swigobj.getOptimumSize(size) 

136 

137 def fitPsfBeam(self, imagename='', nterms=int(1), psfcutoff=float(0.35)): 

138 """ 

139 """ 

140 return self._swigobj.fitPsfBeam(imagename, nterms, psfcutoff) 

141 

142 def taylor_coeffs_to_cube(self, cubename='', mtname='', nterms=int(2), reffreq=''): 

143 """ 

144 """ 

145 return self._swigobj.taylor_coeffs_to_cube(cubename, mtname, nterms, reffreq) 

146 

147 def cube_to_taylor_sum(self, cubename='', mtname='', nterms=int(2), reffreq='', imtype=int(0), pblimit=float(0.2)): 

148 """ 

149 """ 

150 return self._swigobj.cube_to_taylor_sum(cubename, mtname, nterms, reffreq, imtype, pblimit) 

151 

152 def remove_freq_dep_pb(self, cubename='', mtname='', pblimit=float(0.2)): 

153 """ 

154 """ 

155 return self._swigobj.remove_freq_dep_pb(cubename, mtname, pblimit) 

156 

157 def apply_freq_dep_pb(self, cubename='', mtname='', pblimit=float(0.2)): 

158 """ 

159 """ 

160 return self._swigobj.apply_freq_dep_pb(cubename, mtname, pblimit) 

161 

162 def done(self): 

163 """ 

164 """ 

165 return self._swigobj.done() 

166