MeteoIODoc 2.11.0
TauCLDGenerator.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 TAUCLDGENERATOR_H
20#define TAUCLDGENERATOR_H
21
25
26#include <map>
27
28namespace mio {
29
87 public:
88 typedef enum CLF_PARAMETRIZATION {
89 DEFAULT, //will be mapped to KASTEN
94
95 TauCLDGenerator(const std::vector< std::pair<std::string, std::string> >& vecArgs, const std::string& i_algo, const std::string& i_section, const double& TZ, const Config &i_cfg);
97
98 bool generate(const size_t& param, MeteoData& md, const std::vector<MeteoData>& vecMeteo);
99 bool create(const size_t& param, const size_t& ii_min, const size_t& ii_max, std::vector<MeteoData>& vecMeteo);
100 protected:
101
102 typedef struct CLOUDCACHE {
103 CLOUDCACHE() : last_valid(std::make_pair(IOUtils::nodata, IOUtils::nodata)) {}
104 CLOUDCACHE(const double& julian_gmt, const double& cloudiness) : last_valid(std::make_pair(IOUtils::nodata, IOUtils::nodata)) { addCloudiness(julian_gmt, cloudiness); }
105
106 void addCloudiness(const double& julian_gmt, const double& cloudiness);
107
108 std::pair<double, double> last_valid;
109 } cloudCache;
110
111 double interpolateCloudiness(const std::string& station_hash, const double& julian_gmt) const;
112 double getCloudiness(const MeteoData& md);
113 double computeCloudiness(const MeteoData& md, bool &is_night);
114 double getClearness(const double& cloudiness) const;
115 static std::vector< std::pair<double,double> > computeMask(const DEMObject& i_dem, const StationData& sd);
116 double getHorizon(const MeteoData& md, const double& sun_azi);
117
118 std::map< std::string, cloudCache > last_cloudiness; //as < station_hash, <julian_gmt, cloudiness> >
119 std::map< std::string , std::vector< std::pair<double,double> > > masks;
120 std::string horizons_outfile;
121 const Config &cfg;
127};
128
129} //end namespace mio
130
131#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 represent DEMs and automatically compute some properties. This class stores elevation grid...
Definition: DEMObject.h:40
Interface class for the generator models.
Definition: GeneratorAlgorithms.h:111
A class to represent a singular measurement received from one station at a certain time (represented ...
Definition: MeteoData.h:107
A class to calculate Solar radiation characteristics This is largely based on M. Iqbal,...
Definition: Sun.h:37
Atmospheric transmissivity generator.
Definition: TauCLDGenerator.h:86
bool use_rswr
Definition: TauCLDGenerator.h:125
clf_parametrization cloudiness_model
Definition: TauCLDGenerator.h:124
double getHorizon(const MeteoData &md, const double &sun_azi)
Definition: TauCLDGenerator.cc:116
std::string horizons_outfile
Definition: TauCLDGenerator.h:120
std::map< std::string, cloudCache > last_cloudiness
Definition: TauCLDGenerator.h:118
DEMObject dem
Definition: TauCLDGenerator.h:122
bool use_rad_threshold
Definition: TauCLDGenerator.h:125
clf_parametrization
Definition: TauCLDGenerator.h:88
@ CLF_CRAWFORD
Definition: TauCLDGenerator.h:92
@ KASTEN
Definition: TauCLDGenerator.h:91
@ DEFAULT
Definition: TauCLDGenerator.h:89
@ CLF_LHOMME
Definition: TauCLDGenerator.h:90
bool use_horizons
Definition: TauCLDGenerator.h:126
bool generate(const size_t &param, MeteoData &md, const std::vector< MeteoData > &vecMeteo)
Definition: TauCLDGenerator.cc:284
bool write_mask_out
Definition: TauCLDGenerator.h:126
static std::vector< std::pair< double, double > > computeMask(const DEMObject &i_dem, const StationData &sd)
Definition: TauCLDGenerator.cc:104
double computeCloudiness(const MeteoData &md, bool &is_night)
Compute the atmospheric cloudiness from the available measurements.
Definition: TauCLDGenerator.cc:221
double getCloudiness(const MeteoData &md)
Return the atmospheric cloudiness.
Definition: TauCLDGenerator.cc:171
double interpolateCloudiness(const std::string &station_hash, const double &julian_gmt) const
Definition: TauCLDGenerator.cc:141
bool create(const size_t &param, const size_t &ii_min, const size_t &ii_max, std::vector< MeteoData > &vecMeteo)
Fill one time series of MeteoData for one station.
Definition: TauCLDGenerator.cc:295
SunObject sun
Definition: TauCLDGenerator.h:123
TauCLDGenerator(const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &i_algo, const std::string &i_section, const double &TZ, const Config &i_cfg)
Definition: TauCLDGenerator.cc:29
double getClearness(const double &cloudiness) const
Compute the clearness index from an atmospheric cloudiness value.
Definition: TauCLDGenerator.cc:92
~TauCLDGenerator()
Definition: TauCLDGenerator.cc:74
const Config & cfg
Definition: TauCLDGenerator.h:121
std::map< std::string, std::vector< std::pair< double, double > > > masks
Definition: TauCLDGenerator.h:119
bool from_dem
Definition: TauCLDGenerator.h:126
const double nodata
This is the internal nodata value.
Definition: IOUtils.h:75
Definition: Config.cc:31
Definition: TauCLDGenerator.h:102
CLOUDCACHE(const double &julian_gmt, const double &cloudiness)
Definition: TauCLDGenerator.h:104
std::pair< double, double > last_valid
Definition: TauCLDGenerator.h:108
CLOUDCACHE()
Definition: TauCLDGenerator.h:103
void addCloudiness(const double &julian_gmt, const double &cloudiness)