Changeset 159


Ignore:
Timestamp:
12/26/04 22:42:54 (19 years ago)
Author:
kil064
Message:

function auto_fit now loops over all rows in the scan

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapfitter.py

    r158 r159  
    251251    def auto_fit(self):
    252252        """
    253         Return a scan where the function is applied to all Beams/IFs/Pols.
     253        Return a scan where the function is applied to all rows for all Beams/IFs/Pols.
    254254       
    255255        """
     
    262262        scan._verbose(False)
    263263        sel = scan.get_selection()
     264        rows = range(scan.nrow())
    264265        for i in range(scan.nbeam()):
    265266            scan.setbeam(i)
     
    268269                for k in range(scan.npol()):
    269270                    scan.setpol(k)
    270                     self.x = scan.getabcissa()
    271                     self.y = scan.getspectrum()
    272                     self.data = None
    273                     self.fit()                   
    274271                    if self._vb:
    275272                        print "Fitting:"
    276273                        print 'Beam[%d], IF[%d], Pol[%d]' % (i,j,k)
     274                    for iRow in rows:
     275                        self.x = scan.getabcissa(iRow)
     276                        self.y = scan.getspectrum(iRow)
     277                        self.data = None
     278                        self.fit()                   
    277279                        x = self.get_parameters()
    278                     scan.setspectrum(self.fitter.getresidual())
     280                        scan.setspectrum(self.fitter.getresidual(),iRow)
    279281        scan.set_selection(sel[0],sel[1],sel[2])
    280282        scan._verbose(vb)
    281283        return scan
    282    
Note: See TracChangeset for help on using the changeset viewer.