Changeset 1230 for tags/Release2.1.0b/python/asapfitter.py
- Timestamp:
- 09/01/06 10:45:58 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/Release2.1.0b/python/asapfitter.py
r1228 r1230 156 156 return 157 157 158 def store_fit(self): 159 """ 160 Store the fit parameters in the scantable. 158 def store_fit(self, filename=None): 159 """ 160 Save the fit parameters. 161 Parameters: 162 filename: if specified save as an ASCII file, if None (default) 163 store it in the scnatable 161 164 """ 162 165 if self.fitted and self.data is not None: … … 170 173 fit.setcomponents(self.components) 171 174 fit.setframeinfo(self.data._getcoordinfo()) 172 self.data._addfit(fit,self._fittedrow) 175 if filename is not None: 176 import os 177 filename = os.path.expandvars(os.path.expanduser(filename)) 178 if os.path.exists(filename): 179 raise IOError("File '%s' exists." % filename) 180 fit.save(filename) 181 else: 182 self.data._addfit(fit,self._fittedrow) 173 183 174 184 #def set_parameters(self, params, fixed=None, component=None): … … 353 363 for i in range(len(pars)): 354 364 fix = "" 355 if fixed[i]: fix = "(fixed)"365 if len(fixed) and fixed[i]: fix = "(fixed)" 356 366 if errors : 357 367 out += ' p%d%s= %3.6f (%1.6f),' % (c,fix,pars[i], errors[i])
Note: See TracChangeset
for help on using the changeset viewer.