Changeset 876 for trunk/python/asapfitter.py
- Timestamp:
- 03/06/06 11:51:04 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapfitter.py
r794 r876 130 130 from asap import asaplog 131 131 asaplog.push("Fitting:") 132 self.selection = self.data.get_cursor() 132 out = "Scan[%d] Beam[%d] IF[%d] Pol[%d] Cycle[%d]" (self.data.getscan(i),self.data.getbeam(i),self.data.getif(i),self.data.getpol(i), self.data.getcycle(i)) 133 asaplog.push(out) 133 134 self.fitter.setdata(self.x, self.y, self.mask) 134 135 if self.fitfunc == 'gauss': … … 432 433 print_log() 433 434 434 def auto_fit(self, insitu=None , allaxes=True):435 def auto_fit(self, insitu=None): 435 436 """ 436 437 Return a scan where the function is applied to all rows for … … 451 452 else: 452 453 scan = self.data 453 sel = scan.get_cursor()454 454 rows = range(scan.nrow()) 455 455 from asap import asaplog 456 if allaxes: 457 for i in range(scan.nbeam()): 458 scan.setbeam(i) 459 for j in range(scan.nif()): 460 scan.setif(j) 461 for k in range(scan.npol()): 462 scan.setpol(k) 463 asaplog.push("Fitting:") 464 out = 'Beam[%d], IF[%d], Pol[%d]' % (i,j,k) 465 asaplog.push(out) 466 for iRow in rows: 467 self.x = scan._getabcissa(iRow) 468 self.y = scan._getspectrum(iRow) 469 self.data = None 470 self.fit() 471 x = self.get_parameters() 472 scan._setspectrum(self.fitter.getresidual(),iRow) 473 else: 474 asaplog.push("Fitting:") 475 out = 'Beam[%d], IF[%d], Pol[%d]' % sel 456 asaplog.push("Fitting:") 457 for r in rows: 458 out = "Scan[%d] Beam[%d] IF[%d] Pol[%d] Cycle[%d]" % (self.data.getscan(r),self.data.getbeam(r),self.data.getif(r),self.data.getpol(r), self.data.getcycle(r)) 476 459 asaplog.push(out) 477 for iRow in rows: 478 self.x = scan._getabcissa(iRow) 479 self.y = scan._getspectrum(iRow) 480 self.data = None 481 self.fit() 482 x = self.get_parameters() 483 scan._setspectrum(self.fitter.getresidual(),iRow) 484 485 scan.set_cursor(sel[0],sel[1],sel[2]) 460 self.x = scan._getabcissa(r) 461 self.y = scan._getspectrum(r) 462 self.data = None 463 self.fit() 464 x = self.get_parameters() 465 scan._setspectrum(self.fitter.getresidual(),iRow) 486 466 print_log() 487 if not insitu:488 return scan 467 return scan 468
Note: See TracChangeset
for help on using the changeset viewer.