Changeset 794 for trunk/python/scantable.py
- Timestamp:
- 12/09/05 14:50:59 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/scantable.py
r780 r794 226 226 raise IOError(msg) 227 227 if rcParams['verbose']: 228 print info 228 try: 229 from IPython.genutils import page as pager 230 except ImportError: 231 from pydoc import pager 232 pager(info) 229 233 else: 230 234 return info … … 429 433 def get_sourcename(self, row=-1): 430 434 """ 431 Get a list source anmes for the observations.435 Get a list source names for the observations. 432 436 Return a string for each integration in the scantable. 433 437 Parameters: … … 442 446 if 0 <= row < self.nrow(): 443 447 return self._getsourcename(row) 448 449 def get_elevation(self, row=-1): 450 """ 451 Get a list of elevations for the observations. 452 Return a float for each integration in the scantable. 453 Parameters: 454 row: row no of integration. Default -1 return all rows 455 Example: 456 none 457 """ 458 out = [] 459 if row == -1: 460 return [self._getelevation(i) for i in range(self.nrow())] 461 else: 462 if 0 <= row < self.nrow(): 463 return self._getelevation(row) 464 465 def get_azimuth(self, row=-1): 466 """ 467 Get a list of azimuths for the observations. 468 Return a float for each integration in the scantable. 469 Parameters: 470 row: row no of integration. Default -1 return all rows 471 Example: 472 none 473 """ 474 out = [] 475 if row == -1: 476 return [self._getazimuth(i) for i in range(self.nrow())] 477 else: 478 if 0 <= row < self.nrow(): 479 return self._getazimuth(row) 480 481 def get_parangle(self, row=-1): 482 """ 483 Get a list of parallactic angles for the observations. 484 Return a float for each integration in the scantable. 485 Parameters: 486 row: row no of integration. Default -1 return all rows 487 Example: 488 none 489 """ 490 out = [] 491 if row == -1: 492 return [self._getparangle(i) for i in range(self.nrow())] 493 else: 494 if 0 <= row < self.nrow(): 495 return self._getparangle(row) 444 496 445 497 def set_unit(self, unit='channel'): … … 717 769 def history(self): 718 770 hist = list(self._gethistory()) 719 print"-"*80771 out = "-"*80 720 772 for h in hist: 721 773 if h.startswith("---"): 722 printh774 out += "\n"+h 723 775 else: 724 776 items = h.split("##") … … 726 778 func = items[1] 727 779 items = items[2:] 728 print date729 print"Function: %s\n Parameters:" % (func)780 out += "\n"+date+"\n" 781 out += "Function: %s\n Parameters:" % (func) 730 782 for i in items: 731 783 s = i.split("=") 732 print " %s = %s" % (s[0],s[1]) 733 print "-"*80 784 out += "\n %s = %s" % (s[0],s[1]) 785 out += "\n"+"-"*80 786 try: 787 from IPython.genutils import page as pager 788 except ImportError: 789 from pydoc import pager 790 pager(out) 734 791 return 735 792 … … 1055 1112 return 1056 1113 1057 def poly_baseline(self, mask=None, order=0, insitu=None ):1114 def poly_baseline(self, mask=None, order=0, insitu=None, allaxes=None): 1058 1115 """ 1059 1116 Return a scan which has been baselined (all rows) by a polynomial. 1060 1117 Parameters: 1061 scan: a scantable 1062 mask: an optional mask 1063 order: the order of the polynomial (default is 0) 1064 insitu: if False a new scantable is returned. 1065 Otherwise, the scaling is done in-situ 1066 The default is taken from .asaprc (False) 1118 scan: a scantable 1119 mask: an optional mask 1120 order: the order of the polynomial (default is 0) 1121 insitu: if False a new scantable is returned. 1122 Otherwise, the scaling is done in-situ 1123 The default is taken from .asaprc (False) 1124 allaxes: If True (default) apply to all spectra. Otherwise 1125 apply only to the selected (beam/pol/if)spectra only 1126 The default is taken from .asaprc (True if none) 1067 1127 Example: 1068 1128 # return a scan baselined by a third order polynomial, … … 1070 1130 bscan = scan.poly_baseline(order=3) 1071 1131 """ 1132 if allaxes is None: allaxes = rcParams['scantable.allaxes'] 1072 1133 if insitu is None: insitu = rcParams['insitu'] 1073 1134 varlist = vars() … … 1079 1140 f.set_scan(self, mask) 1080 1141 f.set_function(poly=order) 1081 sf = f.auto_fit(insitu )1142 sf = f.auto_fit(insitu,allaxes) 1082 1143 if insitu: 1083 1144 self._add_history("poly_baseline", varlist) … … 1291 1352 refs = self.get_scan("*[_ewR]") 1292 1353 if isinstance(srcs,scantable) and isinstance(refs,scantable): 1354 from asap import asaplog 1293 1355 ns,nr = srcs.nrow(),refs.nrow() 1356 msg = "Found %i Off and %i On scans" % (ns,nr) 1357 asaplog.push(msg) 1294 1358 if nr > ns: 1359 asaplog("Found more Off integrations than On scans - dropping excess Offs.") 1295 1360 refs = refs.get_scan(range(ns)) 1296 1361 print_log()
Note: See TracChangeset
for help on using the changeset viewer.