MeteoIODoc  MeteoIODoc-2.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mio::Solar Class Reference

Detailed Description

Interpolate solar radiation. The available solar radiation data is compared to the potential radiation, leading to atmospheric loss factors. At the point that has to be interpolated, the loss factor is linearly interpolated and applied to the potential radiation. When extrapolating the data as well as at the start/end of the day (ie when only one measured value is available), the available value is kept and applied (thus this behaves as a nearest neighbour on the atmospheric loss factor).

When using this algorithm for RSWR, an albedo is required. A default value of 0.5 is used. If the snow height is available and greater than a 10cm threshold, a snow albedo is used. Below this threshold, a soil albedo is used.

ISWR::resample = solar

#include <SolarResampling.h>

Public Member Functions

 Solar (const std::string &i_algoname, const std::string &i_parname, const double &dflt_window_size, const std::vector< std::string > &vecArgs)
 
void resample (const size_t &index, const ResamplingPosition &position, const size_t &paramindex, const std::vector< MeteoData > &vecM, MeteoData &md)
 
std::string toString () const
 
- Public Member Functions inherited from mio::ResamplingAlgorithms
 ResamplingAlgorithms (const std::string &i_algoname, const std::string &i_parname, const double &dflt_window_size, const std::vector< std::string > &)
 
virtual ~ResamplingAlgorithms ()
 
const std::string getAlgo () const
 

Additional Inherited Members

- Public Types inherited from mio::ResamplingAlgorithms
enum  ResamplingPosition {
  exact_match, before, after, begin,
  end
}
 
- Static Protected Member Functions inherited from mio::ResamplingAlgorithms
static double partialAccumulateAtLeft (const std::vector< MeteoData > &vecM, const size_t &paramindex, const size_t &pos, const Date &curr_date)
 
static double partialAccumulateAtRight (const std::vector< MeteoData > &vecM, const size_t &paramindex, const size_t &pos, const Date &curr_date)
 
static void getNearestValidPts (const size_t &pos, const size_t &paramindex, const std::vector< MeteoData > &vecM, const Date &resampling_date, const double &window_size, size_t &indexP1, size_t &indexP2)
 This function returns the last and next valid points around a given position. More...
 
static double linearInterpolation (const double &x1, const double &y1, const double &x2, const double &y2, const double &x3)
 This function solves the equation y = ax + b for two given points and returns y for a given x. More...
 
static Date getDailyStart (const Date &resampling_date)
 For a given date, find the start of the day, considering that for midnight we return the day before! (as is necessary for daily averages, sums, etc that can be provided at midnight for the day before) More...
 
static size_t getDailyValue (const std::vector< MeteoData > &vecM, const size_t &paramindex, size_t pos, const Date &intervalStart, const Date &intervalEnd)
 Find a unique value in a given time interval. This is useful for retrieving a unique daily average, daily sum, etc. More...
 
- Protected Attributes inherited from mio::ResamplingAlgorithms
const std::string algo
 
const std::string parname
 
double window_size
 
- Static Protected Attributes inherited from mio::ResamplingAlgorithms
static const double soil_albedo = .23
 grass albedo More...
 
static const double snow_albedo = .85
 snow albedo More...
 
static const double snow_thresh = .1
 These thresholds are used to handle solar radiation. More...
 

Constructor & Destructor Documentation

mio::Solar::Solar ( const std::string &  i_algoname,
const std::string &  i_parname,
const double &  dflt_window_size,
const std::vector< std::string > &  vecArgs 
)

Member Function Documentation

void mio::Solar::resample ( const size_t &  index,
const ResamplingPosition position,
const size_t &  paramindex,
const std::vector< MeteoData > &  vecM,
MeteoData md 
)
virtual
std::string mio::Solar::toString ( ) const
virtual

The documentation for this class was generated from the following files: