Ignore:
Timestamp:
07/02/09 12:17:20 (15 years ago)
Author:
Malte Marquarding
Message:

Introduced print_log_dec(orator)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapfitter.py

    r1536 r1589  
    11import _asap
    22from asap import rcParams
    3 from asap import print_log
     3from asap import print_log_dec
    44from asap import _n_bools
    55from asap import mask_and
     
    7676        Set the function to be fit.
    7777        Parameters:
    78             poly:    use a polynomial of the order given with nonlinear least squares fit 
     78            poly:    use a polynomial of the order given with nonlinear least squares fit
    7979            lpoly:   use polynomial of the order given with linear least squares fit
    8080            gauss:   fit the number of gaussian specified
     
    9090            n = kwargs.get('poly')
    9191            self.components = [n]
    92             self.uselinear = False 
     92            self.uselinear = False
    9393        elif kwargs.has_key('lpoly'):
    9494            self.fitfunc = 'poly'
     
    101101            self.fitfuncs = [ 'gauss' for i in range(n) ]
    102102            self.components = [ 3 for i in range(n) ]
    103             self.uselinear = False 
     103            self.uselinear = False
    104104        else:
    105105            msg = "Invalid function type."
     
    114114        return
    115115
     116    @print_log_dec
    116117    def fit(self, row=0, estimate=False):
    117118        """
     
    150151                                                                      self.data.getbeam(i),
    151152                                                                      self.data.getif(i),
    152                                                                       self.data.getpol(i), 
     153                                                                      self.data.getpol(i),
    153154                                                                      self.data.getcycle(i))
    154155                asaplog.push(out,False)
     
    175176        self._fittedrow = row
    176177        self.fitted = True
    177         print_log()
    178178        return
    179179
     
    204204                self.data._addfit(fit,self._fittedrow)
    205205
    206     #def set_parameters(self, params, fixed=None, component=None):
     206    @print_log_dec
    207207    def set_parameters(self,*args,**kwargs):
    208208        """
     
    247247        if fixed is not None:
    248248            self.fitter.setfixedparameters(fixed)
    249         print_log()
    250249        return
    251250
     
    461460        return self.fitter.getfit()
    462461
     462    @print_log_dec
    463463    def commit(self):
    464464        """
     
    482482        scan = self.data.copy()
    483483        scan._setspectrum(self.fitter.getresidual())
    484         print_log()
    485484        return scan
    486485
     486    @print_log_dec
    487487    def plot(self, residual=False, components=None, plotparms=False, filename=None):
    488488        """
     
    520520                             array(self.data._getmask(self._fittedrow),
    521521                                   copy=False))
    522                              
     522
    523523            ylab = self.data._get_ordinate_label()
    524524
     
    570570        if (not rcParams['plotter.gui']):
    571571            self._p.save(filename)
    572         print_log()
    573 
     572
     573    @print_log_dec
    574574    def auto_fit(self, insitu=None, plot=False):
    575575        """
     
    598598                                                                   scan.getbeam(r),
    599599                                                                   scan.getif(r),
    600                                                                    scan.getpol(r), 
     600                                                                   scan.getpol(r),
    601601                                                                   scan.getcycle(r))
    602602            asaplog.push(out, False)
     
    616616            self._p.unmap()
    617617            self._p = None
    618         print_log()
    619618        return scan
    620 
Note: See TracChangeset for help on using the changeset viewer.