예제 #1
0
파일: spectrum.py 프로젝트: csb60/hyperspy
    def smooth_savitzky_golay(self, polynomial_order = None,
        number_of_points = None, differential_order = 0):
        '''Savitzky-Golay data smoothing'''
        if polynomial_order is not None and number_of_points is not None:
            for index in np.ndindex(
            tuple(self.axes_manager.navigation_shape)):
                self.axes_manager.set_not_slicing_indexes(index)
                self.data[self.axes_manager._getitem_tuple] = \
                    utils.sg(self(), number_of_points, 
                             polynomial_order, differential_order)
        else:
            smoother = SmoothingSavitzkyGolay(self)
            smoother.differential_order = differential_order
            if polynomial_order is not None:
                smoother.polynomial_order = polynomial_order
            if number_of_points is not None:
                smoother.number_of_points = number_of_points

            smoother.edit_traits()
예제 #2
0
    def smooth_savitzky_golay(self, polynomial_order = None,
        number_of_points = None, differential_order = 0):
        """Savitzky-Golay data smoothing
        
        """
        if (polynomial_order is not None and 
            number_of_points) is not None:
            for spectrum in self:
                spectrum.data[:] = utils.sg(self(),
                                            number_of_points, 
                                            polynomial_order,
                                            differential_order)
        else:
            smoother = SmoothingSavitzkyGolay(self)
            smoother.differential_order = differential_order
            if polynomial_order is not None:
                smoother.polynomial_order = polynomial_order
            if number_of_points is not None:
                smoother.number_of_points = number_of_points

            smoother.edit_traits()
예제 #3
0
파일: tools.py 프로젝트: iygr/hyperspy
 def model2plot(self, axes_manager = None):
     smoothed = utils.sg(self.signal(), self.number_of_points, 
                         self.polynomial_order, 0)
     return smoothed