- Timestamp:
- 08/31/06 11:10:17 (18 years ago)
- Location:
- tags/Release2.1.0b
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/Release2.1.0b/python/asapfitter.py
r1214 r1221 136 136 out = "Scan[%d] Beam[%d] IF[%d] Pol[%d] Cycle[%d]" % (self.data.getscan(i),self.data.getbeam(i),self.data.getif(i),self.data.getpol(i), self.data.getcycle(i)) 137 137 asaplog.push(out,False) 138 print self.mask 138 139 self.fitter.setdata(self.x, self.y, self.mask) 139 140 if self.fitfunc == 'gauss': … … 224 225 Set the Parameters of a 'Gaussian' component, set with set_function. 225 226 Parameters: 226 peak, centre, f hwm: The gaussian parameters227 peak, centre, fwhm: The gaussian parameters 227 228 peakfixed, 228 229 centerfixed, -
tags/Release2.1.0b/src/STFitter.cpp
r1067 r1221 205 205 if (parameters_.nelements() > 0 && tmppar.nelements() != parameters_.nelements()) 206 206 throw (AipsError("Number of parameters inconsistent with function.")); 207 if (parameters_.nelements() == 0) 207 if (parameters_.nelements() == 0) { 208 208 parameters_.resize(tmppar.nelements()); 209 fixedpar_.resize(tmppar.nelements()); 210 fixedpar_ = False; 209 if (tmppar.nelements() != fixedpar_.nelements()) { 210 fixedpar_.resize(tmppar.nelements()); 211 fixedpar_ = False; 212 } 213 } 211 214 if (dynamic_cast<Gaussian1D<Float>* >(funcs_[0]) != 0) { 212 215 uInt count = 0; … … 229 232 bool Fitter::setFixedParameters(std::vector<bool> fixed) 230 233 { 231 Vector<Bool> tmp(fixed);232 234 if (funcs_.nelements() == 0) 233 235 throw (AipsError("Function not yet set.")); 234 if (fixedpar_.nelements() > 0 && tmp.nelements() != fixedpar_.nelements())236 if (fixedpar_.nelements() > 0 && fixed.size() != fixedpar_.nelements()) 235 237 throw (AipsError("Number of mask elements inconsistent with function.")); 236 238 if (dynamic_cast<Gaussian1D<Float>* >(funcs_[0]) != 0) { … … 238 240 for (uInt j=0; j < funcs_.nelements(); ++j) { 239 241 for (uInt i=0; i < funcs_[j]->nparameters(); ++i) { 240 funcs_[j]->mask(i) = ! tmp[count];241 fixedpar_[count] = !tmp[count];242 funcs_[j]->mask(i) = !fixed[count]; 243 fixedpar_[count] = fixed[count]; 242 244 ++count; 243 245 } … … 245 247 } else if (dynamic_cast<Polynomial<Float>* >(funcs_[0]) != 0) { 246 248 for (uInt i=0; i < funcs_[0]->nparameters(); ++i) { 247 fixedpar_[i] = tmp[i];248 funcs_[0]->mask(i) = tmp[i];249 fixedpar_[i] = fixed[i]; 250 funcs_[0]->mask(i) = !fixed[i]; 249 251 } 250 252 } 251 //fixedpar_ = !tmpmsk;252 253 return true; 253 254 } … … 312 313 residual_ = y_; 313 314 fitter.residual(residual_,x_); 314 315 315 // use fitter.residual(model=True) to get the model 316 316 thefit_.resize(x_.nelements());
Note:
See TracChangeset
for help on using the changeset viewer.