MeteoIODoc 2.11.0
FilterMAD.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2/***********************************************************************************/
3/* Copyright 2009 WSL Institute for Snow and Avalanche Research SLF-DAVOS */
4/***********************************************************************************/
5/* This file is part of MeteoIO.
6 MeteoIO is free software: you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 MeteoIO is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public License
17 along with MeteoIO. If not, see <http://www.gnu.org/licenses/>.
18*/
19#ifndef FILTERMAD_H
20#define FILTERMAD_H
21
23#include <vector>
24#include <string>
25
26namespace mio {
27
56class FilterMAD : public WindowedFilter {
57 public:
58 FilterMAD(const std::vector< std::pair<std::string, std::string> >& vecArgs, const std::string& name, const Config& cfg);
59
60 virtual void process(const unsigned int& param, const std::vector<MeteoData>& ivec,
61 std::vector<MeteoData>& ovec);
62
63 private:
64 void MAD_filter_point(const std::vector<MeteoData>& ivec, const unsigned int& param, const size_t& start, const size_t& end, double &value) const;
65
66 double min_sigma; //< to avoid rejecting all points after a period of constant signal
67 bool is_strict;
68};
69
70} //end namespace
71
72#endif
A class that reads a key/value file. These files (typically named *.ini) follow the INI file format s...
Definition: Config.h:79
Median Absolute Deviation.
Definition: FilterMAD.h:56
FilterMAD(const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &name, const Config &cfg)
Definition: FilterMAD.cc:28
virtual void process(const unsigned int &param, const std::vector< MeteoData > &ivec, std::vector< MeteoData > &ovec)
Definition: FilterMAD.cc:48
Definition: WindowedFilter.h:35
Definition: Config.cc:31