Changeset 1039


Ignore:
Timestamp:
04/27/06 13:58:48 (18 years ago)
Author:
mar637
Message:

minor fix to printing of areas by component. The sum of all areas was printed instead of the area of the individual components.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapfitter.py

    r1031 r1039  
    291291        pars = list(self.fitter.getparameters())
    292292        fixed = list(self.fitter.getfixedparameters())
     293        area = []
    293294        if component is not None:
    294295            if self.fitfunc == "gauss":
     
    296297                cpars = pars[i:i+3]
    297298                cfixed = fixed[i:i+3]
     299                a = self.get_area(component)
     300                area = [a for i in range(3)]
    298301            else:
    299302                cpars = pars
     
    302305            cpars = pars
    303306            cfixed = fixed
    304         fpars = self._format_pars(cpars, cfixed, self.get_area(component))
     307            if self.fitfunc == "gauss":
     308                for c in range(len(self.components)):
     309                  a = self.get_area(c)
     310                  area += [a for i in range(3)]
     311
     312        fpars = self._format_pars(cpars, cfixed, area)
    305313        if rcParams['verbose']:
    306314            print fpars
     
    326334                ounit = self.data.get_fluxunit()
    327335            while i < len(pars):
    328                 if area:
    329                     out += '  %2d: peak = %3.3f %s , centre = %3.3f %s, FWHM = %3.3f %s\n      area = %3.3f %s %s\n' % (c,pars[i],ounit,pars[i+1],aunit,pars[i+2],aunit, area,ounit,aunit)
     336                if len(area):
     337                    out += '  %2d: peak = %3.3f %s , centre = %3.3f %s, FWHM = %3.3f %s\n      area = %3.3f %s %s\n' % (c,pars[i],ounit,pars[i+1],aunit,pars[i+2],aunit, area[i],ounit,aunit)
    330338                else:
    331339                    out += '  %2d: peak = %3.3f %s , centre = %3.3f %s, FWHM = %3.3f %s\n' % (c,pars[i],ounit,pars[i+1],aunit,pars[i+2],aunit,ounit,aunit)
Note: See TracChangeset for help on using the changeset viewer.