Changeset 2315
- Timestamp:
- 09/29/11 17:08:47 (13 years ago)
- Location:
- trunk/python
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/logging.py
r1939 r2315 19 19 create its own casa log sink. 20 20 21 .. note:: Do instantiate a new one - use the :obj:`asaplog` instead.21 .. note:: Do not instantiate a new one - use the :obj:`asaplog` instead. 22 22 23 23 """ … … 58 58 self._log = "" 59 59 60 def clear(self): 61 if isinstance(self.logger, LogSink): 62 logs = self.logger.pop() 63 60 64 def push(self, msg, newline=True): 61 65 """Push logs into the buffer. post needs to be called to send them. -
trunk/python/scantable.py
r2290 r2315 2 2 3 3 import os 4 import tempfile 4 5 import numpy 5 6 try: … … 181 182 #def __init__(self, filename, average=None, unit=None, getpt=None, 182 183 # antenna=None, parallactify=None): 183 def __init__(self, filename, average=None, unit=None, parallactify=None, **args): 184 def __init__(self, filename, average=None, unit=None, parallactify=None, 185 **args): 184 186 """\ 185 187 Create a scantable from a saved one or make a reference … … 302 304 * 'ASCII' (saves as ascii text file) 303 305 * 'MS2' (saves as an casacore MeasurementSet V2) 304 * 'FITS' (save as image FITS - not readable by class) 306 * 'FITS' (save as image FITS - not readable by 307 class) 305 308 * 'CLASS' (save as FITS readable by CLASS) 306 309 … … 370 373 from asap import unique 371 374 if not _is_valid(scanid): 372 raise RuntimeError( 'Please specify a scanno to drop from the scantable' ) 375 raise RuntimeError( 'Please specify a scanno to drop from the' 376 ' scantable' ) 373 377 scanid = _to_list(scanid) 374 378 allscans = unique([ self.getscan(i) for i in range(self.nrow())]) … … 433 437 434 438 def __str__(self): 435 return Scantable._summary(self) 436 439 tempFile = tempfile.NamedTemporaryFile() 440 Scantable._summary(self, tempFile.name) 441 tempFile.seek(0) 442 asaplog.clear() 443 return tempFile.file.read() 444 445 @asaplog_post_dec 437 446 def summary(self, filename=None): 438 447 """\
Note:
See TracChangeset
for help on using the changeset viewer.