- Timestamp:
- 12/20/04 15:53:55 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/scantable.py
r126 r135 50 50 self._vb = args[0] 51 51 return 52 53 52 54 53 def copy(self): … … 109 108 Example: 110 109 scan.set_selection(0,0,1) 111 pol1 rms = scan.rms(all=False) # returns rmsfor beam=0110 pol1sig = scan.stats(all=False) # returns std dev for beam=0 112 111 # if=0, pol=1 113 112 """ … … 135 134 return i,j,k 136 135 137 def rms(self,mask=None, all=True):138 """ 139 Determine the root mean squareof the current beam/if/pol136 def stats(self, stat='stddev', mask=None, all=True): 137 """ 138 Determine the specified statistic of the current beam/if/pol 140 139 Takes a 'mask' as an optional parameter to specify which 141 140 channels should be excluded. 142 141 Parameters: 143 mask: an optional mask specifying where the rms 142 stat: 'min', 'max', 'sumsq', 'sum', 'mean' 143 'var', 'stddev', 'avdev', 'rms', 'median' 144 mask: an optional mask specifying where the statistic 144 145 should be determined. 145 146 all: optional flag to show all or a selected … … 149 150 scan.set_unit('channel') 150 151 msk = scan.create_mask([100,200],[500,600]) 151 scan. rms(mask=m)152 """ 153 from asap._asap import rms as _rms152 scan.stats(stat='mean', mask=m) 153 """ 154 from asap._asap import stats as _stats 154 155 if mask == None: 155 156 mask = ones(self.nchan()) … … 163 164 for k in range(self.npol()): 164 165 self.setpol(k) 165 rmsval = _rms(self,mask)166 tmp.append( rmsval)167 out += 'Beam[%d], IF[%d], Pol[%d] = %3.3f\n' % (i,j,k,rmsval)168 if self._vb:169 print out166 statVal = _stats(self,mask,stat) 167 tmp.append(statVal) 168 # out += 'Beam[%d], IF[%d], Pol[%d] = %3.3f\n' % (i,j,k,statVal) 169 # if self._vb: 170 # print out 170 171 return tmp 171 172 … … 174 175 j = self.getif() 175 176 k = self.getpol() 176 rmsval = _rms(self,mask) 177 out = 'Beam[%d], IF[%d], Pol[%d] = %3.3f' % (i,j,k,rmsval) 178 if self._vb: 179 print out 180 return rmsval 177 statVal = _stats(self,mask,stat) 178 # out = 'Beam[%d], IF[%d], Pol[%d] = %3.3f' % (i,j,k,statVal) 179 # if self._vb: 180 # print out 181 return statVal 182 183 def stddev(self,mask=None, all=True): 184 """ 185 Determine the standard deviation of the current beam/if/pol 186 Takes a 'mask' as an optional parameter to specify which 187 channels should be excluded. 188 Parameters: 189 mask: an optional mask specifying where the standard 190 deviation should be determined. 191 all: optional flag to show all or a selected 192 spectrum of Beam/IF/Pol 193 194 Example: 195 scan.set_unit('channel') 196 msk = scan.create_mask([100,200],[500,600]) 197 scan.stddev(mask=m) 198 """ 199 return self.stats(stat='stddev',mask=mask, all=all); 181 200 182 201 def get_tsys(self, all=True): … … 373 392 Parameters: 374 393 what: a choice of 'spectrum' (default) or 'tsys' 375 col: which out of Beams, IFs, Pols (default) 376 should be colour stacked 394 col: which out of Beams/IFs/Pols should be colour stacked 377 395 panel: set up multiple panels, currently not working. 378 396 """
Note:
See TracChangeset
for help on using the changeset viewer.