Changeset 526 for trunk/python
- Timestamp:
- 03/01/05 14:30:06 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapfitter.py
r515 r526 105 105 Execute the actual fitting process. All the state has to be set. 106 106 Parameters: 107 none107 row: specify the row in the scantable 108 108 Example: 109 109 s = scantable('myscan.asap') … … 138 138 139 139 def store_fit(self): 140 """ 141 Store the fit parameters in the scantable. 142 """ 140 143 if self.fitted and self.data is not None: 141 144 pars = list(self.fitter.getparameters()) … … 145 148 146 149 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 """ 147 159 if self.fitfunc is None: 148 160 print "Please specify a fitting function first." … … 173 185 Set the Parameters of a 'Gaussian' component, set with set_function. 174 186 Parameters: 175 component: The number of the component (Default is the176 first component.177 187 peak, centre, fhwm: The gaussian parameters 178 188 peakfixed, … … 182 192 the fitting process. The default is to keep 183 193 all parameters flexible. 194 component: The number of the component (Default is the 195 component 0) 184 196 """ 185 197 if self.fitfunc != "gauss": … … 197 209 """ 198 210 Return the fit paramters. 199 211 Parameters: 212 component: get the parameters for the specified component 213 only, default is all components 200 214 """ 201 215 if not self.fitted: … … 282 296 def commit(self): 283 297 """ 284 Return a new scan where the fits have been commited .298 Return a new scan where the fits have been commited (subtracted) 285 299 """ 286 300 if not self.fitted: … … 292 306 scan._setspectrum(self.fitter.getresidual()) 293 307 294 def plot(self, residual=False, components=None, plotparms=False, 295 plotrange=None): 308 def plot(self, residual=False, components=None, plotparms=False): 296 309 """ 297 310 Plot the last fit. … … 299 312 residual: an optional parameter indicating if the residual 300 313 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 301 319 """ 302 320 if not self.fitted: … … 332 350 cs = components 333 351 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) 335 354 n = len(self.components) 336 355 self._p.palette(4)
Note:
See TracChangeset
for help on using the changeset viewer.