Changeset 436
- Timestamp:
- 02/14/05 19:44:43 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/scantable.py
r432 r436 213 213 return i,j,k 214 214 215 def stats(self, stat='stddev', mask=None, all =None):215 def stats(self, stat='stddev', mask=None, allaxes=None): 216 216 """ 217 217 Determine the specified statistic of the current beam/if/pol … … 223 223 mask: an optional mask specifying where the statistic 224 224 should be determined. 225 all : if true show all (default or .asaprc) rather226 that the cursor selected spectrum of Beam/IF/Pol227 225 allaxes: if True apply to all spectra. Otherwise 226 apply only to the selected (beam/pol/if)spectra only. 227 The default is taken from .asaprc (True if none) 228 228 Example: 229 229 scan.set_unit('channel') … … 231 231 scan.stats(stat='mean', mask=m) 232 232 """ 233 if all is None: all= rcParams['scantable.allaxes']233 if allaxes is None: allaxes = rcParams['scantable.allaxes'] 234 234 from asap._asap import stats as _stats 235 235 from numarray import array,zeros,Float … … 238 238 axes = ['Beam','IF','Pol','Time'] 239 239 240 if all: 240 beamSel,IFSel,polSel = (self.getbeam(),self.getif(),self.getpol()) 241 if allaxes: 241 242 n = self.nbeam()*self.nif()*self.npol()*self.nrow() 242 243 shp = [self.nbeam(),self.nif(),self.npol(),self.nrow()] … … 254 255 if self._vb: 255 256 self._print_values(retval,stat,tm) 257 self.setbeam(beamSel) 258 self.setif(IFSel) 259 self.setpol(polSel) 256 260 return retval 257 261 258 262 else: 259 i,j,k = (self.getbeam(),self.getif(),self.getpol())260 263 statval = _stats(self,mask,stat,-1) 261 264 out = '' … … 263 266 tm = self._gettime(l) 264 267 out += 'Time[%s]:\n' % (tm) 265 if self.nbeam() > 1: out += ' Beam[%d] ' % ( i)266 if self.nif() > 1: out += ' IF[%d] ' % ( j)267 if self.npol() > 1: out += ' Pol[%d] ' % ( k)268 if self.nbeam() > 1: out += ' Beam[%d] ' % (beamSel) 269 if self.nif() > 1: out += ' IF[%d] ' % (IFSel) 270 if self.npol() > 1: out += ' Pol[%d] ' % (polSel) 268 271 out += '= %3.3f\n' % (statval[l]) 269 272 out += "--------------------------------------------------\n" … … 277 280 return retval 278 281 279 def stddev(self,mask=None, all =None):282 def stddev(self,mask=None, allaxes=None): 280 283 """ 281 284 Determine the standard deviation of the current beam/if/pol … … 285 288 mask: an optional mask specifying where the standard 286 289 deviation should be determined. 287 all :optional flag to show all or a cursor selected290 allaxes: optional flag to show all or a cursor selected 288 291 spectrum of Beam/IF/Pol. Default is all or taken 289 292 from .asaprc … … 294 297 scan.stddev(mask=m) 295 298 """ 296 if all is None: all= rcParams['scantable.allaxes']297 return self.stats(stat='stddev',mask=mask, all =all);298 299 def get_tsys(self, all =None):299 if allaxes is None: allaxes = rcParams['scantable.allaxes'] 300 return self.stats(stat='stddev',mask=mask, allaxes=allaxes); 301 302 def get_tsys(self, allaxes=None): 300 303 """ 301 304 Return the System temperatures. 302 305 Parameters: 303 all: optional parameter to get the Tsys values for all 304 Beams/IFs/Pols (default) or just the one selected 305 with scantable.set_cursor() 306 [True or False] 306 allaxes: if True apply to all spectra. Otherwise 307 apply only to the selected (beam/pol/if)spectra only. 308 The default is taken from .asaprc (True if none) 307 309 Returns: 308 310 a list of Tsys values. 309 311 """ 310 if all is None: all= rcParams['scantable.allaxes']312 if allaxes is None: allaxes = rcParams['scantable.allaxes'] 311 313 from numarray import array,zeros,Float 312 314 axes = ['Beam','IF','Pol','Time'] 313 315 314 if all :316 if allaxes: 315 317 n = self.nbeam()*self.nif()*self.npol()*self.nrow() 316 318 shp = [self.nbeam(),self.nif(),self.npol(),self.nrow()] … … 585 587 return 586 588 587 def rotate_xyphase (self, angle, all =None):589 def rotate_xyphase (self, angle, allaxes=None): 588 590 """ 589 591 Rotate the phase of the XY correlation. This is done in situ … … 592 594 Parameters: 593 595 angle: The angle (degrees) to rotate (add) by. 594 all: if true operate on all axes (default or .asaprc) rather 595 than the cursor selected spectrum of Beam/IF 596 allaxes: If True apply to all spectra. Otherwise 597 apply only to the selected (beam/pol/if)spectra only. 598 The default is taken from .asaprc (True if none) 596 599 Examples: 597 600 scan.rotate_xyphase(2.3) 598 601 """ 599 if all is None: all= rcParams['scantable.allaxes']600 sdtable._rotate_xyphase(self, angle, all )602 if allaxes is None: allaxes = rcParams['scantable.allaxes'] 603 sdtable._rotate_xyphase(self, angle, allaxes) 601 604 602 605 def plot(self, what='spectrum',col='Pol', panel=None):
Note:
See TracChangeset
for help on using the changeset viewer.