labplot  2.8.2
About: LabPlot is an application for plotting and analysis of 2D and 3D functions and data. It is a complete rewrite of LabPlot1 and lacks in the first release a lot of features available in the predecessor. On the other hand, the GUI and the usability is more superior.
  Fossies Dox: labplot-2.8.2.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

nsl_smooth_check.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 ###########################################################################
3 # File : nsl_smooth_check.h
4 # Project : LabPlot
5 # Description : NSL smooth functions
6 # --------------------------------------------------------------------
7 # Copyright : (C) 2016 by Stefan Gerlach (stefan.gerlach@uni.kn)
8 #
9 ###########################################################################
10 
11 ###########################################################################
12 # #
13 # This program is free software; you can redistribute it and/or modify #
14 # it under the terms of the GNU General Public License as published by #
15 # the Free Software Foundation; either version 2 of the License, or #
16 # (at your option) any later version. #
17 # #
18 # This program is distributed in the hope that it will be useful, #
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
21 # GNU General Public License for more details. #
22 # #
23 # You should have received a copy of the GNU General Public License #
24 # along with this program; if not, write to the Free Software #
25 # Foundation, Inc., 51 Franklin Street, Fifth Floor, #
26 # Boston, MA 02110-1301 USA #
27 # #
28 ###########################################################################
29 
30 from scipy.signal import savgol_filter
31 import numpy as np
32 x = np.array([2, 2, 5, 2, 1, 0, 1, 4, 9])
33 
34 m=5
35 order=2
36 np.set_printoptions(precision=4)
37 print x
38 print "mode:interp"
39 print savgol_filter(x, m, order, mode='interp')
40 print "mode:mirror"
41 print savgol_filter(x, m, order, mode='mirror')
42 print "mode:nearest"
43 print savgol_filter(x, m, order, mode='nearest')
44 print "mode:constant"
45 print savgol_filter(x, m, order, mode='constant')
46 print "mode:wrap"
47 print savgol_filter(x, m, order, mode='wrap')