Changeset 1655 for branches/alma
- Timestamp:
- 11/05/09 21:40:21 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/alma/python/scantable.py
r1653 r1655 825 825 self._add_history("flag", varlist) 826 826 827 def flag_row(self, rows=[], unflag=False): 828 """ 829 Flag the selected data in row-based manner. 830 Parameters: 831 rows: list of row numbers to be flagged. Default is no row (must be explicitly specified to execute row-based flagging). 832 unflag: if True, unflag the data. 833 """ 834 varlist = vars() 835 try: 836 self._flag_row(rows, unflag) 837 except RuntimeError, msg: 838 if rcParams['verbose']: 839 print_log() 840 asaplog.push(msg.message) 841 print_log('ERROR') 842 return 843 else: raise 844 self._add_history("flag_row", varlist) 845 846 827 847 def lag_flag(self, frequency, width=0.0, unit="GHz", insitu=None): 828 848 """ … … 1578 1598 f.set_function(poly=order) 1579 1599 1580 rows = range( self.nrow())1600 rows = range(workscan.nrow()) 1581 1601 if len(rows) > 0: 1582 1602 self.blpars = [] … … 1584 1604 for r in rows: 1585 1605 # take into account flagtra info (CAS-1434) 1586 flagtra = self._getmask(r)1606 flagtra = workscan._getmask(r) 1587 1607 actualmask = mask[:] 1588 1608 if len(actualmask) == 0: … … 1594 1614 for i in range(0, len(actualmask)): 1595 1615 actualmask[i] = actualmask[i] and flagtra[i] 1596 f.set_scan( self, actualmask)1597 f.x = self._getabcissa(r)1598 f.y = self._getspectrum(r)1616 f.set_scan(workscan, actualmask) 1617 f.x = workscan._getabcissa(r) 1618 f.y = workscan._getspectrum(r) 1599 1619 f.data = None 1600 1620 f.fit() 1601 fpar = f.get_parameters()1602 1621 if plot: 1603 1622 f.plot(residual=True) … … 1607 1626 continue 1608 1627 workscan._setspectrum(f.fitter.getresidual(), r) 1609 self.blpars.append(fpar) 1628 self.blpars.append(f.get_parameters()) 1629 1610 1630 if plot: 1611 1631 f._p.unmap() 1612 1632 f._p = None 1613 #f.set_scan(self, mask)1614 #s = f.auto_fit(insitu, plot=plot)1615 ## Save parameters of baseline fits as a class attribute.1616 ## NOTICE: It does not reflect changes in scantable!1617 #self.blpars = f.blpars1618 1633 workscan._add_history("poly_baseline", varlist) 1619 1634 print_log() … … 1759 1774 asaplog.push(msg, False) 1760 1775 1761 fpar = f.get_parameters()1762 1776 if plot: 1763 1777 f.plot(residual=True) … … 1767 1781 self.masklists.append(None) 1768 1782 continue 1783 1769 1784 workscan._setspectrum(f.fitter.getresidual(), r) 1770 self.blpars.append(f par)1785 self.blpars.append(f.get_parameters()) 1771 1786 self.masklists.append(masklist) 1772 1787 if plot:
Note:
See TracChangeset
for help on using the changeset viewer.