- Timestamp:
- 03/13/09 16:27:14 (16 years ago)
- Location:
- branches/alma
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/alma/python/scantable.py
r1522 r1530 345 345 Takes a 'mask' as an optional parameter to specify which 346 346 channels should be excluded. 347 You can get min/max values with their348 channels/frequencies/velocities by selecting stat='min_abc'349 or 'max_abc'.350 347 Parameters: 351 348 stat: 'min', 'max', 'min_abc', 'max_abc', 'sumsq', 'sum', … … 365 362 "number of channels. Please use setselection() " 366 363 "to select individual IFs") 367 368 if stat.lower().find('_abc') == -1: 369 statvals = self._math._stats(self, mask, stat) 370 getchan = False 371 sstat = str(stat) 372 else: 364 rtnabc = False 365 if stat.lower().endswith('_abc'): rtnabc = True 366 getchan = False 367 if stat.lower().startswith('min') or stat.lower().startswith('max'): 373 368 chan = self._math._minmaxchan(self, mask, stat) 374 369 getchan = True 375 370 statvals = [] 376 sstat = stat.lower().strip('_abc') 371 if not rtnabc: statvals = self._math._stats(self, mask, stat) 372 377 373 out = '' 378 374 axes = [] … … 387 383 tm = self._gettime(i) 388 384 src = self._getsourcename(i) 389 xpos = '' 385 refstr = '' 386 statunit= '' 390 387 if getchan: 391 388 qx, qy = self.chan2data(rowno=i, chan=chan[i]) 392 statvals.append(qy['value']) 393 xpos = '(x = %3.3f' % (qx['value'])+' ['+qx['unit']+'])' 389 if rtnabc: 390 statvals.append(qx['value']) 391 refstr = '(value: %3.3f' % (qy['value'])+' ['+qy['unit']+'])' 392 statunit= '['+qx['unit']+']' 393 else: 394 refstr = '(@ %3.3f' % (qx['value'])+' ['+qx['unit']+'])' 395 #statunit= ' ['+qy['unit']+']' 394 396 out += 'Scan[%d] (%s) ' % (axis[0], src) 395 397 out += 'Time[%s]:\n' % (tm) … … 397 399 if self.nif(-1) > 1: out += ' IF[%d] ' % (axis[2]) 398 400 if self.npol(-1) > 1: out += ' Pol[%d] ' % (axis[3]) 399 out += '= %3.3f ' % (statvals[i]) + xpos+'\n'401 out += '= %3.3f ' % (statvals[i]) +refstr+'\n' 400 402 out += "--------------------------------------------------\n" 401 403 402 404 if rcParams['verbose']: 403 405 print "--------------------------------------------------" 404 print " ", s stat406 print " ", stat, statunit 405 407 print "--------------------------------------------------" 406 408 print out … … 422 424 """ 423 425 if isinstance(rowno, int) and isinstance(chan, int): 424 x, xlbl = self.get_abcissa(rowno)425 qx = {'unit': xlbl, 'value': x[chan]}426 qx = {'unit': self.get_unit(), 427 'value': self._getabcissa(rowno)[chan]} 426 428 qy = {'unit': self.get_fluxunit(), 427 429 'value': self._getspectrum(rowno)[chan]} -
branches/alma/src/MathUtils.cpp
r1516 r1530 84 84 String str(which); 85 85 str.upcase(); 86 if (str. matches(String("MIN_ABC"))) {86 if (str.contains(String("MIN"))) { 87 87 return minPos; 88 } else if (str. matches(String("MAX_ABC"))) {88 } else if (str.contains(String("MAX"))) { 89 89 return maxPos; 90 90 } else {
Note:
See TracChangeset
for help on using the changeset viewer.