20#ifndef SNOWLINE_ALGORITHM_H
21#define SNOWLINE_ALGORITHM_H
25#include <meteoio/thirdParty/tinyexpr.h>
108 SnowlineAlgorithm(
const std::vector< std::pair<std::string, std::string> >& vecArgs,
121 bool operator< (
const aspect &other)
const {
return this->deg_beg < other.deg_beg; }
122 bool operator<= (
const aspect &other)
const {
return this->deg_beg <= other.deg_beg; }
130 void initExpressionVars(
const std::vector< std::pair<std::string, double> >& substitutions, te_variable* vars)
const;
131 te_expr* compileExpression(
const std::string& expression,
const te_variable* te_vars,
const size_t& sz)
const;
132 std::vector<aspect> readSnowlineFile();
135 double calculateRate(
const double& snowline);
136 std::vector< std::pair<std::string, std::string> > prepareBaseArgs(
const double& snowline,
const std::string& base_alg_fallback);
137 void msg(
const std::string& message);
139 template <
class T>
static bool isSorted(std::vector<T> vec,
const bool& strict =
false)
143 for (
typename std::vector<T>::iterator it = vec.begin() + 1; it != vec.end(); ++it) {
145 if (*it <= *(it - 1))
157 std::string base_alg_;
158 std::vector< std::pair<std::string, std::string> > input_args_;
162 std::vector<aspect> snowlines_;
163 std::string snowlines_file_;
164 bool enforce_positive_rate_;
165 bool calc_base_rate_;
166 double fallback_rate_;
169 unsigned int band_no_;
170 std::string formula_;
171 bool has_warned_deduced_trend_;
172 bool has_warned_fixed_trend_;
A class to represent DEMs and automatically compute some properties. This class stores elevation grid...
Definition: DEMObject.h:40
A class to handle timestamps. This class handles conversion between different time display formats (I...
Definition: Date.h:87
A class to represent 2D Grids. Typical application as DEM or Landuse Model.
Definition: Grid2DObject.h:42
Definition: GridsManager.h:33
A class to perform 2D spatial interpolations. For more, see Spatial interpolations.
Definition: InterpolationAlgorithms.h:70
A class to spatially interpolate meteo parameters. For more, see Spatial interpolations.
Definition: Meteo2DInterpolator.h:97
Assimilation of snowline elevation information into snow maps.
Definition: SnowlineAlgorithm.h:106
SnowlineAlgorithm(const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &i_algo, const std::string &i_param, TimeSeriesManager &i_tsm, GridsManager &i_gdm, Meteo2DInterpolator &i_mi)
Definition: SnowlineAlgorithm.cc:30
virtual void calculate(const DEMObject &dem, Grid2DObject &grid)
Definition: SnowlineAlgorithm.cc:100
virtual double getQualityRating(const Date &i_date)
Definition: SnowlineAlgorithm.cc:88
Definition: TimeSeriesManager.h:31
const double nodata
This is the internal nodata value.
Definition: IOUtils.h:75