From d3a51f90a19b85eba68e28bc23f62b32ee43a6fe Mon Sep 17 00:00:00 2001 From: Per A Brodtkorb Date: Tue, 21 Feb 2017 09:23:05 +0100 Subject: [PATCH] Small reorganization --- wafo/sg_filter/tests/test_sg_filter.py | 34 ++++++++++++++------------ 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/wafo/sg_filter/tests/test_sg_filter.py b/wafo/sg_filter/tests/test_sg_filter.py index aa53c26..3aa9797 100644 --- a/wafo/sg_filter/tests/test_sg_filter.py +++ b/wafo/sg_filter/tests/test_sg_filter.py @@ -18,13 +18,13 @@ class Test(unittest.TestCase): n = 50 # truth = np.random.randn(n) * np.sqrt(q) + V0 - truth = np.array([12.0000146639, 12.0000065349, 12.0000032619, 11.9999884321, 11.9999738705, 11.9999717554, 12.000012208, 12.0000269596, 12.0000235391, 12.0000420788, 11.9999763588, 12.0000272251, 11.9999278487, 11.9999775611, 12.0000280208, 11.9999788802, 11.9999531533, 11.9999963402, 11.9999318055, 11.9999537065, 12.0000011098, 11.9999750291, 12.000012755, 11.9999355349, 11.9999960117, 12.0000033276, 12.0000100317, 11.9999962376, 12.0000527124, 12.000019087, 12.0000273276, 11.9999461331, 12.0000527385, 11.9999990413, 11.9999850764, 12.0000031025, 11.9999868222, 11.9999830042, 11.9999881952, 12.0000064122, 12.0000343455, 11.9999779108, 12.0000134648, 12.0000329604, 12.0000536949, 11.999990415, 11.9999935299, 11.9999850717, 12.0000048284, 12.000060395]) # nopep8 + truth = [12.0000146639, 12.0000065349, 12.0000032619, 11.9999884321, 11.9999738705, 11.9999717554, 12.000012208, 12.0000269596, 12.0000235391, 12.0000420788, 11.9999763588, 12.0000272251, 11.9999278487, 11.9999775611, 12.0000280208, 11.9999788802, 11.9999531533, 11.9999963402, 11.9999318055, 11.9999537065, 12.0000011098, 11.9999750291, 12.000012755, 11.9999355349, 11.9999960117, 12.0000033276, 12.0000100317, 11.9999962376, 12.0000527124, 12.000019087, 12.0000273276, 11.9999461331, 12.0000527385, 11.9999990413, 11.9999850764, 12.0000031025, 11.9999868222, 11.9999830042, 11.9999881952, 12.0000064122, 12.0000343455, 11.9999779108, 12.0000134648, 12.0000329604, 12.0000536949, 11.999990415, 11.9999935299, 11.9999850717, 12.0000048284, 12.000060395] # nopep8 # print(', '.join(['{0}'.format(y) for y in truth])) # noise = np.random.randn(n) * np.sqrt(r) - noise = np.array([0.0621366489443, 0.0247330994998, 0.109271521369, -0.0567657373852, -0.0315244553453, -0.0025701462034, 0.00181288937042, 0.109022849782, 0.0241169949603, -0.0543790728855, 0.0380117839575, 0.0582078684346, -0.0734606815139, -0.0665977120387, 0.0270631615171, 0.0369150024436, 0.0788445252483, 0.0111006834355, 0.0169567513801, 0.057081645789, -0.0293106512335, 0.0120282068494, 0.0211769283138, -0.0703228625119, -0.0222740803259, 0.0636500853308, 0.0302268639638, 0.0823316446844, 0.0504871636818, -0.0295402185417, 0.0780534199429, -0.0275453184976, -0.0613567940452, -0.0416930336494, -0.0972202720552, 0.0367572628693, 0.0150242119742, -0.0269063072041, 0.0654834111234, 0.0281867030757, -0.0978716452136, -0.0209143055692, -0.0236015624104, 0.0215804707908, -0.0525669442916, -0.00999304544556, -0.120029281573, -0.0255283929591, -0.00426938028504, -0.0487170747831]) # nopep8 + noise = [0.0621366489443, 0.0247330994998, 0.109271521369, -0.0567657373852, -0.0315244553453, -0.0025701462034, 0.00181288937042, 0.109022849782, 0.0241169949603, -0.0543790728855, 0.0380117839575, 0.0582078684346, -0.0734606815139, -0.0665977120387, 0.0270631615171, 0.0369150024436, 0.0788445252483, 0.0111006834355, 0.0169567513801, 0.057081645789, -0.0293106512335, 0.0120282068494, 0.0211769283138, -0.0703228625119, -0.0222740803259, 0.0636500853308, 0.0302268639638, 0.0823316446844, 0.0504871636818, -0.0295402185417, 0.0780534199429, -0.0275453184976, -0.0613567940452, -0.0416930336494, -0.0972202720552, 0.0367572628693, 0.0150242119742, -0.0269063072041, 0.0654834111234, 0.0281867030757, -0.0978716452136, -0.0209143055692, -0.0236015624104, 0.0215804707908, -0.0525669442916, -0.00999304544556, -0.120029281573, -0.0255283929591, -0.00426938028504, -0.0487170747831] # nopep8 # print('noise') # print(', '.join(['{0}'.format(y) for y in noise])) - z = truth + noise # measurement + z = np.array(truth) + np.array(noise) # measurement x = np.zeros(n) for i, zi in enumerate(z): @@ -45,32 +45,34 @@ class Test(unittest.TestCase): def test_hampelfilter(self): - Y = np.array([4979, 5002, 5004, 5000, 4987, 4989, 5008, 5013, 5000, 4996, 5026, 5000, 5003, 4988, 4991, 5017, 5013, 5004, 4990, 4997, 5010, 5007, 5001, 4970, 5002, 4986, 5032, 5003, 4994, 5001, 4988, 4998, 5002, 4996, 4988, 5009, 5003, 4986, 4996, 4994, 4997, 5003, 5012, 5002, 5001, 5006, 5006, 4986, 4998, 4978, 4995, 4999, 4987, 5015, 5009, 5016, 4995, 5007, 5013, 4996, 5018, 4992, 4989, 4994, 4991, 4995, 5018, 5007, 5008, 4990, 5010, 4986, 5009, 4999, 5008, 5000, 5001, 5000, 5004, 5032, 5009, 5005, 5014, 5000, 4992, 4994, 4991, 4993, 5000, 5005, 4993, 5003, 4995, 4980, 4995, 4999, 5007, 5000, 4988, 4982, 5030, 4997, 4993, 5009, 4993, 5020, 5010, 4997, 4987, 4999, 5006, 4984, 5000, 4987, 4986, 5006, 5002, 5001, 5003, 4996, 4994, 5002, 4989, 4998, 4996, 5007, 4993, 4998, 5001, 4989, 5012, 5001, 5010, 4996, 5004, 5008, 5002, 5024, 4997, 5001, 5010, 5023, 4996, 5018, 5002, 4990, 5009, 4997, 5016, 5000, 5013, 5008, 4990, 5011, 4996, 5010, 5004, 5023, 4999, 5004, 4996, 5011, 4998, 5000, 4988, 5000, 4993, 4998, 5000, 5006, 5010, 4988, 5000, 4997, 4995, 4996, 5005, 5003, 5009, 5009, 4997, 5010, 5014, 4990, 5013, 5015, 5011, 4987, 5004, 4999, 5030, 5000, 5000, 4999, 5013, 5012, 5001, 5012, 4995, 4997, 4995, 4985, 4989, 5007, 5010, 4997, 5011, 4995, 5000, 5011, 4998, 4991, 5021, 5003, 4985, 4991, 4995, 5018, 4979, 5003, 5011, 5009, 5001, 4998, 5008, 4994, 5016, 4992, 5008, 4993, 4983, 5010, 5023, 4975, 4987, 4994, 5002, 4984, 5005, 5006, 5005, 5000, 4996, 5000, 4999, 5004, 4994, 5000, 4981, 5001, 4994, 4993, 5000, 5004, 5001, 4992, 5002, 5006, 4997, 4987, 5001, 5008, 5011, 4995, 5006, 4976, 4999, 4989, 5008, 4996, 4997, 5006, 5005, 5007, 4990, 5010, 4996, 4998, 5000, 5014, 5002, 5001, 4996, 4997, 5000, 5003, 5000, 4986, 5013, 5001, 4990, 4990, 5010, 5000, 5021, 5000, 5006, 4995, 5012, 5019, 5000, 5006, 4999, 5007, 5014, 5000, 4994, 4991, 5010, 4985, 4988, 5007, 5005, 5000, 5005, 4997, 4995, 4987, 5000, 5000, 5009, 5000, 4999, 5011, 5018, 4994, 5000, 4995, 5000, 5008, 4994, 4992, 5000, 4998, 4992, 5006, 4996, 5000, 5018, 5000, 5022, 5002, 5007, 5000, 5012, 5014, 5010, 4997, 4996, 5014, 4995, 4991, 5006, 4992, 5008, 5004, 4995, 5016, 4974, 5005, 5000, 4985, 5002, 5000, 5009, 4991, 4995, 5004, 4987, 5014, 4986, 5008, 4985, 4995, 5010, 5000, 5001, 5013, 4988, 5001, 5002, 4986, 4985, 5001, 4995, 5004, 4998, 4998, 4992, 5003, 5000, 4991, 4998, 5002, 5011, 4986, 5013, 4997, 5000, 4997, 5003, 5014, 4998, 5002, 5006, 5015, 4992, 4992, 4995, 4998, 4994, 5007, 4977, 5004, 5005, 4990, 4991, 5001, 5010, 4991, 4990, 5006, 5004, 5004, 4997, 5001, 4992, 5000, 5000, 4996, 4987, 4993, 5001, 5006, 4999, 4993, 4999, 5001, 5001, 5014, 4985, 5010, 5006, 4989, 5002, 5011, 4999, 5010, 5005, 5002, 5010, 4990, 4994, 5000, 4985, 5010, 5000, 4999, 5000, 4977, 5007, 5005, 4990, 5000, 4985, 5003, 5009, 5012, 5012, 5000, 5018, 4997, 5002, 4992, 4999, 4997, 5005, 5009, 4989, 5005, 4988, 5001, 5000, 5018, 4999, 5005, 4997, 5015, 5001, 4988, 4983, 5013, 4992, 5002, 5012, 4999, 5013, 5000, 4988, 4989, 4996, 5000, 5002, 4999, 5021, 4991, 5009, 5005, 4994, 5000, 4994, 4985, 4999, 4980, 5013, 5014, 5000, 4996, 5008, 5028, 5002, 5004, 4999, 5012, 4992, 5002, 4987, 5004, 5009, 5004, 5013, 4989, 5027, 4992, 5016, 5007, 5003, 5013, 5003, 4983, 5000, 4987, 5001, 4998, 4994, 4998, 4997, 5023, 4971, 5001, 4990, 5025, 5003, 4996, 5006, 5005, 4995, 4994, 5023, 5003, 5005, 4991, 5001, 5028, 4996, 5001, 5005, 5001, 5001, 5028, 4983, 5000, 5005, 5001, 4999, 5003, 4982, 5000, 5012, 5011, 5008, 5000, 4998, 4994, 4988, 5013, 4998, 5017, 4991, 5007, 5016, 5007, 4997, 4974, 4997, 5006, 5003, 5010, 5003, 4997, 4997, 4994, 4998, 4987, 5004, 4974, 5009, 5006, 5009, 4984, 5010, 5023, 5000, 5008, 4992, 5008, 4993, 5010, 5012, 4989, 5002, 4993, 5007, 4985, 4990, 4988, 4997, 5000, 4994, 5004, 4981, 5000, 4999, 5003, 4988, 5006, 5019, 5003, 4992, 4977, 4998, 4987, 4995, 4987, 5000, 4986, 4998, 4996, 5008, 5011, 5009, 5000, 4999, 5010, 4999, 5009, 5010, 4992, 4998, 4994, 5009, 4998, 5013, 5011, 4997, 5016, 4995, 5003, 4986, 5010, 4995, 4986, 5025, 4990, 5010, 4990, 4996, 5000, 5002, 4994, 5002, 5000, 5020, 4995, 5003, 5006, 5000, 4997, 4996, 5010, 4992, 5013, 4998, 4988, 4999, 5004, 5004, 5002, 5002, 5001, 4986, 5011, 5012, 4988, 5000, 5000, 5012, 5004, 5004, 4984, 5012, 4998, 5005, 5005, 5005, 4995, 4971, 5006, 5000, 5008, 5015, 4999, 4999, 4996, 5000, 4992, 5019, 5020, 4999, 4991, 5020, 5000, 5002, 5000, 5003, 4985, 4990, 5011, 5012, 4997, 4989, 4999, 5006, 4997, 4992, 4999, 4985, 4999, 5012, 5003, 4989, 5010, 5010, 5012, 4990, 4986, 5014, 5000, 4994, 5017, 4995, 5005, 5003, 5000, 5000, 4988, 5018, 5007, 5009, 5002, 5004, 4999, 5026, 4987, 4986, 5000, 4994, 5012, 5022, 4996, 5002, 4986, 4990, 4989, 5030, 4997, 5002, 5004, 4999, 5000, 4992, 4977, 4997, 4998, 5000, 4987, 5032, 4998, 5014, 4978, 5001, 4988, 5006, 5003, 5005, 5021, 5005, 5000, 5003, 4990, 4991, 4990, 5016, 5006, 4981, 5002, 4998, 4989, 4995, 5007, 5004, 5019, 5001, 5004, 5000, 4996, 4988, 5022, 5003, 5009, 4998, 5003, 4991, 5000, 4988, 5004, 5002, 4991, 4998, 4996, 4991, 5013, 5007, 5010, 5004, 5006, 5007, 4993, 5000, 5002, 4992, 4999, 4992, 5001, 4989, 4992, 5015, 5011, 5008, 5004, 4990, 4995, 4993, 5004, 4995, 4982, 5008, 5000, 4993, 5000, 5000, 4991, 5005, 5008, 5003, 4994, 4997, 5012, 4995, 5009, 5020, 5010, 5019, 4979, 5013, 4990, 5002, 5000, 5015, 4989, 5009, 4998, 5004, 5010, 4988, 4994, 5004, 4985, 4998, 4991, 4985, 4994, 4986, 5010, 4990, 5002, 5005, 5008, 5004, 4988, 4980, 5005, 4994, 5004, 4998, 4990, 5010, 5003, 5011, 4992, 5009, 5003, 5013, 4996, 4997, 4989, 4992, 5002, 4992, 4996, 4999, 5000, 5009, 4990, 4992, 5020, 4981, 5011, 5000, 5008, 4997, 4994, 4982, 5014, 5013, 4996, 5002, 5011, 5003, 5000, 5015, 4999, 5001, 5002, 5018, 4984, 5022, 5009, 5006, 5009, 5000, 4974, 4991, 5020, 5000, 4987, 5003, 4987, 5003, 5002, 5016, 4997, 5022, 5005, 4998, 4999, 5001, 5000, 5008, 5000, 5001, 4994, 4991, 4997, 4990, 4991, 4995, 5008, 5007, 4994, 5000, 5007, 4988, 5014, 5003, 4998, 4995, 5000, 5000, 5004], dtype=float) # nopep8 + y = np.array([4979, 5002, 5004, 5000, 4987, 4989, 5008, 5013, 5000, 4996, 5026, 5000, 5003, 4988, 4991, 5017, 5013, 5004, 4990, 4997, 5010, 5007, 5001, 4970, 5002, 4986, 5032, 5003, 4994, 5001, 4988, 4998, 5002, 4996, 4988, 5009, 5003, 4986, 4996, 4994, 4997, 5003, 5012, 5002, 5001, 5006, 5006, 4986, 4998, 4978, 4995, 4999, 4987, 5015, 5009, 5016, 4995, 5007, 5013, 4996, 5018, 4992, 4989, 4994, 4991, 4995, 5018, 5007, 5008, 4990, 5010, 4986, 5009, 4999, 5008, 5000, 5001, 5000, 5004, 5032, 5009, 5005, 5014, 5000, 4992, 4994, 4991, 4993, 5000, 5005, 4993, 5003, 4995, 4980, 4995, 4999, 5007, 5000, 4988, 4982, 5030, 4997, 4993, 5009, 4993, 5020, 5010, 4997, 4987, 4999, 5006, 4984, 5000, 4987, 4986, 5006, 5002, 5001, 5003, 4996, 4994, 5002, 4989, 4998, 4996, 5007, 4993, 4998, 5001, 4989, 5012, 5001, 5010, 4996, 5004, 5008, 5002, 5024, 4997, 5001, 5010, 5023, 4996, 5018, 5002, 4990, 5009, 4997, 5016, 5000, 5013, 5008, 4990, 5011, 4996, 5010, 5004, 5023, 4999, 5004, 4996, 5011, 4998, 5000, 4988, 5000, 4993, 4998, 5000, 5006, 5010, 4988, 5000, 4997, 4995, 4996, 5005, 5003, 5009, 5009, 4997, 5010, 5014, 4990, 5013, 5015, 5011, 4987, 5004, 4999, 5030, 5000, 5000, 4999, 5013, 5012, 5001, 5012, 4995, 4997, 4995, 4985, 4989, 5007, 5010, 4997, 5011, 4995, 5000, 5011, 4998, 4991, 5021, 5003, 4985, 4991, 4995, 5018, 4979, 5003, 5011, 5009, 5001, 4998, 5008, 4994, 5016, 4992, 5008, 4993, 4983, 5010, 5023, 4975, 4987, 4994, 5002, 4984, 5005, 5006, 5005, 5000, 4996, 5000, 4999, 5004, 4994, 5000, 4981, 5001, 4994, 4993, 5000, 5004, 5001, 4992, 5002, 5006, 4997, 4987, 5001, 5008, 5011, 4995, 5006, 4976, 4999, 4989, 5008, 4996, 4997, 5006, 5005, 5007, 4990, 5010, 4996, 4998, 5000, 5014, 5002, 5001, 4996, 4997, 5000, 5003, 5000, 4986, 5013, 5001, 4990, 4990, 5010, 5000, 5021, 5000, 5006, 4995, 5012, 5019, 5000, 5006, 4999, 5007, 5014, 5000, 4994, 4991, 5010, 4985, 4988, 5007, 5005, 5000, 5005, 4997, 4995, 4987, 5000, 5000, 5009, 5000, 4999, 5011, 5018, 4994, 5000, 4995, 5000, 5008, 4994, 4992, 5000, 4998, 4992, 5006, 4996, 5000, 5018, 5000, 5022, 5002, 5007, 5000, 5012, 5014, 5010, 4997, 4996, 5014, 4995, 4991, 5006, 4992, 5008, 5004, 4995, 5016, 4974, 5005, 5000, 4985, 5002, 5000, 5009, 4991, 4995, 5004, 4987, 5014, 4986, 5008, 4985, 4995, 5010, 5000, 5001, 5013, 4988, 5001, 5002, 4986, 4985, 5001, 4995, 5004, 4998, 4998, 4992, 5003, 5000, 4991, 4998, 5002, 5011, 4986, 5013, 4997, 5000, 4997, 5003, 5014, 4998, 5002, 5006, 5015, 4992, 4992, 4995, 4998, 4994, 5007, 4977, 5004, 5005, 4990, 4991, 5001, 5010, 4991, 4990, 5006, 5004, 5004, 4997, 5001, 4992, 5000, 5000, 4996, 4987, 4993, 5001, 5006, 4999, 4993, 4999, 5001, 5001, 5014, 4985, 5010, 5006, 4989, 5002, 5011, 4999, 5010, 5005, 5002, 5010, 4990, 4994, 5000, 4985, 5010, 5000, 4999, 5000, 4977, 5007, 5005, 4990, 5000, 4985, 5003, 5009, 5012, 5012, 5000, 5018, 4997, 5002, 4992, 4999, 4997, 5005, 5009, 4989, 5005, 4988, 5001, 5000, 5018, 4999, 5005, 4997, 5015, 5001, 4988, 4983, 5013, 4992, 5002, 5012, 4999, 5013, 5000, 4988, 4989, 4996, 5000, 5002, 4999, 5021, 4991, 5009, 5005, 4994, 5000, 4994, 4985, 4999, 4980, 5013, 5014, 5000, 4996, 5008, 5028, 5002, 5004, 4999, 5012, 4992, 5002, 4987, 5004, 5009, 5004, 5013, 4989, 5027, 4992, 5016, 5007, 5003, 5013, 5003, 4983, 5000, 4987, 5001, 4998, 4994, 4998, 4997, 5023, 4971, 5001, 4990, 5025, 5003, 4996, 5006, 5005, 4995, 4994, 5023, 5003, 5005, 4991, 5001, 5028, 4996, 5001, 5005, 5001, 5001, 5028, 4983, 5000, 5005, 5001, 4999, 5003, 4982, 5000, 5012, 5011, 5008, 5000, 4998, 4994, 4988, 5013, 4998, 5017, 4991, 5007, 5016, 5007, 4997, 4974, 4997, 5006, 5003, 5010, 5003, 4997, 4997, 4994, 4998, 4987, 5004, 4974, 5009, 5006, 5009, 4984, 5010, 5023, 5000, 5008, 4992, 5008, 4993, 5010, 5012, 4989, 5002, 4993, 5007, 4985, 4990, 4988, 4997, 5000, 4994, 5004, 4981, 5000, 4999, 5003, 4988, 5006, 5019, 5003, 4992, 4977, 4998, 4987, 4995, 4987, 5000, 4986, 4998, 4996, 5008, 5011, 5009, 5000, 4999, 5010, 4999, 5009, 5010, 4992, 4998, 4994, 5009, 4998, 5013, 5011, 4997, 5016, 4995, 5003, 4986, 5010, 4995, 4986, 5025, 4990, 5010, 4990, 4996, 5000, 5002, 4994, 5002, 5000, 5020, 4995, 5003, 5006, 5000, 4997, 4996, 5010, 4992, 5013, 4998, 4988, 4999, 5004, 5004, 5002, 5002, 5001, 4986, 5011, 5012, 4988, 5000, 5000, 5012, 5004, 5004, 4984, 5012, 4998, 5005, 5005, 5005, 4995, 4971, 5006, 5000, 5008, 5015, 4999, 4999, 4996, 5000, 4992, 5019, 5020, 4999, 4991, 5020, 5000, 5002, 5000, 5003, 4985, 4990, 5011, 5012, 4997, 4989, 4999, 5006, 4997, 4992, 4999, 4985, 4999, 5012, 5003, 4989, 5010, 5010, 5012, 4990, 4986, 5014, 5000, 4994, 5017, 4995, 5005, 5003, 5000, 5000, 4988, 5018, 5007, 5009, 5002, 5004, 4999, 5026, 4987, 4986, 5000, 4994, 5012, 5022, 4996, 5002, 4986, 4990, 4989, 5030, 4997, 5002, 5004, 4999, 5000, 4992, 4977, 4997, 4998, 5000, 4987, 5032, 4998, 5014, 4978, 5001, 4988, 5006, 5003, 5005, 5021, 5005, 5000, 5003, 4990, 4991, 4990, 5016, 5006, 4981, 5002, 4998, 4989, 4995, 5007, 5004, 5019, 5001, 5004, 5000, 4996, 4988, 5022, 5003, 5009, 4998, 5003, 4991, 5000, 4988, 5004, 5002, 4991, 4998, 4996, 4991, 5013, 5007, 5010, 5004, 5006, 5007, 4993, 5000, 5002, 4992, 4999, 4992, 5001, 4989, 4992, 5015, 5011, 5008, 5004, 4990, 4995, 4993, 5004, 4995, 4982, 5008, 5000, 4993, 5000, 5000, 4991, 5005, 5008, 5003, 4994, 4997, 5012, 4995, 5009, 5020, 5010, 5019, 4979, 5013, 4990, 5002, 5000, 5015, 4989, 5009, 4998, 5004, 5010, 4988, 4994, 5004, 4985, 4998, 4991, 4985, 4994, 4986, 5010, 4990, 5002, 5005, 5008, 5004, 4988, 4980, 5005, 4994, 5004, 4998, 4990, 5010, 5003, 5011, 4992, 5009, 5003, 5013, 4996, 4997, 4989, 4992, 5002, 4992, 4996, 4999, 5000, 5009, 4990, 4992, 5020, 4981, 5011, 5000, 5008, 4997, 4994, 4982, 5014, 5013, 4996, 5002, 5011, 5003, 5000, 5015, 4999, 5001, 5002, 5018, 4984, 5022, 5009, 5006, 5009, 5000, 4974, 4991, 5020, 5000, 4987, 5003, 4987, 5003, 5002, 5016, 4997, 5022, 5005, 4998, 4999, 5001, 5000, 5008, 5000, 5001, 4994, 4991, 4997, 4990, 4991, 4995, 5008, 5007, 4994, 5000, 5007, 4988, 5014, 5003, 4998, 4995, 5000, 5000, 5004], dtype=float) # nopep8 # randint = np.random.randint - # Y = 5000 + np.int_(10*np.random.randn(1000)) + # y = 5000 + np.int_(10*np.random.randn(1000)) # outliers = randint(0, 1000, size=(10,)) outliers = np.array([470, 795, 399, 614, 864, 37, 815, 112, 69, 16]) # noise = randint(1000, size=(10,)) noise = np.array([932, 286, 736, 427, 858, 63, 243, 264, 668, 844]) - # print(', '.join(['{0:d}'.format(y) for y in Y])) - Y[outliers] = Y[outliers] + noise - YY, res = HampelFilter(fulloutput=True)(Y) + y[outliers] = y[outliers] + noise + yy, res = HampelFilter(fulloutput=True)(y) + yy1 = HampelFilter(dx=1, t=3, adaptive=0.1, fulloutput=False)(y) + yy2 = HampelFilter(dx=3, t=0, fulloutput=False)(y) + # print(', '.join(['{0:d}'.format(yj) for yj in y])) + # print(', '.join(['{0:d}'.format(int(yj)) for yj in yy2])) self.assert_(sum(res['outliers'] == True) == 76) valid_names = set(('Y0', 'outliers', 'LB', 'ADX', 'UB')) for name in res: self.assert_(name in valid_names) - - assert_array_almost_equal(YY[outliers], [5002, 5000, 5003, 5008, 5000, + assert_array_almost_equal(yy[outliers], [5002, 5000, 5003, 5008, 5000, 4997, 4998, 4999, 5009, 4997]) - assert_array_almost_equal(np.int_(YY), [5001, 5002, 5004, 5000, 4987, 4989, 5008, 5013, 5000, 4996, 5000, 5000, 5003, 4988, 4991, 5017, 4997, 5004, 4990, 4997, 5010, 5007, 5001, 4970, 5002, 4986, 5032, 5003, 4994, 5001, 4988, 4998, 5002, 4996, 4988, 5009, 5003, 4997, 4996, 4994, 4997, 5003, 5012, 5002, 5001, 5006, 5006, 4986, 4998, 4978, 4995, 4999, 4987, 5015, 5009, 5016, 4995, 5007, 5013, 4996, 5018, 4992, 4989, 4994, 4991, 4995, 5018, 5007, 5008, 5009, 5010, 5008, 5009, 4999, 5000, 5000, 5001, 5000, 5004, 5005, 5009, 5005, 5014, 5000, 4992, 4994, 4991, 4993, 5000, 5005, 4993, 5003, 4995, 4980, 4995, 4999, 5007, 5000, 4988, 4982, 5030, 4997, 4993, 5009, 4993, 5020, 5010, 4997, 4987, 4999, 5006, 4984, 4999, 4987, 4986, 5006, 5002, 5001, 5003, 4996, 4994, 5002, 4989, 4998, 4996, 5007, 4993, 4998, 5001, 4989, 5012, 5001, 5010, 4996, 5004, 5008, 5002, 5004, 4997, 5001, 5010, 5023, 4996, 5018, 5002, 4990, 5009, 4997, 5016, 5000, 5013, 5008, 4990, 5011, 4996, 5010, 5004, 5023, 4999, 5004, 4996, 5011, 4998, 5000, 4998, 5000, 4993, 4998, 5000, 5006, 5010, 4988, 5000, 4997, 4995, 4996, 5005, 5003, 5009, 5009, 4997, 5010, 5014, 5011, 5013, 5015, 5011, 4987, 5004, 4999, 5000, 5000, 5000, 4999, 5001, 5012, 5001, 5012, 4995, 4997, 4995, 4985, 4989, 5007, 5010, 4997, 5011, 4995, 5000, 5011, 4998, 4991, 5021, 5003, 4985, 4991, 4995, 5018, 4979, 5003, 5011, 5009, 5001, 4998, 5008, 4994, 5016, 4992, 5008, 4993, 4983, 5010, 5023, 4975, 4987, 4994, 5002, 5002, 5005, 5006, 5005, 5000, 4996, 5000, 4999, 5004, 5000, 5000, 4981, 5001, 4994, 4993, 5000, 5004, 5001, 4992, 5002, 5006, 4997, 4987, 5001, 5008, 5011, 4995, 5006, 4976, 4999, 4989, 5008, 4996, 4997, 5006, 5005, 5007, 4990, 5010, 4996, 4998, 5000, 5000, 5002, 5001, 4996, 4997, 5000, 5003, 5000, 5000, 5013, 5001, 4990, 4990, 5010, 5000, 5021, 5000, 5006, 4995, 5012, 5019, 5000, 5006, 4999, 5007, 5014, 5000, 4994, 4991, 5010, 4985, 4988, 5007, 5005, 5000, 5005, 4997, 4995, 4987, 5000, 5000, 5000, 5000, 4999, 5011, 5018, 4994, 5000, 4995, 5000, 5008, 4994, 4992, 5000, 4998, 4992, 5006, 4996, 5000, 5018, 5000, 5002, 5002, 5007, 5000, 5012, 5014, 5010, 4997, 4996, 5014, 4995, 4991, 5006, 4992, 5008, 5004, 4995, 5016, 5000, 5005, 5000, 4985, 5002, 5000, 5009, 4991, 4995, 5004, 4987, 5014, 4986, 5008, 4985, 4995, 5010, 5000, 5001, 5001, 5001, 5001, 5002, 4986, 5001, 5001, 4995, 5004, 4998, 4998, 4992, 5003, 5000, 4991, 4998, 5002, 5011, 5000, 5013, 4997, 5000, 5003, 5003, 5014, 4998, 5002, 5006, 5015, 4992, 4992, 4995, 4998, 4994, 5007, 4977, 5004, 5005, 4990, 4991, 4991, 4991, 4991, 5004, 5006, 5004, 5004, 4997, 5001, 4992, 5000, 5000, 4996, 4987, 4993, 5001, 5006, 4999, 4993, 4999, 5001, 5001, 5014, 4985, 5010, 5006, 4989, 5002, 5011, 4999, 5010, 5005, 5002, 5010, 4990, 4994, 5000, 4985, 5000, 5000, 4999, 5000, 5000, 5007, 5005, 4990, 5000, 4985, 5003, 5009, 5012, 5012, 5000, 5002, 4997, 5002, 4992, 4999, 4997, 5005, 5009, 4989, 5005, 4988, 5001, 5000, 5000, 4999, 5005, 4997, 5015, 5001, 4988, 4983, 5013, 4992, 5002, 5012, 4999, 5013, 5000, 4988, 4989, 4996, 5000, 5002, 4999, 5002, 4991, 5009, 5005, 4994, 5000, 4994, 4985, 4999, 4980, 5013, 5014, 5000, 4996, 5008, 5002, 5002, 5004, 4999, 5012, 4992, 5002, 4987, 5004, 5009, 5004, 5013, 4989, 5027, 4992, 5016, 5007, 5003, 5013, 5003, 5001, 5000, 4987, 5001, 4998, 4994, 4998, 4997, 4997, 4971, 5001, 4990, 5001, 5003, 4996, 5006, 5005, 4995, 5005, 5023, 5003, 5005, 4991, 5001, 5001, 4996, 5001, 5005, 5001, 5001, 5001, 5001, 5000, 5005, 5001, 4999, 5003, 5001, 5000, 5012, 5011, 5008, 5000, 4998, 4994, 4988, 5013, 4998, 5017, 4991, 5007, 5016, 5007, 4997, 5003, 4997, 5006, 5003, 5010, 5003, 4997, 4997, 4994, 4998, 4987, 5004, 5004, 5009, 5006, 5009, 5009, 5010, 5023, 5000, 5008, 5008, 5008, 4993, 5010, 5012, 4989, 5002, 4993, 4990, 4985, 4990, 4988, 4997, 5000, 4994, 5004, 5000, 5000, 4999, 5003, 5003, 5006, 5019, 5003, 4992, 4977, 4998, 4987, 4995, 4987, 5000, 4986, 4998, 4996, 5008, 5011, 5009, 5000, 5009, 5010, 4999, 5009, 5010, 4992, 4998, 4994, 5009, 4998, 5013, 5011, 4997, 5016, 4995, 5003, 4986, 5010, 4995, 4986, 5025, 4990, 5010, 4990, 4996, 5000, 5002, 4994, 5002, 5000, 5002, 4995, 5003, 5006, 5000, 4997, 4996, 4998, 4992, 5013, 4998, 4988, 4999, 5004, 5004, 5002, 5002, 5001, 4986, 5011, 5012, 4988, 5000, 5000, 5012, 5004, 5004, 4984, 5004, 5005, 5005, 5005, 5005, 5005, 5005, 5006, 5000, 5008, 5015, 4999, 4999, 4996, 5000, 4992, 5019, 5020, 4999, 4991, 5000, 5000, 5002, 5000, 5003, 4985, 4990, 5011, 5012, 4997, 4989, 4999, 4997, 4997, 4992, 4999, 4985, 4999, 5012, 5003, 5010, 5010, 5010, 5012, 5010, 4986, 5014, 5000, 4994, 5017, 4995, 5005, 5003, 5000, 5000, 4988, 5018, 5007, 5009, 5002, 5004, 4999, 5000, 4987, 4986, 5000, 4994, 5012, 5022, 4996, 5002, 4986, 4990, 4989, 4997, 4997, 5002, 5004, 4999, 5000, 4992, 4998, 4997, 4998, 5000, 5000, 5032, 4998, 5014, 4978, 5001, 5003, 5006, 5003, 5005, 5005, 5005, 5000, 5003, 4990, 4991, 4990, 5016, 5006, 4981, 4998, 4998, 4989, 4995, 5007, 5004, 5004, 5001, 5004, 5000, 4996, 4988, 5000, 5003, 5009, 4998, 5003, 4991, 5000, 4988, 5004, 5002, 4991, 4998, 4996, 4991, 5013, 5007, 5010, 5004, 5006, 5007, 4993, 5000, 5002, 4992, 4999, 4992, 5001, 4989, 4992, 5015, 5011, 5008, 5004, 4990, 4995, 4993, 5004, 5000, 4982, 5008, 5000, 4993, 5000, 5000, 4991, 5005, 5008, 5003, 4994, 4997, 5012, 4995, 5009, 5020, 5010, 5019, 4979, 5013, 4990, 5002, 5000, 5015, 4989, 5009, 4998, 5004, 5010, 4988, 4994, 5004, 4985, 4998, 4991, 4985, 4994, 4986, 5010, 4990, 5002, 5005, 5008, 5004, 4988, 5004, 5005, 4994, 5004, 4998, 4990, 5010, 5003, 5011, 4992, 5009, 5003, 5013, 4996, 4997, 4989, 4992, 5002, 4992, 4996, 4999, 5000, 5009, 4990, 4992, 5020, 4981, 5011, 5000, 5008, 4997, 4994, 4982, 5014, 5013, 4996, 5002, 5011, 5003, 5000, 5002, 4999, 5001, 5002, 5018, 4984, 5022, 5009, 5006, 5009, 5000, 4974, 4991, 5020, 5000, 4987, 5003, 5002, 5003, 5002, 5016, 4997, 5002, 5005, 4998, 4999, 5001, 5000, 5000, 5000, 5001, 4994, 4991, 4997, 4990, 4991, 4995, 5008, 5007, 4994, 5000, 5007, 4988, 5014, 5003, 4998, 4995, 5000, 5000, 5004]) # nopep8 - YY1 = HampelFilter(dx=1, t=3, adaptive=0.1, fulloutput=False)(Y) - assert_array_almost_equal(np.int_(YY1), [4999, 5002, 5004, 5000, 4987, 4989, 5008, 5013, 5000, 4996, 5026, 5000, 5003, 4988, 4991, 5017, 5003, 5004, 4990, 4997, 5010, 5007, 5001, 4970, 5002, 4986, 5032, 5003, 4994, 5001, 4988, 4998, 5002, 4996, 4988, 5009, 5003, 5001, 4996, 4994, 4997, 5003, 5012, 5002, 5001, 5006, 5006, 4986, 4998, 4978, 4995, 4999, 4987, 5015, 5009, 5016, 4995, 5007, 5013, 4996, 5018, 4992, 4989, 4994, 4991, 4995, 5018, 5007, 5008, 5006, 5010, 4986, 5009, 4999, 5008, 5000, 5001, 5000, 5004, 5004, 5009, 5005, 5014, 5000, 4992, 4994, 4991, 4993, 5000, 5005, 4993, 5003, 4995, 4980, 4995, 4999, 5007, 5000, 4988, 4982, 5030, 4997, 4993, 5009, 4993, 5020, 5010, 4997, 4987, 4999, 5006, 4984, 4998, 4987, 4986, 5006, 5002, 5001, 5003, 4996, 4994, 5002, 4989, 4998, 4996, 5007, 4993, 4998, 5001, 4989, 5012, 5001, 5010, 4996, 5004, 5008, 5002, 5024, 4997, 5001, 5010, 5023, 4996, 5018, 5002, 4990, 5009, 4997, 5016, 5000, 5013, 5008, 4990, 5011, 4996, 5010, 5004, 5023, 4999, 5004, 4996, 5011, 4998, 5000, 4988, 5000, 4993, 4998, 5000, 5006, 5010, 4988, 5000, 4997, 4995, 4996, 5005, 5003, 5009, 5009, 4997, 5010, 5014, 5009, 5013, 5015, 5011, 5005, 5004, 4999, 5002, 5000, 5000, 4999, 5013, 5012, 5001, 5012, 4995, 4997, 4995, 4985, 4989, 5007, 5010, 4997, 5011, 4995, 5000, 5011, 4998, 4991, 5021, 5003, 4985, 4991, 4995, 5018, 4979, 5003, 5011, 5009, 5001, 4998, 5008, 4994, 5016, 4992, 5008, 4993, 4983, 5010, 5023, 4975, 4987, 4994, 5002, 4984, 5005, 5006, 5005, 5000, 4996, 5000, 4999, 5004, 4994, 5000, 4981, 5001, 4994, 4993, 5000, 5004, 5001, 4992, 5002, 5006, 4997, 4987, 5001, 5008, 5011, 4995, 5006, 4976, 4999, 4989, 5008, 4996, 4997, 5006, 5005, 5007, 4990, 5010, 4996, 4998, 5000, 5000, 5002, 5001, 4996, 4997, 5000, 5003, 5000, 4986, 5013, 5001, 4990, 4990, 5010, 5000, 5021, 5000, 5006, 4995, 5012, 5019, 5000, 5006, 4999, 5007, 5014, 5000, 4994, 4991, 5010, 4985, 4988, 5007, 5005, 5000, 5005, 4997, 4995, 4999, 5000, 5000, 5009, 5000, 4999, 5011, 5018, 4994, 5000, 4995, 5000, 5008, 4994, 4992, 5000, 4998, 4992, 5006, 4996, 5000, 5018, 5000, 5022, 5002, 5007, 5000, 5012, 5014, 5010, 4997, 4996, 5014, 4995, 4991, 5006, 4992, 5008, 5004, 4995, 5016, 5000, 5005, 5000, 4985, 5002, 5000, 5009, 4991, 4995, 5004, 4987, 5014, 4986, 5008, 4985, 4995, 5010, 5000, 5001, 5013, 4988, 5001, 5002, 4986, 4985, 5001, 4995, 5004, 4998, 4998, 4992, 5003, 5000, 4991, 4998, 5002, 5011, 4986, 5013, 4997, 5000, 5002, 5003, 5014, 4998, 5002, 5006, 5015, 4992, 4992, 4995, 4998, 4994, 5007, 4977, 5004, 5005, 4990, 4991, 5001, 5010, 4991, 4990, 5006, 5004, 5004, 4997, 5001, 4992, 5000, 5000, 4996, 4987, 4993, 5001, 5006, 4999, 4993, 4999, 5001, 5001, 5014, 4985, 5010, 5006, 4989, 5002, 5011, 4999, 5010, 5005, 5002, 5010, 4990, 4994, 5000, 4985, 5010, 5000, 4999, 5000, 4977, 5007, 5005, 4990, 5000, 4985, 5003, 5009, 5012, 5012, 5000, 5003, 4997, 5002, 4992, 4999, 4997, 5005, 5009, 4989, 5005, 4988, 5001, 5000, 5000, 4999, 5005, 4997, 5015, 5001, 4988, 4983, 5013, 4992, 5002, 5012, 4999, 5013, 5000, 4988, 4989, 4996, 5000, 5002, 4999, 5021, 4991, 5009, 5005, 4994, 5000, 4994, 4985, 4999, 4980, 5013, 5014, 5000, 4996, 5008, 5028, 5002, 5004, 4999, 5012, 4992, 5002, 4987, 5004, 5009, 5004, 5013, 4989, 5027, 4992, 5016, 5007, 5003, 5013, 5003, 4999, 5000, 4987, 5001, 4998, 4994, 4998, 4997, 4998, 4998, 5001, 4990, 5025, 5003, 4996, 5006, 5005, 4995, 4994, 5023, 5003, 5005, 4991, 5001, 5001, 4996, 5001, 5005, 5001, 5001, 5000, 5000, 5000, 5005, 5001, 4999, 5003, 4982, 5000, 5012, 5011, 5008, 5000, 4998, 4994, 4988, 5013, 4998, 5017, 4991, 5007, 5016, 5007, 4997, 4974, 4997, 5006, 5003, 5010, 5003, 4997, 4997, 4994, 4998, 4987, 5004, 5001, 5009, 5006, 5009, 4984, 5010, 5023, 5000, 5008, 5007, 5008, 4993, 5010, 5012, 4989, 5002, 4993, 5007, 4985, 4990, 4988, 4997, 5000, 4994, 5004, 4981, 5000, 4999, 5003, 4988, 5006, 5019, 5003, 4992, 4977, 4998, 4987, 4995, 4987, 5000, 4986, 4998, 4996, 5008, 5011, 5009, 5000, 4999, 5010, 4999, 5009, 5010, 4992, 4998, 4994, 5009, 4998, 5013, 5011, 4997, 5016, 4995, 5003, 4986, 5010, 4995, 4986, 5025, 4990, 5010, 4990, 4996, 5000, 5002, 4994, 5002, 5000, 5001, 4995, 5003, 5006, 5000, 4997, 4996, 5010, 4992, 5013, 4998, 4988, 4999, 5004, 5004, 5002, 5002, 5001, 4986, 5011, 5012, 4988, 5000, 5000, 5012, 5004, 5004, 4984, 5012, 4998, 5005, 5005, 5005, 4995, 5004, 5006, 5000, 5008, 5015, 4999, 4999, 4996, 5000, 4992, 5019, 5020, 4999, 4991, 5020, 5000, 5002, 5000, 5003, 4985, 4990, 5011, 5012, 4997, 4989, 4999, 5006, 4997, 4992, 4999, 4985, 4999, 5012, 5003, 4989, 5010, 5010, 5012, 4990, 4986, 5014, 5000, 4994, 5017, 4995, 5005, 5003, 5000, 5000, 4988, 5018, 5007, 5009, 5002, 5004, 4999, 5026, 4987, 4986, 5000, 4994, 5012, 5022, 4996, 5002, 4986, 4990, 4989, 4997, 4997, 5002, 5004, 4999, 5000, 4992, 4999, 4997, 4998, 5000, 5002, 5032, 4998, 5014, 4978, 5001, 4988, 5006, 5003, 5005, 5002, 5005, 5000, 5003, 4990, 4991, 4990, 5016, 5006, 4981, 4999, 4998, 4989, 4995, 5007, 5004, 5019, 5001, 5004, 5000, 4996, 4988, 5001, 5003, 5009, 4998, 5003, 4991, 5000, 4988, 5004, 5002, 4991, 4998, 4996, 4991, 5013, 5007, 5010, 5004, 5006, 5007, 4993, 5000, 5002, 4992, 4999, 4992, 5001, 4989, 4992, 5015, 5011, 5008, 5004, 4990, 4995, 4993, 5004, 5000, 4982, 5008, 5000, 4993, 5000, 5000, 4991, 5005, 5008, 5003, 4994, 4997, 5012, 4995, 5009, 5020, 5010, 5019, 4979, 5013, 4990, 5002, 5000, 5015, 4989, 5009, 4998, 5004, 5010, 4988, 4994, 5004, 4985, 4998, 4991, 4985, 4994, 4986, 5010, 4990, 5002, 5005, 5008, 5004, 4988, 4980, 5005, 4994, 5004, 4998, 4990, 5010, 5003, 5011, 4992, 5009, 5003, 5013, 4996, 4997, 4989, 4992, 5002, 4992, 4996, 4999, 5000, 5009, 4990, 4992, 5020, 4981, 5011, 5000, 5008, 4997, 4994, 4982, 5014, 5013, 4996, 5002, 5011, 5003, 5000, 5015, 4999, 5001, 5002, 5018, 4984, 5022, 5009, 5006, 5009, 5000, 4974, 4991, 5020, 5000, 4987, 5003, 4987, 5003, 5002, 5016, 4997, 5022, 5005, 4998, 4999, 5001, 5000, 4999, 5000, 5001, 4994, 4991, 4997, 4990, 4991, 4995, 5008, 5007, 4994, 5000, 5007, 4988, 5014, 5003, 4998, 4995, 5000, 5000, 5004]) # nopep8 + true_yy = [5001, 5002, 5004, 5000, 4987, 4989, 5008, 5013, 5000, 4996, 5000, 5000, 5003, 4988, 4991, 5017, 4997, 5004, 4990, 4997, 5010, 5007, 5001, 4970, 5002, 4986, 5032, 5003, 4994, 5001, 4988, 4998, 5002, 4996, 4988, 5009, 5003, 4997, 4996, 4994, 4997, 5003, 5012, 5002, 5001, 5006, 5006, 4986, 4998, 4978, 4995, 4999, 4987, 5015, 5009, 5016, 4995, 5007, 5013, 4996, 5018, 4992, 4989, 4994, 4991, 4995, 5018, 5007, 5008, 5009, 5010, 5008, 5009, 4999, 5000, 5000, 5001, 5000, 5004, 5005, 5009, 5005, 5014, 5000, 4992, 4994, 4991, 4993, 5000, 5005, 4993, 5003, 4995, 4980, 4995, 4999, 5007, 5000, 4988, 4982, 5030, 4997, 4993, 5009, 4993, 5020, 5010, 4997, 4987, 4999, 5006, 4984, 4999, 4987, 4986, 5006, 5002, 5001, 5003, 4996, 4994, 5002, 4989, 4998, 4996, 5007, 4993, 4998, 5001, 4989, 5012, 5001, 5010, 4996, 5004, 5008, 5002, 5004, 4997, 5001, 5010, 5023, 4996, 5018, 5002, 4990, 5009, 4997, 5016, 5000, 5013, 5008, 4990, 5011, 4996, 5010, 5004, 5023, 4999, 5004, 4996, 5011, 4998, 5000, 4998, 5000, 4993, 4998, 5000, 5006, 5010, 4988, 5000, 4997, 4995, 4996, 5005, 5003, 5009, 5009, 4997, 5010, 5014, 5011, 5013, 5015, 5011, 4987, 5004, 4999, 5000, 5000, 5000, 4999, 5001, 5012, 5001, 5012, 4995, 4997, 4995, 4985, 4989, 5007, 5010, 4997, 5011, 4995, 5000, 5011, 4998, 4991, 5021, 5003, 4985, 4991, 4995, 5018, 4979, 5003, 5011, 5009, 5001, 4998, 5008, 4994, 5016, 4992, 5008, 4993, 4983, 5010, 5023, 4975, 4987, 4994, 5002, 5002, 5005, 5006, 5005, 5000, 4996, 5000, 4999, 5004, 5000, 5000, 4981, 5001, 4994, 4993, 5000, 5004, 5001, 4992, 5002, 5006, 4997, 4987, 5001, 5008, 5011, 4995, 5006, 4976, 4999, 4989, 5008, 4996, 4997, 5006, 5005, 5007, 4990, 5010, 4996, 4998, 5000, 5000, 5002, 5001, 4996, 4997, 5000, 5003, 5000, 5000, 5013, 5001, 4990, 4990, 5010, 5000, 5021, 5000, 5006, 4995, 5012, 5019, 5000, 5006, 4999, 5007, 5014, 5000, 4994, 4991, 5010, 4985, 4988, 5007, 5005, 5000, 5005, 4997, 4995, 4987, 5000, 5000, 5000, 5000, 4999, 5011, 5018, 4994, 5000, 4995, 5000, 5008, 4994, 4992, 5000, 4998, 4992, 5006, 4996, 5000, 5018, 5000, 5002, 5002, 5007, 5000, 5012, 5014, 5010, 4997, 4996, 5014, 4995, 4991, 5006, 4992, 5008, 5004, 4995, 5016, 5000, 5005, 5000, 4985, 5002, 5000, 5009, 4991, 4995, 5004, 4987, 5014, 4986, 5008, 4985, 4995, 5010, 5000, 5001, 5001, 5001, 5001, 5002, 4986, 5001, 5001, 4995, 5004, 4998, 4998, 4992, 5003, 5000, 4991, 4998, 5002, 5011, 5000, 5013, 4997, 5000, 5003, 5003, 5014, 4998, 5002, 5006, 5015, 4992, 4992, 4995, 4998, 4994, 5007, 4977, 5004, 5005, 4990, 4991, 4991, 4991, 4991, 5004, 5006, 5004, 5004, 4997, 5001, 4992, 5000, 5000, 4996, 4987, 4993, 5001, 5006, 4999, 4993, 4999, 5001, 5001, 5014, 4985, 5010, 5006, 4989, 5002, 5011, 4999, 5010, 5005, 5002, 5010, 4990, 4994, 5000, 4985, 5000, 5000, 4999, 5000, 5000, 5007, 5005, 4990, 5000, 4985, 5003, 5009, 5012, 5012, 5000, 5002, 4997, 5002, 4992, 4999, 4997, 5005, 5009, 4989, 5005, 4988, 5001, 5000, 5000, 4999, 5005, 4997, 5015, 5001, 4988, 4983, 5013, 4992, 5002, 5012, 4999, 5013, 5000, 4988, 4989, 4996, 5000, 5002, 4999, 5002, 4991, 5009, 5005, 4994, 5000, 4994, 4985, 4999, 4980, 5013, 5014, 5000, 4996, 5008, 5002, 5002, 5004, 4999, 5012, 4992, 5002, 4987, 5004, 5009, 5004, 5013, 4989, 5027, 4992, 5016, 5007, 5003, 5013, 5003, 5001, 5000, 4987, 5001, 4998, 4994, 4998, 4997, 4997, 4971, 5001, 4990, 5001, 5003, 4996, 5006, 5005, 4995, 5005, 5023, 5003, 5005, 4991, 5001, 5001, 4996, 5001, 5005, 5001, 5001, 5001, 5001, 5000, 5005, 5001, 4999, 5003, 5001, 5000, 5012, 5011, 5008, 5000, 4998, 4994, 4988, 5013, 4998, 5017, 4991, 5007, 5016, 5007, 4997, 5003, 4997, 5006, 5003, 5010, 5003, 4997, 4997, 4994, 4998, 4987, 5004, 5004, 5009, 5006, 5009, 5009, 5010, 5023, 5000, 5008, 5008, 5008, 4993, 5010, 5012, 4989, 5002, 4993, 4990, 4985, 4990, 4988, 4997, 5000, 4994, 5004, 5000, 5000, 4999, 5003, 5003, 5006, 5019, 5003, 4992, 4977, 4998, 4987, 4995, 4987, 5000, 4986, 4998, 4996, 5008, 5011, 5009, 5000, 5009, 5010, 4999, 5009, 5010, 4992, 4998, 4994, 5009, 4998, 5013, 5011, 4997, 5016, 4995, 5003, 4986, 5010, 4995, 4986, 5025, 4990, 5010, 4990, 4996, 5000, 5002, 4994, 5002, 5000, 5002, 4995, 5003, 5006, 5000, 4997, 4996, 4998, 4992, 5013, 4998, 4988, 4999, 5004, 5004, 5002, 5002, 5001, 4986, 5011, 5012, 4988, 5000, 5000, 5012, 5004, 5004, 4984, 5004, 5005, 5005, 5005, 5005, 5005, 5005, 5006, 5000, 5008, 5015, 4999, 4999, 4996, 5000, 4992, 5019, 5020, 4999, 4991, 5000, 5000, 5002, 5000, 5003, 4985, 4990, 5011, 5012, 4997, 4989, 4999, 4997, 4997, 4992, 4999, 4985, 4999, 5012, 5003, 5010, 5010, 5010, 5012, 5010, 4986, 5014, 5000, 4994, 5017, 4995, 5005, 5003, 5000, 5000, 4988, 5018, 5007, 5009, 5002, 5004, 4999, 5000, 4987, 4986, 5000, 4994, 5012, 5022, 4996, 5002, 4986, 4990, 4989, 4997, 4997, 5002, 5004, 4999, 5000, 4992, 4998, 4997, 4998, 5000, 5000, 5032, 4998, 5014, 4978, 5001, 5003, 5006, 5003, 5005, 5005, 5005, 5000, 5003, 4990, 4991, 4990, 5016, 5006, 4981, 4998, 4998, 4989, 4995, 5007, 5004, 5004, 5001, 5004, 5000, 4996, 4988, 5000, 5003, 5009, 4998, 5003, 4991, 5000, 4988, 5004, 5002, 4991, 4998, 4996, 4991, 5013, 5007, 5010, 5004, 5006, 5007, 4993, 5000, 5002, 4992, 4999, 4992, 5001, 4989, 4992, 5015, 5011, 5008, 5004, 4990, 4995, 4993, 5004, 5000, 4982, 5008, 5000, 4993, 5000, 5000, 4991, 5005, 5008, 5003, 4994, 4997, 5012, 4995, 5009, 5020, 5010, 5019, 4979, 5013, 4990, 5002, 5000, 5015, 4989, 5009, 4998, 5004, 5010, 4988, 4994, 5004, 4985, 4998, 4991, 4985, 4994, 4986, 5010, 4990, 5002, 5005, 5008, 5004, 4988, 5004, 5005, 4994, 5004, 4998, 4990, 5010, 5003, 5011, 4992, 5009, 5003, 5013, 4996, 4997, 4989, 4992, 5002, 4992, 4996, 4999, 5000, 5009, 4990, 4992, 5020, 4981, 5011, 5000, 5008, 4997, 4994, 4982, 5014, 5013, 4996, 5002, 5011, 5003, 5000, 5002, 4999, 5001, 5002, 5018, 4984, 5022, 5009, 5006, 5009, 5000, 4974, 4991, 5020, 5000, 4987, 5003, 5002, 5003, 5002, 5016, 4997, 5002, 5005, 4998, 4999, 5001, 5000, 5000, 5000, 5001, 4994, 4991, 4997, 4990, 4991, 4995, 5008, 5007, 4994, 5000, 5007, 4988, 5014, 5003, 4998, 4995, 5000, 5000, 5004] # nopep8 + true_yy1 = [4999, 5002, 5004, 5000, 4987, 4989, 5008, 5013, 5000, 4996, 5026, 5000, 5003, 4988, 4991, 5017, 5003, 5004, 4990, 4997, 5010, 5007, 5001, 4970, 5002, 4986, 5032, 5003, 4994, 5001, 4988, 4998, 5002, 4996, 4988, 5009, 5003, 5001, 4996, 4994, 4997, 5003, 5012, 5002, 5001, 5006, 5006, 4986, 4998, 4978, 4995, 4999, 4987, 5015, 5009, 5016, 4995, 5007, 5013, 4996, 5018, 4992, 4989, 4994, 4991, 4995, 5018, 5007, 5008, 5006, 5010, 4986, 5009, 4999, 5008, 5000, 5001, 5000, 5004, 5004, 5009, 5005, 5014, 5000, 4992, 4994, 4991, 4993, 5000, 5005, 4993, 5003, 4995, 4980, 4995, 4999, 5007, 5000, 4988, 4982, 5030, 4997, 4993, 5009, 4993, 5020, 5010, 4997, 4987, 4999, 5006, 4984, 4998, 4987, 4986, 5006, 5002, 5001, 5003, 4996, 4994, 5002, 4989, 4998, 4996, 5007, 4993, 4998, 5001, 4989, 5012, 5001, 5010, 4996, 5004, 5008, 5002, 5024, 4997, 5001, 5010, 5023, 4996, 5018, 5002, 4990, 5009, 4997, 5016, 5000, 5013, 5008, 4990, 5011, 4996, 5010, 5004, 5023, 4999, 5004, 4996, 5011, 4998, 5000, 4988, 5000, 4993, 4998, 5000, 5006, 5010, 4988, 5000, 4997, 4995, 4996, 5005, 5003, 5009, 5009, 4997, 5010, 5014, 5009, 5013, 5015, 5011, 5005, 5004, 4999, 5002, 5000, 5000, 4999, 5013, 5012, 5001, 5012, 4995, 4997, 4995, 4985, 4989, 5007, 5010, 4997, 5011, 4995, 5000, 5011, 4998, 4991, 5021, 5003, 4985, 4991, 4995, 5018, 4979, 5003, 5011, 5009, 5001, 4998, 5008, 4994, 5016, 4992, 5008, 4993, 4983, 5010, 5023, 4975, 4987, 4994, 5002, 4984, 5005, 5006, 5005, 5000, 4996, 5000, 4999, 5004, 4994, 5000, 4981, 5001, 4994, 4993, 5000, 5004, 5001, 4992, 5002, 5006, 4997, 4987, 5001, 5008, 5011, 4995, 5006, 4976, 4999, 4989, 5008, 4996, 4997, 5006, 5005, 5007, 4990, 5010, 4996, 4998, 5000, 5000, 5002, 5001, 4996, 4997, 5000, 5003, 5000, 4986, 5013, 5001, 4990, 4990, 5010, 5000, 5021, 5000, 5006, 4995, 5012, 5019, 5000, 5006, 4999, 5007, 5014, 5000, 4994, 4991, 5010, 4985, 4988, 5007, 5005, 5000, 5005, 4997, 4995, 4999, 5000, 5000, 5009, 5000, 4999, 5011, 5018, 4994, 5000, 4995, 5000, 5008, 4994, 4992, 5000, 4998, 4992, 5006, 4996, 5000, 5018, 5000, 5022, 5002, 5007, 5000, 5012, 5014, 5010, 4997, 4996, 5014, 4995, 4991, 5006, 4992, 5008, 5004, 4995, 5016, 5000, 5005, 5000, 4985, 5002, 5000, 5009, 4991, 4995, 5004, 4987, 5014, 4986, 5008, 4985, 4995, 5010, 5000, 5001, 5013, 4988, 5001, 5002, 4986, 4985, 5001, 4995, 5004, 4998, 4998, 4992, 5003, 5000, 4991, 4998, 5002, 5011, 4986, 5013, 4997, 5000, 5002, 5003, 5014, 4998, 5002, 5006, 5015, 4992, 4992, 4995, 4998, 4994, 5007, 4977, 5004, 5005, 4990, 4991, 5001, 5010, 4991, 4990, 5006, 5004, 5004, 4997, 5001, 4992, 5000, 5000, 4996, 4987, 4993, 5001, 5006, 4999, 4993, 4999, 5001, 5001, 5014, 4985, 5010, 5006, 4989, 5002, 5011, 4999, 5010, 5005, 5002, 5010, 4990, 4994, 5000, 4985, 5010, 5000, 4999, 5000, 4977, 5007, 5005, 4990, 5000, 4985, 5003, 5009, 5012, 5012, 5000, 5003, 4997, 5002, 4992, 4999, 4997, 5005, 5009, 4989, 5005, 4988, 5001, 5000, 5000, 4999, 5005, 4997, 5015, 5001, 4988, 4983, 5013, 4992, 5002, 5012, 4999, 5013, 5000, 4988, 4989, 4996, 5000, 5002, 4999, 5021, 4991, 5009, 5005, 4994, 5000, 4994, 4985, 4999, 4980, 5013, 5014, 5000, 4996, 5008, 5028, 5002, 5004, 4999, 5012, 4992, 5002, 4987, 5004, 5009, 5004, 5013, 4989, 5027, 4992, 5016, 5007, 5003, 5013, 5003, 4999, 5000, 4987, 5001, 4998, 4994, 4998, 4997, 4998, 4998, 5001, 4990, 5025, 5003, 4996, 5006, 5005, 4995, 4994, 5023, 5003, 5005, 4991, 5001, 5001, 4996, 5001, 5005, 5001, 5001, 5000, 5000, 5000, 5005, 5001, 4999, 5003, 4982, 5000, 5012, 5011, 5008, 5000, 4998, 4994, 4988, 5013, 4998, 5017, 4991, 5007, 5016, 5007, 4997, 4974, 4997, 5006, 5003, 5010, 5003, 4997, 4997, 4994, 4998, 4987, 5004, 5001, 5009, 5006, 5009, 4984, 5010, 5023, 5000, 5008, 5007, 5008, 4993, 5010, 5012, 4989, 5002, 4993, 5007, 4985, 4990, 4988, 4997, 5000, 4994, 5004, 4981, 5000, 4999, 5003, 4988, 5006, 5019, 5003, 4992, 4977, 4998, 4987, 4995, 4987, 5000, 4986, 4998, 4996, 5008, 5011, 5009, 5000, 4999, 5010, 4999, 5009, 5010, 4992, 4998, 4994, 5009, 4998, 5013, 5011, 4997, 5016, 4995, 5003, 4986, 5010, 4995, 4986, 5025, 4990, 5010, 4990, 4996, 5000, 5002, 4994, 5002, 5000, 5001, 4995, 5003, 5006, 5000, 4997, 4996, 5010, 4992, 5013, 4998, 4988, 4999, 5004, 5004, 5002, 5002, 5001, 4986, 5011, 5012, 4988, 5000, 5000, 5012, 5004, 5004, 4984, 5012, 4998, 5005, 5005, 5005, 4995, 5004, 5006, 5000, 5008, 5015, 4999, 4999, 4996, 5000, 4992, 5019, 5020, 4999, 4991, 5020, 5000, 5002, 5000, 5003, 4985, 4990, 5011, 5012, 4997, 4989, 4999, 5006, 4997, 4992, 4999, 4985, 4999, 5012, 5003, 4989, 5010, 5010, 5012, 4990, 4986, 5014, 5000, 4994, 5017, 4995, 5005, 5003, 5000, 5000, 4988, 5018, 5007, 5009, 5002, 5004, 4999, 5026, 4987, 4986, 5000, 4994, 5012, 5022, 4996, 5002, 4986, 4990, 4989, 4997, 4997, 5002, 5004, 4999, 5000, 4992, 4999, 4997, 4998, 5000, 5002, 5032, 4998, 5014, 4978, 5001, 4988, 5006, 5003, 5005, 5002, 5005, 5000, 5003, 4990, 4991, 4990, 5016, 5006, 4981, 4999, 4998, 4989, 4995, 5007, 5004, 5019, 5001, 5004, 5000, 4996, 4988, 5001, 5003, 5009, 4998, 5003, 4991, 5000, 4988, 5004, 5002, 4991, 4998, 4996, 4991, 5013, 5007, 5010, 5004, 5006, 5007, 4993, 5000, 5002, 4992, 4999, 4992, 5001, 4989, 4992, 5015, 5011, 5008, 5004, 4990, 4995, 4993, 5004, 5000, 4982, 5008, 5000, 4993, 5000, 5000, 4991, 5005, 5008, 5003, 4994, 4997, 5012, 4995, 5009, 5020, 5010, 5019, 4979, 5013, 4990, 5002, 5000, 5015, 4989, 5009, 4998, 5004, 5010, 4988, 4994, 5004, 4985, 4998, 4991, 4985, 4994, 4986, 5010, 4990, 5002, 5005, 5008, 5004, 4988, 4980, 5005, 4994, 5004, 4998, 4990, 5010, 5003, 5011, 4992, 5009, 5003, 5013, 4996, 4997, 4989, 4992, 5002, 4992, 4996, 4999, 5000, 5009, 4990, 4992, 5020, 4981, 5011, 5000, 5008, 4997, 4994, 4982, 5014, 5013, 4996, 5002, 5011, 5003, 5000, 5015, 4999, 5001, 5002, 5018, 4984, 5022, 5009, 5006, 5009, 5000, 4974, 4991, 5020, 5000, 4987, 5003, 4987, 5003, 5002, 5016, 4997, 5022, 5005, 4998, 4999, 5001, 5000, 4999, 5000, 5001, 4994, 4991, 4997, 4990, 4991, 4995, 5008, 5007, 4994, 5000, 5007, 4988, 5014, 5003, 4998, 4995, 5000, 5000, 5004] # nopep8 + true_yy2 = [5001, 5000, 4994, 5000, 5002, 5000, 5000, 5000, 5000, 5003, 5000, 5000, 5000, 5003, 5003, 5003, 4997, 5004, 5007, 5004, 5001, 5001, 5001, 5002, 5002, 5001, 5001, 5001, 4998, 5001, 4998, 4996, 4998, 4998, 5002, 5002, 4996, 4997, 5003, 5003, 5002, 5001, 5002, 5003, 5003, 5002, 5001, 4998, 4998, 4995, 4995, 4998, 4999, 4999, 5007, 5009, 5009, 5009, 5007, 4996, 4996, 4994, 4994, 4994, 4994, 4995, 5007, 5008, 5008, 5009, 5008, 5008, 5008, 5001, 5000, 5001, 5001, 5004, 5004, 5005, 5005, 5005, 5005, 5000, 4994, 4994, 4994, 4993, 4994, 4995, 4995, 4995, 4995, 4995, 4999, 4995, 4995, 4999, 4999, 4997, 4997, 4993, 4997, 5009, 4997, 4997, 4999, 4999, 4999, 4999, 4997, 4987, 4999, 5002, 5001, 5002, 5001, 5001, 5002, 5001, 4998, 4996, 4996, 4996, 4998, 4998, 4998, 4998, 5001, 5001, 5001, 5001, 5004, 5004, 5004, 5004, 5002, 5004, 5008, 5002, 5010, 5002, 5002, 5009, 5002, 5002, 5002, 5002, 5008, 5008, 5008, 5008, 5008, 5008, 5008, 5004, 5004, 5004, 5004, 5004, 5000, 4999, 5000, 4998, 4998, 4998, 5000, 5000, 5000, 5000, 5000, 5000, 4997, 4997, 4997, 5000, 5003, 5003, 5005, 5009, 5009, 5009, 5010, 5011, 5011, 5011, 5004, 5011, 5004, 5000, 5000, 5000, 5000, 5001, 5001, 5001, 5001, 5001, 4997, 4995, 4995, 4995, 4997, 4997, 4997, 5000, 5007, 5000, 4998, 5000, 5000, 5000, 4998, 4995, 4995, 4995, 4995, 4995, 5003, 5003, 5003, 5003, 5003, 5008, 5001, 5001, 4998, 4994, 4994, 5008, 4993, 4993, 4993, 4994, 4994, 4994, 4994, 5002, 5002, 5002, 5000, 5000, 5000, 5000, 5000, 4999, 5000, 4999, 4994, 4994, 5000, 5000, 5000, 5000, 5001, 5001, 5001, 5001, 5001, 5002, 5001, 5001, 5001, 5001, 4999, 4999, 4996, 4997, 4997, 4999, 5005, 5005, 5005, 5005, 5005, 5000, 5000, 5000, 5001, 5000, 5000, 5000, 5001, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5001, 5000, 5000, 5000, 5006, 5006, 5006, 5006, 5006, 5006, 5007, 5006, 5000, 5000, 5000, 5000, 4994, 4994, 4994, 5000, 5005, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 4995, 5000, 4998, 4998, 4998, 4996, 4998, 5000, 5000, 5000, 5002, 5002, 5002, 5007, 5007, 5010, 5007, 5007, 5010, 5010, 4997, 4997, 4996, 4996, 5004, 4995, 5004, 5004, 5004, 5004, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 4995, 4995, 4995, 4995, 4995, 5000, 5000, 5001, 5000, 5001, 5001, 5001, 5001, 5001, 4995, 5001, 4998, 4998, 4998, 4998, 4998, 4998, 4998, 4998, 5000, 5000, 5000, 4998, 5000, 5002, 5003, 5003, 5003, 5002, 5003, 5006, 5003, 5002, 4998, 4998, 4995, 4995, 4994, 4995, 4998, 4998, 4994, 5001, 5001, 5001, 4991, 4991, 5001, 5004, 5004, 5001, 5001, 5001, 5000, 5000, 4997, 4996, 4996, 5000, 4999, 4996, 4999, 4999, 5001, 5001, 4999, 5001, 5001, 5001, 5002, 5006, 5002, 5006, 5005, 5002, 5005, 5005, 5002, 5002, 5000, 5000, 5000, 4999, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5003, 5003, 5003, 5003, 5009, 5009, 5009, 5002, 5000, 4999, 4999, 4999, 4999, 4999, 4999, 5001, 5001, 5001, 5000, 5001, 5000, 5001, 5001, 5001, 4999, 5001, 4997, 5001, 5001, 4999, 5002, 5002, 5000, 5000, 4999, 4999, 5000, 4999, 4999, 4999, 5000, 5002, 5002, 5000, 5000, 4994, 4999, 4994, 4994, 4999, 4999, 4999, 5000, 5008, 5008, 5004, 5002, 5004, 5004, 5002, 5002, 5002, 5002, 5004, 5004, 5004, 5004, 5004, 5009, 5007, 5007, 5007, 5007, 5003, 5003, 5003, 5001, 5000, 4998, 4998, 4998, 4998, 4998, 4998, 4997, 4998, 5001, 5001, 5001, 5003, 5003, 5003, 5003, 5003, 5005, 5003, 5001, 5003, 5003, 5001, 5001, 5001, 5001, 5001, 5001, 5001, 5001, 5001, 5001, 5001, 5000, 5000, 5001, 5001, 5003, 5003, 5000, 5000, 5000, 5000, 4998, 4998, 4998, 4998, 5007, 5007, 5007, 5007, 4997, 5006, 5003, 5003, 5003, 5003, 5003, 5003, 4998, 4997, 4997, 4997, 4997, 4998, 5004, 5004, 5006, 5009, 5009, 5008, 5009, 5008, 5008, 5008, 5008, 5008, 5008, 5002, 5002, 5002, 4993, 4990, 4993, 4993, 4994, 4994, 4994, 4997, 4999, 5000, 4999, 5000, 5000, 5003, 5003, 5003, 4998, 4998, 4995, 4992, 4992, 4987, 4995, 4995, 4996, 4998, 5000, 5000, 5000, 5008, 5008, 5009, 5009, 5000, 4999, 4999, 4999, 4998, 4998, 4998, 4998, 5009, 5009, 5003, 5003, 5003, 4997, 4995, 4995, 4995, 4995, 4995, 4995, 4996, 5000, 4996, 5000, 5000, 5000, 5000, 5002, 5002, 5002, 5000, 5000, 5000, 5000, 5000, 4998, 4997, 4998, 4999, 4999, 5002, 5002, 5002, 5002, 5002, 5002, 5002, 5001, 5000, 5000, 5004, 5004, 5000, 5004, 5004, 5004, 5004, 5005, 5005, 5005, 5005, 5005, 5005, 5005, 5000, 5000, 5000, 5000, 4999, 4999, 4999, 4999, 4999, 5000, 5000, 5002, 5000, 5000, 5000, 5000, 5000, 5002, 5000, 4997, 4997, 4999, 4999, 4997, 4997, 4997, 4999, 4999, 4999, 4999, 4999, 5003, 5010, 5010, 5003, 5010, 5010, 5000, 5000, 4995, 5000, 5003, 5000, 5000, 5000, 5000, 5003, 5003, 5002, 5004, 5004, 5007, 5004, 5002, 5000, 4999, 4999, 5000, 4996, 5000, 5000, 4996, 4996, 4996, 4996, 4997, 4997, 4999, 5000, 5000, 4999, 4999, 4998, 4998, 4998, 4998, 4998, 5000, 5000, 5001, 5001, 5001, 5001, 5003, 5003, 5005, 5005, 5005, 5003, 5003, 5000, 5000, 5000, 4991, 4991, 4998, 4998, 4998, 4998, 4998, 5004, 5001, 5004, 5004, 5004, 5001, 5001, 5001, 5003, 5000, 5003, 5003, 5003, 5000, 5000, 5000, 5000, 4998, 4998, 4996, 4998, 4998, 4998, 5004, 5006, 5007, 5007, 5006, 5004, 5002, 5000, 4999, 4999, 4999, 4992, 4992, 4999, 5001, 5004, 5004, 5004, 5004, 5004, 5004, 4995, 4995, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5003, 5003, 5003, 5003, 5009, 5010, 5010, 5010, 5010, 5010, 5002, 5002, 5000, 5002, 5000, 5002, 5004, 5004, 4998, 5004, 4998, 4998, 4994, 4991, 4994, 4991, 4991, 4991, 4991, 4994, 5002, 5004, 5004, 5002, 5004, 5004, 5004, 4998, 4994, 4998, 5003, 5003, 5003, 5003, 5003, 5009, 5003, 5003, 4997, 4997, 4997, 4996, 4996, 4996, 4996, 4999, 4999, 4996, 4999, 4999, 5000, 5000, 5000, 5000, 5000, 4997, 5000, 5000, 4997, 4997, 5002, 5003, 5003, 5003, 5002, 5002, 5002, 5002, 5001, 5002, 5002, 5006, 5009, 5009, 5006, 5006, 5006, 5000, 5000, 5000, 4991, 5000, 5002, 5002, 5002, 5003, 5003, 5003, 5002, 5001, 5000, 5001, 5000, 5000, 5000, 5000, 5000, 4997, 4994, 4994, 4994, 4995, 4995, 4995, 5000, 5000, 5007, 5003, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000] # nopep8 - YY2 = HampelFilter(dx=3, t=0, fulloutput=False)(Y) # Y0 = - assert_array_almost_equal(np.int_(YY2), [5001, 5000, 4994, 5000, 5002, 5000, 5000, 5000, 5000, 5003, 5000, 5000, 5000, 5003, 5003, 5003, 4997, 5004, 5007, 5004, 5001, 5001, 5001, 5002, 5002, 5001, 5001, 5001, 4998, 5001, 4998, 4996, 4998, 4998, 5002, 5002, 4996, 4997, 5003, 5003, 5002, 5001, 5002, 5003, 5003, 5002, 5001, 4998, 4998, 4995, 4995, 4998, 4999, 4999, 5007, 5009, 5009, 5009, 5007, 4996, 4996, 4994, 4994, 4994, 4994, 4995, 5007, 5008, 5008, 5009, 5008, 5008, 5008, 5001, 5000, 5001, 5001, 5004, 5004, 5005, 5005, 5005, 5005, 5000, 4994, 4994, 4994, 4993, 4994, 4995, 4995, 4995, 4995, 4995, 4999, 4995, 4995, 4999, 4999, 4997, 4997, 4993, 4997, 5009, 4997, 4997, 4999, 4999, 4999, 4999, 4997, 4987, 4999, 5002, 5001, 5002, 5001, 5001, 5002, 5001, 4998, 4996, 4996, 4996, 4998, 4998, 4998, 4998, 5001, 5001, 5001, 5001, 5004, 5004, 5004, 5004, 5002, 5004, 5008, 5002, 5010, 5002, 5002, 5009, 5002, 5002, 5002, 5002, 5008, 5008, 5008, 5008, 5008, 5008, 5008, 5004, 5004, 5004, 5004, 5004, 5000, 4999, 5000, 4998, 4998, 4998, 5000, 5000, 5000, 5000, 5000, 5000, 4997, 4997, 4997, 5000, 5003, 5003, 5005, 5009, 5009, 5009, 5010, 5011, 5011, 5011, 5004, 5011, 5004, 5000, 5000, 5000, 5000, 5001, 5001, 5001, 5001, 5001, 4997, 4995, 4995, 4995, 4997, 4997, 4997, 5000, 5007, 5000, 4998, 5000, 5000, 5000, 4998, 4995, 4995, 4995, 4995, 4995, 5003, 5003, 5003, 5003, 5003, 5008, 5001, 5001, 4998, 4994, 4994, 5008, 4993, 4993, 4993, 4994, 4994, 4994, 4994, 5002, 5002, 5002, 5000, 5000, 5000, 5000, 5000, 4999, 5000, 4999, 4994, 4994, 5000, 5000, 5000, 5000, 5001, 5001, 5001, 5001, 5001, 5002, 5001, 5001, 5001, 5001, 4999, 4999, 4996, 4997, 4997, 4999, 5005, 5005, 5005, 5005, 5005, 5000, 5000, 5000, 5001, 5000, 5000, 5000, 5001, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5001, 5000, 5000, 5000, 5006, 5006, 5006, 5006, 5006, 5006, 5007, 5006, 5000, 5000, 5000, 5000, 4994, 4994, 4994, 5000, 5005, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 4995, 5000, 4998, 4998, 4998, 4996, 4998, 5000, 5000, 5000, 5002, 5002, 5002, 5007, 5007, 5010, 5007, 5007, 5010, 5010, 4997, 4997, 4996, 4996, 5004, 4995, 5004, 5004, 5004, 5004, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 4995, 4995, 4995, 4995, 4995, 5000, 5000, 5001, 5000, 5001, 5001, 5001, 5001, 5001, 4995, 5001, 4998, 4998, 4998, 4998, 4998, 4998, 4998, 4998, 5000, 5000, 5000, 4998, 5000, 5002, 5003, 5003, 5003, 5002, 5003, 5006, 5003, 5002, 4998, 4998, 4995, 4995, 4994, 4995, 4998, 4998, 4994, 5001, 5001, 5001, 4991, 4991, 5001, 5004, 5004, 5001, 5001, 5001, 5000, 5000, 4997, 4996, 4996, 5000, 4999, 4996, 4999, 4999, 5001, 5001, 4999, 5001, 5001, 5001, 5002, 5006, 5002, 5006, 5005, 5002, 5005, 5005, 5002, 5002, 5000, 5000, 5000, 4999, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5003, 5003, 5003, 5003, 5009, 5009, 5009, 5002, 5000, 4999, 4999, 4999, 4999, 4999, 4999, 5001, 5001, 5001, 5000, 5001, 5000, 5001, 5001, 5001, 4999, 5001, 4997, 5001, 5001, 4999, 5002, 5002, 5000, 5000, 4999, 4999, 5000, 4999, 4999, 4999, 5000, 5002, 5002, 5000, 5000, 4994, 4999, 4994, 4994, 4999, 4999, 4999, 5000, 5008, 5008, 5004, 5002, 5004, 5004, 5002, 5002, 5002, 5002, 5004, 5004, 5004, 5004, 5004, 5009, 5007, 5007, 5007, 5007, 5003, 5003, 5003, 5001, 5000, 4998, 4998, 4998, 4998, 4998, 4998, 4997, 4998, 5001, 5001, 5001, 5003, 5003, 5003, 5003, 5003, 5005, 5003, 5001, 5003, 5003, 5001, 5001, 5001, 5001, 5001, 5001, 5001, 5001, 5001, 5001, 5001, 5000, 5000, 5001, 5001, 5003, 5003, 5000, 5000, 5000, 5000, 4998, 4998, 4998, 4998, 5007, 5007, 5007, 5007, 4997, 5006, 5003, 5003, 5003, 5003, 5003, 5003, 4998, 4997, 4997, 4997, 4997, 4998, 5004, 5004, 5006, 5009, 5009, 5008, 5009, 5008, 5008, 5008, 5008, 5008, 5008, 5002, 5002, 5002, 4993, 4990, 4993, 4993, 4994, 4994, 4994, 4997, 4999, 5000, 4999, 5000, 5000, 5003, 5003, 5003, 4998, 4998, 4995, 4992, 4992, 4987, 4995, 4995, 4996, 4998, 5000, 5000, 5000, 5008, 5008, 5009, 5009, 5000, 4999, 4999, 4999, 4998, 4998, 4998, 4998, 5009, 5009, 5003, 5003, 5003, 4997, 4995, 4995, 4995, 4995, 4995, 4995, 4996, 5000, 4996, 5000, 5000, 5000, 5000, 5002, 5002, 5002, 5000, 5000, 5000, 5000, 5000, 4998, 4997, 4998, 4999, 4999, 5002, 5002, 5002, 5002, 5002, 5002, 5002, 5001, 5000, 5000, 5004, 5004, 5000, 5004, 5004, 5004, 5004, 5005, 5005, 5005, 5005, 5005, 5005, 5005, 5000, 5000, 5000, 5000, 4999, 4999, 4999, 4999, 4999, 5000, 5000, 5002, 5000, 5000, 5000, 5000, 5000, 5002, 5000, 4997, 4997, 4999, 4999, 4997, 4997, 4997, 4999, 4999, 4999, 4999, 4999, 5003, 5010, 5010, 5003, 5010, 5010, 5000, 5000, 4995, 5000, 5003, 5000, 5000, 5000, 5000, 5003, 5003, 5002, 5004, 5004, 5007, 5004, 5002, 5000, 4999, 4999, 5000, 4996, 5000, 5000, 4996, 4996, 4996, 4996, 4997, 4997, 4999, 5000, 5000, 4999, 4999, 4998, 4998, 4998, 4998, 4998, 5000, 5000, 5001, 5001, 5001, 5001, 5003, 5003, 5005, 5005, 5005, 5003, 5003, 5000, 5000, 5000, 4991, 4991, 4998, 4998, 4998, 4998, 4998, 5004, 5001, 5004, 5004, 5004, 5001, 5001, 5001, 5003, 5000, 5003, 5003, 5003, 5000, 5000, 5000, 5000, 4998, 4998, 4996, 4998, 4998, 4998, 5004, 5006, 5007, 5007, 5006, 5004, 5002, 5000, 4999, 4999, 4999, 4992, 4992, 4999, 5001, 5004, 5004, 5004, 5004, 5004, 5004, 4995, 4995, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5003, 5003, 5003, 5003, 5009, 5010, 5010, 5010, 5010, 5010, 5002, 5002, 5000, 5002, 5000, 5002, 5004, 5004, 4998, 5004, 4998, 4998, 4994, 4991, 4994, 4991, 4991, 4991, 4991, 4994, 5002, 5004, 5004, 5002, 5004, 5004, 5004, 4998, 4994, 4998, 5003, 5003, 5003, 5003, 5003, 5009, 5003, 5003, 4997, 4997, 4997, 4996, 4996, 4996, 4996, 4999, 4999, 4996, 4999, 4999, 5000, 5000, 5000, 5000, 5000, 4997, 5000, 5000, 4997, 4997, 5002, 5003, 5003, 5003, 5002, 5002, 5002, 5002, 5001, 5002, 5002, 5006, 5009, 5009, 5006, 5006, 5006, 5000, 5000, 5000, 4991, 5000, 5002, 5002, 5002, 5003, 5003, 5003, 5002, 5001, 5000, 5001, 5000, 5000, 5000, 5000, 5000, 4997, 4994, 4994, 4994, 4995, 4995, 4995, 5000, 5000, 5007, 5003, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000]) # nopep8 - # print(', '.join(['{0:d}'.format(int(y)) for y in YY2])) + assert_array_almost_equal(np.int_(yy), true_yy) + assert_array_almost_equal(np.int_(yy1), true_yy1) + assert_array_almost_equal(np.int_(yy2), true_yy2) if __name__ == "__main__":