MeteoIODoc 2.11.0
RegressionFill.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2/***********************************************************************************/
3/* Copyright 2013 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 RESAMPLINGREGRESSIONFILL_H
20#define RESAMPLINGREGRESSIONFILL_H
21
23#include <unordered_map>
24
25namespace mio {
26
60 public:
64 CUBIC
65 };
66
67 RegressionFill(const std::string& i_algoname, const std::string& i_parname, const double& dflt_window_size, const std::vector< std::pair<std::string, std::string> >& vecArgs);
68
69 void resample(const std::string& stationHash, const size_t& index, const ResamplingPosition& position, const size_t& paramindex,
70 const std::vector<MeteoData>& vecM, MeteoData& md);
71 void resample(const std::string& stationHash, const size_t& index, const ResamplingPosition& position, const size_t& paramindex,
72 const std::vector<MeteoData>& vecM, MeteoData& md, const std::vector<METEO_SET>& additional_stations);
73 std::string toString() const;
74
75 bool findValueAt(const std::vector<MeteoData>& support_station, const Date& date, const size_t& paramindex, double& value);
76 void getRegressionData(const size_t index, const size_t paramindex, const std::vector<MeteoData>& vecM, const std::vector<METEO_SET>& additional_stations, std::vector<double>& x, std::vector<double>& y, std::vector<Date>& dates);
77
78 double linear(double julian_date, const std::vector<double>& coefficients);
79
80 private:
81 std::unordered_map<size_t, std::vector<double>> regression_coefficients;
82 bool verbose;
83 RegressionType reg_type;
84
85 // flag
86 bool printed_info = false;
87};
88
89} //end namespace mio
90
91#endif
A class to handle timestamps. This class handles conversion between different time display formats (I...
Definition: Date.h:87
A class to represent a singular measurement received from one station at a certain time (represented ...
Definition: MeteoData.h:107
Fill missing values from a station, using another station as reference.
Definition: RegressionFill.h:59
void getRegressionData(const size_t index, const size_t paramindex, const std::vector< MeteoData > &vecM, const std::vector< METEO_SET > &additional_stations, std::vector< double > &x, std::vector< double > &y, std::vector< Date > &dates)
Definition: RegressionFill.cc:75
double linear(double julian_date, const std::vector< double > &coefficients)
Definition: RegressionFill.cc:91
RegressionFill(const std::string &i_algoname, const std::string &i_parname, const double &dflt_window_size, const std::vector< std::pair< std::string, std::string > > &vecArgs)
Definition: RegressionFill.cc:27
std::string toString() const
Definition: RegressionFill.cc:50
void resample(const std::string &stationHash, const size_t &index, const ResamplingPosition &position, const size_t &paramindex, const std::vector< MeteoData > &vecM, MeteoData &md)
Definition: RegressionFill.cc:98
RegressionType
Definition: RegressionFill.h:61
@ CUBIC
Definition: RegressionFill.h:64
@ QUADRATIC
Definition: RegressionFill.h:63
@ LINEAR
Definition: RegressionFill.h:62
bool findValueAt(const std::vector< MeteoData > &support_station, const Date &date, const size_t &paramindex, double &value)
Definition: RegressionFill.cc:62
Interface class for the temporal resampling algorithms.
Definition: ResamplingAlgorithms.h:43
ResamplingPosition
Definition: ResamplingAlgorithms.h:46
Definition: Config.cc:31