comparison trafficintelligence/moving.py @ 1181:b3b1a5dfa17c

correct bug
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Mon, 28 Mar 2022 23:12:15 -0400
parents dc28364f34b9
children 0e5d37b0b9ff
comparison
equal deleted inserted replaced
1180:dc28364f34b9 1181:b3b1a5dfa17c
858 axis : The axis of the array x along which the filter is to be applied. Default is -1. 858 axis : The axis of the array x along which the filter is to be applied. Default is -1.
859 mode : Must be mirror, constant, nearest, wrap or interp. This determines the type of extension to use for the padded signal to which the filter is applied. When mode is constant, the padding value is given by cval. See the Notes for more details on mirror, constant, wrap, and nearest. When the interp mode is selected (the default), no extension is used. Instead, a degree polyorder polynomial is fit to the last window_length values of the edges, and this polynomial is used to evaluate the last window_length // 2 output values. 859 mode : Must be mirror, constant, nearest, wrap or interp. This determines the type of extension to use for the padded signal to which the filter is applied. When mode is constant, the padding value is given by cval. See the Notes for more details on mirror, constant, wrap, and nearest. When the interp mode is selected (the default), no extension is used. Instead, a degree polyorder polynomial is fit to the last window_length values of the edges, and this polynomial is used to evaluate the last window_length // 2 output values.
860 cval : Value to fill past the edges of the input if mode is constant. Default is 0.0. 860 cval : Value to fill past the edges of the input if mode is constant. Default is 0.0.
861 861
862 https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.savgol_filter.html#scipy.signal.savgol_filter''' 862 https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.savgol_filter.html#scipy.signal.savgol_filter'''
863 if removeBothEnds >=1: 863 if nInstantsIgnoredAtEnds >=1:
864 pos = [self.positions[0][nInstantsIgnoredAtEnds:-nInstantsIgnoredAtEnds], 864 pos = [self.positions[0][nInstantsIgnoredAtEnds:-nInstantsIgnoredAtEnds],
865 self.positions[1][nInstantsIgnoredAtEnds:-nInstantsIgnoredAtEnds]] 865 self.positions[1][nInstantsIgnoredAtEnds:-nInstantsIgnoredAtEnds]]
866 else: 866 else:
867 pos = self.positions 867 pos = self.positions
868 filtered = savgol_filter(pos, window_length, polyorder, deriv, delta, axis, mode, cval) 868 filtered = savgol_filter(pos, window_length, polyorder, deriv, delta, axis, mode, cval)