- Timestamp:
- 07/27/06 14:41:35 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapfitter.py
r1075 r1088 342 342 a = self.get_area(c) 343 343 area += [a for i in range(3)] 344 fpars = self._format_pars(cpars, cfixed, None, area)344 fpars = self._format_pars(cpars, cfixed, errors and cerrs, area) 345 345 if rcParams['verbose']: 346 346 print fpars … … 355 355 fix = "" 356 356 if fixed[i]: fix = "(fixed)" 357 out += ' p%d%s= %3.6f,' % (c,fix,pars[i]) 357 if errors : 358 out += ' p%d%s= %3.6f (%1.6f),' % (c,fix,pars[i], errors[i]) 359 else: 360 out += ' p%d%s= %3.6f,' % (c,fix,pars[i]) 358 361 c+=1 359 362 out = out[:-1] # remove trailing ',' … … 488 491 self._p.palette(0,colours) 489 492 self._p.set_line(label='Spectrum') 490 self._p.plot(self.x, self.y, m) 493 from matplotlib.numerix import ma,logical_not,array 494 y = ma.MA.MaskedArray(self.y,mask=logical_not(array(m,copy=0)),copy=0) 495 self._p.plot(self.x, y) 491 496 if residual: 492 497 self._p.palette(1) 493 498 self._p.set_line(label='Residual') 494 self._p.plot(self.x, self.get_residual(), m) 499 y = ma.MA.MaskedArray(self.get_residual(), 500 mask=logical_not(array(m,copy=0)),copy=0) 501 self._p.plot(self.x, y) 495 502 self._p.palette(2) 496 503 if components is not None: … … 505 512 lab = self.fitfuncs[c]+str(c) 506 513 self._p.set_line(label=lab) 507 self._p.plot(self.x, self.fitter.evaluate(c), m) 514 y = ma.MA.MaskedArray(self.fitter.evaluate(c), 515 mask=logical_not(array(m,copy=0)), 516 copy=0) 517 518 self._p.plot(self.x, y) 508 519 elif c == -1: 509 520 self._p.palette(2) 510 521 self._p.set_line(label="Total Fit") 511 self._p.plot(self.x, self.get_fit(), m) 522 y = ma.MA.MaskedArray(self.fitter.get_fit(), 523 mask=logical_not(array(m,copy=0)), 524 copy=0) 525 self._p.plot(self.x, y) 512 526 else: 513 527 self._p.palette(2) 514 528 self._p.set_line(label='Fit') 515 self._p.plot(self.x, self.get_fit(), m) 529 y = ma.MA.MaskedArray(self.fitter.get_fit(), 530 mask=logical_not(array(m,copy=0)), 531 copy=0) 532 self._p.plot(self.x, y) 516 533 xlim=[min(self.x),max(self.x)] 517 534 self._p.axes.set_xlim(xlim)
Note:
See TracChangeset
for help on using the changeset viewer.