Ignore:
Timestamp:
06/08/06 13:59:51 (18 years ago)
Author:
mar637
Message:

Added feature Ticket #42; The user can now plot the fits adn reject them.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/scantable.py

    r1033 r1061  
    10331033
    10341034
    1035     def poly_baseline(self, mask=None, order=0, insitu=None):
     1035    def poly_baseline(self, mask=None, order=0, plot=False, insitu=None):
    10361036        """
    10371037        Return a scan which has been baselined (all rows) by a polynomial.
     
    10401040            mask:       an optional mask
    10411041            order:      the order of the polynomial (default is 0)
     1042            plot:       plot the fit and the residual. In this each
     1043                        indivual fit has to be approved, by typing 'y'
     1044                        or 'n'
    10421045            insitu:     if False a new scantable is returned.
    10431046                        Otherwise, the scaling is done in-situ
    10441047                        The default is taken from .asaprc (False)
    1045             allaxes:    If True (default) apply to all spectra. Otherwise
    1046                         apply only to the selected (beam/pol/if)spectra only
    1047                         The default is taken from .asaprc (True if none)
    10481048        Example:
    10491049            # return a scan baselined by a third order polynomial,
     
    10601060        f.set_scan(self, mask)
    10611061        f.set_function(poly=order)
    1062         s = f.auto_fit(insitu)
     1062        s = f.auto_fit(insitu, plot=plot)
    10631063        s._add_history("poly_baseline", varlist)
    10641064        print_log()
     
    10671067
    10681068    def auto_poly_baseline(self, mask=[], edge=(0,0), order=0,
    1069                            threshold=3, insitu=None):
     1069                           threshold=3, plot=False, insitu=None):
    10701070        """
    10711071        Return a scan which has been baselined (all rows) by a polynomial.
     
    10861086                        keep it large as only strong lines affect the
    10871087                        baseline solution.
     1088            plot:       plot the fit and the residual. In this each
     1089                        indivual fit has to be approved, by typing 'y'
     1090                        or 'n'
    10881091            insitu:     if False a new scantable is returned.
    10891092                        Otherwise, the scaling is done in-situ
     
    11551158            f.fit()
    11561159            x = f.get_parameters()
     1160            if plot:
     1161                f.plot(residual=True)
     1162                x = raw_input("Accept fit ( [y]/n ): ")
     1163                if x.upper() == 'N':
     1164                    continue
    11571165            workscan._setspectrum(f.fitter.getresidual(), r)
    1158         workscan._add_history("poly_baseline", varlist)
     1166        if plot:
     1167            f._p.unmap()
     1168            f._p = None
     1169        workscan._add_history("auto_poly_baseline", varlist)
    11591170        if insitu:
    11601171            self._assign(workscan)
Note: See TracChangeset for help on using the changeset viewer.