Changeset 786 for branches/Release12


Ignore:
Timestamp:
12/08/05 09:51:43 (18 years ago)
Author:
mar637
Message:

added allaxes arg to poly_baseline

Location:
branches/Release12/python
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/Release12/python/asapfitter.py

    r723 r786  
    432432        print_log()
    433433
    434     def auto_fit(self, insitu=None):
     434    def auto_fit(self, insitu=None, allaxes=True):
    435435        """
    436436        Return a scan where the function is applied to all rows for
     
    454454        rows = range(scan.nrow())
    455455        from asap import asaplog
    456         for i in range(scan.nbeam()):
    457             scan.setbeam(i)
    458             for j in range(scan.nif()):
    459                 scan.setif(j)
    460                 for k in range(scan.npol()):
    461                     scan.setpol(k)
    462                     asaplog.push("Fitting:")
    463                     out = 'Beam[%d], IF[%d], Pol[%d]' % (i,j,k)
    464                     asaplog.push(out)
    465                     for iRow in rows:
    466                         self.x = scan._getabcissa(iRow)
    467                         self.y = scan._getspectrum(iRow)
    468                         self.data = None
    469                         self.fit()
    470                         x = self.get_parameters()
    471                         scan._setspectrum(self.fitter.getresidual(),iRow)
     456        if allaxes:
     457            for i in range(scan.nbeam()):
     458                scan.setbeam(i)
     459                for j in range(scan.nif()):
     460                    scan.setif(j)
     461                    for k in range(scan.npol()):
     462                        scan.setpol(k)
     463                        asaplog.push("Fitting:")
     464                        out = 'Beam[%d], IF[%d], Pol[%d]' % (i,j,k)
     465                        asaplog.push(out)
     466                        for iRow in rows:
     467                            self.x = scan._getabcissa(iRow)
     468                            self.y = scan._getspectrum(iRow)
     469                            self.data = None
     470                            self.fit()
     471                            x = self.get_parameters()
     472                            scan._setspectrum(self.fitter.getresidual(),iRow)
     473        else:
     474            asaplog.push("Fitting:")
     475            out = 'Beam[%d], IF[%d], Pol[%d]' % sel
     476            asaplog.push(out)
     477            for iRow in rows:
     478                self.x = scan._getabcissa(iRow)
     479                self.y = scan._getspectrum(iRow)
     480                self.data = None
     481                self.fit()
     482                x = self.get_parameters()
     483                scan._setspectrum(self.fitter.getresidual(),iRow)
     484
    472485        scan.set_cursor(sel[0],sel[1],sel[2])
    473486        print_log()
  • branches/Release12/python/scantable.py

    r785 r786  
    10831083        f.set_scan(self, mask)
    10841084        f.set_function(poly=order)
    1085         sf = f.auto_fit(insitu)
     1085        sf = f.auto_fit(insitu,allaxes)
    10861086        if insitu:
    10871087            self._add_history("poly_baseline", varlist)
Note: See TracChangeset for help on using the changeset viewer.