WSL/SLF GitLab Repository

Meteo1DInterpolator.h 2.98 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/***********************************************************************************/
/*  Copyright 2009 WSL Institute for Snow and Avalanche Research    SLF-DAVOS      */
/***********************************************************************************/
/* This file is part of MeteoIO.
    MeteoIO is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    MeteoIO is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with MeteoIO.  If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __METEO1DINTERPOLATOR_H__
#define __METEO1DINTERPOLATOR_H__

#include <meteoio/MeteoData.h>
#include <meteoio/StationData.h>
23
#include <meteoio/Config.h>
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <meteoio/ResamplingAlgorithms.h>

#include <iostream>
#include <string>
#include <vector>

namespace mio {

/**
 * @class Meteo1DInterpolator
 * @brief A class that can resample MeteoData objects
 * @author Thomas Egger
 * @date   2010-06-24
 */

class Meteo1DInterpolator {
	public:

		/**
		* @brief 	The default constructor
		* Set up the interpolation algorithm for each parameter
		* Init tasklist: a vector that holds one std::string for each parameter,
		*                representing the interpolation algorithm that will be executed
		*                for the respective parameter
		*                e.g. tasklist for TA: linear
		* taskargs:      a vector that holds the respective arguments for the algorithms
		*                as a std::vector<std::string>, so there can be multiple arguments
		*
52
		* @param[in] _cfg Config object that holds the MeteoFilter configuration in the [Filters] section
53
		*/
54
		Meteo1DInterpolator(const Config& _cfg);
55
56
57
58
59
60
61
62

		/**
		 * @brief A function that executes all the resampling algorithms that have been setup in the constructor
		 * @param[in] date The requested date for a MeteoData object (to be resampled if not present)
		 * @param[in] vecM A vector of MeteoData where the new object will be inserted if not present
		 * @param[in] vecS A vector of StationData where the new object will be inserted if not present
		 * @return    The position of the newly constructed MeteoData/StationData pair within vecM & vecS
		 */
63
		unsigned int resampleData(const Date& date, std::vector<MeteoData>& vecM, std::vector<StationData>& vecS);
64

65
66
		friend std::ostream& operator<<(std::ostream& os, const Meteo1DInterpolator& Interpolator);

67
68
69
 	private:
		std::string getInterpolationForParameter(const std::string& parname, std::vector<std::string>& vecArguments);

70
		Config cfg;
71
72
73
74
75
76
		std::vector<std::string> tasklist;
		std::vector< std::vector< std::string > > taskargs;
};
} //end namespace

#endif