Changeset 526


Ignore:
Timestamp:
03/01/05 14:30:06 (19 years ago)
Author:
mar637
Message:

added more help

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapfitter.py

    r515 r526  
    105105        Execute the actual fitting process. All the state has to be set.
    106106        Parameters:
    107             none
     107            row:    specify the row in the scantable
    108108        Example:
    109109            s = scantable('myscan.asap')
     
    138138
    139139    def store_fit(self):
     140        """
     141        Store the fit parameters in the scantable.
     142        """
    140143        if self.fitted and self.data is not None:
    141144            pars = list(self.fitter.getparameters())
     
    145148
    146149    def set_parameters(self, params, fixed=None, component=None):
     150        """
     151        Set the parameters to be fitted.
     152        Parameters:
     153              params:    a vector of parameters
     154              fixed:     a vector of which parameters are to be held fixed
     155                         (default is none)
     156              component: in case of multiple gaussians, the index of the
     157                         component
     158             """
    147159        if self.fitfunc is None:
    148160            print "Please specify a fitting function first."
     
    173185        Set the Parameters of a 'Gaussian' component, set with set_function.
    174186        Parameters:
    175             component:           The number of the component (Default is the
    176                                  first component.
    177187            peak, centre, fhwm:  The gaussian parameters
    178188            peakfixed,
     
    182192                                 the fitting process. The default is to keep
    183193                                 all parameters flexible.
     194            component:           The number of the component (Default is the
     195                                 component 0)
    184196        """
    185197        if self.fitfunc != "gauss":
     
    197209        """
    198210        Return the fit paramters.
    199        
     211        Parameters:
     212             component:    get the parameters for the specified component
     213                           only, default is all components
    200214        """
    201215        if not self.fitted:
     
    282296    def commit(self):
    283297        """
    284         Return a new scan where the fits have been commited.
     298        Return a new scan where the fits have been commited (subtracted)
    285299        """
    286300        if not self.fitted:
     
    292306        scan._setspectrum(self.fitter.getresidual())
    293307
    294     def plot(self, residual=False, components=None, plotparms=False,
    295              plotrange=None):
     308    def plot(self, residual=False, components=None, plotparms=False):
    296309        """
    297310        Plot the last fit.
     
    299312            residual:    an optional parameter indicating if the residual
    300313                         should be plotted (default 'False')
     314            components:  a list of components to plot, e.g [0,1],
     315                         -1 plots the total fit. Default is to only
     316                         plot the total fit.
     317            plotparms:   Inidicates if the parameter values should be present
     318                         on the plot
    301319        """
    302320        if not self.fitted:
     
    332350            cs = components
    333351            if isinstance(components,int): cs = [components]
    334             self._p.text(0.15,0.15,str(self.get_parameters()[2]),size=8)
     352            if plotparms:
     353                self._p.text(0.15,0.15,str(self.get_parameters()[2]),size=8)
    335354            n = len(self.components)
    336355            self._p.palette(4)
Note: See TracChangeset for help on using the changeset viewer.