Changeset 1757 for branches/alma/python/asapfitter.py
- Timestamp:
- 06/09/10 19:03:06 (14 years ago)
- Location:
- branches/alma
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/alma
-
Property
svn:ignore
set to
.sconf_temp
.sconsign.dblite
-
Property
svn:mergeinfo
set to
/branches/asap-3.x merged eligible
-
Property
svn:ignore
set to
-
branches/alma/python/asapfitter.py
r1701 r1757 1 1 import _asap 2 2 from asap import rcParams 3 from asap import print_log 3 from asap import print_log, print_log_dec 4 4 from asap import _n_bools 5 5 from asap import mask_and … … 79 79 Set the function to be fit. 80 80 Parameters: 81 poly: use a polynomial of the order given with nonlinear least squares fit 81 poly: use a polynomial of the order given with nonlinear least squares fit 82 82 lpoly: use polynomial of the order given with linear least squares fit 83 83 gauss: fit the number of gaussian specified … … 95 95 n = kwargs.get('poly') 96 96 self.components = [n] 97 self.uselinear = False 97 self.uselinear = False 98 98 elif kwargs.has_key('lpoly'): 99 99 self.fitfunc = 'poly' … … 106 106 self.fitfuncs = [ 'gauss' for i in range(n) ] 107 107 self.components = [ 3 for i in range(n) ] 108 self.uselinear = False 108 self.uselinear = False 109 109 elif kwargs.has_key('lorentz'): 110 110 n = kwargs.get('lorentz') … … 112 112 self.fitfuncs = [ 'lorentz' for i in range(n) ] 113 113 self.components = [ 3 for i in range(n) ] 114 self.uselinear = False 114 self.uselinear = False 115 115 else: 116 116 msg = "Invalid function type." … … 127 127 return 128 128 129 #@print_log_dec 129 130 def fit(self, row=0, estimate=False): 130 131 """ … … 164 165 self.data.getbeam(i), 165 166 self.data.getif(i), 166 self.data.getpol(i), 167 self.data.getpol(i), 167 168 self.data.getcycle(i)) 168 169 asaplog.push(out,False) … … 221 222 self.data._addfit(fit,self._fittedrow) 222 223 223 # def set_parameters(self, params, fixed=None, component=None):224 #@print_log_dec 224 225 def set_parameters(self,*args,**kwargs): 225 226 """ … … 543 544 return self.fitter.getfit() 544 545 546 #@print_log_dec 545 547 def commit(self): 546 548 """ … … 571 573 return scan 572 574 573 def plot(self, residual=False, components=None, plotparms=False, filename=None): 575 #@print_log_dec 576 def plot(self, residual=False, components=None, plotparms=False, 577 filename=None): 574 578 """ 575 579 Plot the last fit. … … 598 602 xlab = 'Abcissa' 599 603 ylab = 'Ordinate' 600 from matplotlib.numeriximport ma,logical_not,logical_and,array604 from numpy import ma,logical_not,logical_and,array 601 605 m = self.mask 602 606 if self.data: … … 606 610 array(self.data._getmask(self._fittedrow), 607 611 copy=False)) 608 612 609 613 ylab = self.data._get_ordinate_label() 610 614 … … 670 674 print_log() 671 675 676 #@print_log_dec 672 677 def auto_fit(self, insitu=None, plot=False): 673 678 """ … … 700 705 scan.getbeam(r), 701 706 scan.getif(r), 702 scan.getpol(r), 707 scan.getpol(r), 703 708 scan.getcycle(r)) 704 709 asaplog.push(out, False) … … 723 728 print_log() 724 729 return scan 725
Note: See TracChangeset
for help on using the changeset viewer.