Changeset 2153 for trunk/python
- Timestamp:
- 04/25/11 18:41:34 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapfitter.py
r2151 r2153 30 30 """ 31 31 Set the absissa and ordinate for the fit. Also set the mask 32 indicati ong valid points.32 indicating valid points. 33 33 This can be used for data vectors retrieved from a scantable. 34 34 For scantable fitting use 'fitter.set_scan(scan, mask)'. … … 557 557 tlab = self.data._getsourcename(self._fittedrow) 558 558 xlab = self.data._getabcissalabel(self._fittedrow) 559 m = logical_and(self.mask, 560 array(self.data._getmask(self._fittedrow), 561 copy=False)) 559 if self.data._getflagrow(self._fittedrow): 560 m = [False] 561 else: 562 m = logical_and(self.mask, 563 array(self.data._getmask(self._fittedrow), 564 copy=False)) 562 565 563 566 ylab = self.data._get_ordinate_label() … … 567 570 for i in range(len(m)): 568 571 nomask = nomask and m[i] 572 if len(m) == 1: 573 m = m[0] 574 invm = (not m) 575 else: 576 invm = logical_not(m) 569 577 label0='Masked Region' 570 578 label1='Spectrum' … … 578 586 self._p.palette(0,colours) 579 587 self._p.set_line(label=label0) 580 y = ma.masked_array(self.y,mask= logical_not(m))588 y = ma.masked_array(self.y,mask=invm) 581 589 self._p.plot(self.x, y) 582 590 if residual: … … 584 592 self._p.set_line(label='Residual') 585 593 y = ma.masked_array(self.get_residual(), 586 mask= logical_not(m))594 mask=invm) 587 595 self._p.plot(self.x, y) 588 596 self._p.palette(2) … … 598 606 lab = self.fitfuncs[c]+str(c) 599 607 self._p.set_line(label=lab) 600 y = ma.masked_array(self.fitter.evaluate(c), 601 mask=logical_not(m)) 608 y = ma.masked_array(self.fitter.evaluate(c), mask=invm) 602 609 603 610 self._p.plot(self.x, y) … … 606 613 self._p.set_line(label="Total Fit") 607 614 y = ma.masked_array(self.fitter.getfit(), 608 mask= logical_not(m))615 mask=invm) 609 616 self._p.plot(self.x, y) 610 617 else: 611 618 self._p.palette(2) 612 619 self._p.set_line(label='Fit') 613 y = ma.masked_array(self.fitter.getfit(), 614 mask=logical_not(m)) 620 y = ma.masked_array(self.fitter.getfit(),mask=invm) 615 621 self._p.plot(self.x, y) 616 622 xlim=[min(self.x),max(self.x)]
Note:
See TracChangeset
for help on using the changeset viewer.