Changeset 1574 for trunk


Ignore:
Timestamp:
06/29/09 12:19:49 (15 years ago)
Author:
Malte Marquarding
Message:

Ticket #167: python part of running polynomial smoothing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/scantable.py

    r1573 r1574  
    12321232        return s
    12331233
    1234     def smooth(self, kernel="hanning", width=5.0, insitu=None):
     1234    def smooth(self, kernel="hanning", width=5.0, order=2, insitu=None):
    12351235        """
    12361236        Smooth the spectrum by the specified kernel (conserving flux).
    12371237        Parameters:
    12381238            kernel:     The type of smoothing kernel. Select from
    1239                         'hanning' (default), 'gaussian', 'boxcar' and
    1240                         'rmedian'
     1239                        'hanning' (default), 'gaussian', 'boxcar', 'rmedian'
     1240                        or 'poly'
    12411241            width:      The width of the kernel in pixels. For hanning this is
    12421242                        ignored otherwise it defauls to 5 pixels.
    12431243                        For 'gaussian' it is the Full Width Half
    12441244                        Maximum. For 'boxcar' it is the full width.
    1245                         For 'rmedian' it is the half width.
     1245                        For 'rmedian' and 'poly' it is the half width.
     1246            order:      Optional parameter for 'poly' kernel (default is 2), to
     1247                        specify the order of the polnomial. Ignored by all other
     1248                        kernels.
    12461249            insitu:     if False a new scantable is returned.
    12471250                        Otherwise, the scaling is done in-situ
     
    12531256        self._math._setinsitu(insitu)
    12541257        varlist = vars()
    1255         s = scantable(self._math._smooth(self, kernel.lower(), width))
     1258        s = scantable(self._math._smooth(self, kernel.lower(), width, order))
    12561259        s._add_history("smooth", varlist)
    12571260        print_log()
Note: See TracChangeset for help on using the changeset viewer.