MeteoIODoc 2.11.0
ProcPSUMDistribute.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2/***********************************************************************************/
3/* Copyright 2014 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 PROCPSUMDISTIBUTE_H
20#define PROCPSUMDISTIBUTE_H
21
23#include <vector>
24#include <string>
25
26namespace mio {
27
50 public:
51 ProcPSUMDistribute(const std::vector< std::pair<std::string, std::string> >& vecArgs, const std::string& name, const Config& cfg);
52
53 virtual void process(const unsigned int& param, const std::vector<MeteoData>& ivec,
54 std::vector<MeteoData>& ovec);
55
56 static void SmartDistributePSUM(const double& precip, const size_t& start_idx, const size_t& end_idx, const size_t& paramindex, std::vector<MeteoData>& vecM);
57 static void CstDistributePSUM(const double& precip, const size_t& start_idx, const size_t& end_idx, const size_t& paramindex, std::vector<MeteoData>& vecM);
58 private:
59 void parse_args(const std::vector< std::pair<std::string, std::string> >& vecArgs);
60 static size_t findNextAccumulation(const unsigned int& param, const std::vector<MeteoData>& ivec, const Date& endDate, size_t ii);
61 static void fillInterval(const unsigned int& param, std::vector<MeteoData>& ivec, const size_t& start, const size_t& end, const double value);
62
63 static const double thresh_rh, thresh_Dt;
64 double measured_period;
65 bool is_soft;
66};
67
68} //end namespace
69
70#endif
A class that reads a key/value file. These files (typically named *.ini) follow the INI file format s...
Definition: Config.h:79
A class to handle timestamps. This class handles conversion between different time display formats (I...
Definition: Date.h:87
Distributes precipitation on the preceeding timesteps in a physically plausible way.
Definition: ProcPSUMDistribute.h:49
ProcPSUMDistribute(const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &name, const Config &cfg)
Definition: ProcPSUMDistribute.cc:29
virtual void process(const unsigned int &param, const std::vector< MeteoData > &ivec, std::vector< MeteoData > &ovec)
Distributes a precipitation sum over the most probable preceeding time steps. This works by looking a...
Definition: ProcPSUMDistribute.cc:51
static void CstDistributePSUM(const double &precip, const size_t &start_idx, const size_t &end_idx, const size_t &paramindex, std::vector< MeteoData > &vecM)
Definition: ProcPSUMDistribute.cc:157
static void SmartDistributePSUM(const double &precip, const size_t &start_idx, const size_t &end_idx, const size_t &paramindex, std::vector< MeteoData > &vecM)
Definition: ProcPSUMDistribute.cc:179
The base class for all filters that provides the interface and a few helper methods.
Definition: ProcessingBlock.h:67
Definition: Config.cc:31