Ignore:
Timestamp:
06/09/10 19:03:06 (14 years ago)
Author:
Kana Sugimoto
Message:

New Development: Yes

JIRA Issue: Yes (CAS-2211)

Ready for Test: Yes

Interface Changes: Yes

What Interface Changed: ASAP 3.0.0 interface changes

Test Programs:

Put in Release Notes: Yes

Module(s): all the CASA sd tools and tasks are affected.

Description: Merged ATNF-ASAP 3.0.0 developments to CASA (alma) branch.

Note you also need to update casa/code/atnf.


Location:
branches/alma
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/alma

  • branches/alma/python/asapfitter.py

    r1701 r1757  
    11import _asap
    22from asap import rcParams
    3 from asap import print_log
     3from asap import print_log, print_log_dec
    44from asap import _n_bools
    55from asap import mask_and
     
    7979        Set the function to be fit.
    8080        Parameters:
    81             poly:    use a polynomial of the order given with nonlinear least squares fit 
     81            poly:    use a polynomial of the order given with nonlinear least squares fit
    8282            lpoly:   use polynomial of the order given with linear least squares fit
    8383            gauss:   fit the number of gaussian specified
     
    9595            n = kwargs.get('poly')
    9696            self.components = [n]
    97             self.uselinear = False 
     97            self.uselinear = False
    9898        elif kwargs.has_key('lpoly'):
    9999            self.fitfunc = 'poly'
     
    106106            self.fitfuncs = [ 'gauss' for i in range(n) ]
    107107            self.components = [ 3 for i in range(n) ]
    108             self.uselinear = False 
     108            self.uselinear = False
    109109        elif kwargs.has_key('lorentz'):
    110110            n = kwargs.get('lorentz')
     
    112112            self.fitfuncs = [ 'lorentz' for i in range(n) ]
    113113            self.components = [ 3 for i in range(n) ]
    114             self.uselinear = False 
     114            self.uselinear = False
    115115        else:
    116116            msg = "Invalid function type."
     
    127127        return
    128128
     129    #@print_log_dec
    129130    def fit(self, row=0, estimate=False):
    130131        """
     
    164165                                                                      self.data.getbeam(i),
    165166                                                                      self.data.getif(i),
    166                                                                       self.data.getpol(i), 
     167                                                                      self.data.getpol(i),
    167168                                                                      self.data.getcycle(i))
    168169                asaplog.push(out,False)
     
    221222                self.data._addfit(fit,self._fittedrow)
    222223
    223     #def set_parameters(self, params, fixed=None, component=None):
     224    #@print_log_dec
    224225    def set_parameters(self,*args,**kwargs):
    225226        """
     
    543544        return self.fitter.getfit()
    544545
     546    #@print_log_dec
    545547    def commit(self):
    546548        """
     
    571573        return scan
    572574
    573     def plot(self, residual=False, components=None, plotparms=False, filename=None):
     575    #@print_log_dec
     576    def plot(self, residual=False, components=None, plotparms=False,
     577             filename=None):
    574578        """
    575579        Plot the last fit.
     
    598602        xlab = 'Abcissa'
    599603        ylab = 'Ordinate'
    600         from matplotlib.numerix import ma,logical_not,logical_and,array
     604        from numpy import ma,logical_not,logical_and,array
    601605        m = self.mask
    602606        if self.data:
     
    606610                             array(self.data._getmask(self._fittedrow),
    607611                                   copy=False))
    608                              
     612
    609613            ylab = self.data._get_ordinate_label()
    610614
     
    670674        print_log()
    671675
     676    #@print_log_dec
    672677    def auto_fit(self, insitu=None, plot=False):
    673678        """
     
    700705                                                                   scan.getbeam(r),
    701706                                                                   scan.getif(r),
    702                                                                    scan.getpol(r), 
     707                                                                   scan.getpol(r),
    703708                                                                   scan.getcycle(r))
    704709            asaplog.push(out, False)
     
    723728        print_log()
    724729        return scan
    725 
Note: See TracChangeset for help on using the changeset viewer.