Changeset 2419
- Timestamp:
- 03/01/12 03:51:53 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapgrid.py
r2397 r2419 287 287 else: 288 288 opt = 'pol %s'%(pol) 289 if chan < 0: 289 if type(chan) is list: 290 opt += ', averaged over channel %s-%s'%(chan[0],chan[1]) 291 elif chan < 0: 290 292 opt += ', averaged over channel' 291 293 else: … … 359 361 360 362 def getData( self, chan=-1, pol=-1 ): 361 if chan == -1: 363 if type(chan) == list: 364 spectra = self.__chanAverage(start=chan[0],end=chan[1]) 365 elif chan == -1: 362 366 spectra = self.__chanAverage() 363 367 else: … … 370 374 return retval 371 375 372 def __chanAverage( self ):376 def __chanAverage( self, start=-1, end=-1 ): 373 377 s = scantable( self.outfile, average=False ) 374 378 nrow = s.nrow() … … 376 380 irow = 0 377 381 sp = [0 for i in xrange(self.nchan)] 382 if start < 0: 383 start = 0 384 if end < 0: 385 end = self.nchan 378 386 for i in xrange(nrow/self.npol): 379 387 for ip in xrange(self.npol): 380 sp = s._getspectrum( irow ) 388 sp = s._getspectrum( irow )[start:end] 381 389 spectra[ip,i] = numpy.mean( sp ) 382 390 irow += 1 391 383 392 return spectra 384 393
Note:
See TracChangeset
for help on using the changeset viewer.