Atmospheric transmissivity generator.
Generate the atmospheric transmissivity (or clearness index, see meteoparam) from other parameters. If a parameter named "CLD" is available, it will be interpreted as cloud cover / cloudiness: in okta between 0 (fully clear) and 8 (fully cloudy). For synop reports, it is possible to include a value of exactly 9 (sky obstructed from view by fog, heavy precipitation...) that will be transparently reset to 8 (fully cloudy).
If no such parameter is available, the atmospheric transmissivity is calculated from the solar index (ratio of measured iswr to potential iswr, therefore using the current location (lat, lon, altitude) and ISWR to parametrize the cloud cover). This relies on (Kasten and Czeplak, 1980).
It takes the following (optional) argument:
Please not that it is possible to combine SHADE_FROM_DEM and INFILE: in this case, stations that don't have any horizon in the provided INFILE will be computed from DEM. It is also possible to define wildcard station ID in the horizon file. If SHADE_FROM_DEM has been set to false and no INFILE has been provided, a fixed 5 degrees threshold is used.
The horizon file contains on each line a station ID followed by an azimuth (in degrees, starting from North) and an elevation above the horizontal (also in degrees). It is possible to define a wildcard station ID '*' to be used as fallback. The elevation for any given azimuth will be linearly interpolated between the provided horizons before and after. If only one azimuth is given for a station ID, its horizon elevation is assumed to be constant. See below an example horizon file, defining two station IDs (SLF2 and FLU2):
#include <TauCLDGenerator.h>
Public Types | |
enum | clf_parametrization { DEFAULT , CLF_LHOMME , KASTEN , CLF_CRAWFORD } |
Public Member Functions | |
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) | |
~TauCLDGenerator () | |
bool | generate (const size_t ¶m, MeteoData &md) |
bool | create (const size_t ¶m, const size_t &ii_min, const size_t &ii_max, std::vector< MeteoData > &vecMeteo) |
Fill one time series of MeteoData for one station. More... | |
Public Member Functions inherited from mio::GeneratorAlgorithm | |
virtual | ~GeneratorAlgorithm () |
bool | skipStation (const std::string &station_id) const |
Should this station be skipped, based on user-provided station ID restrictions? More... | |
bool | skipTimeStep (const Date &dt) const |
Should this timestep be skipped, based on user-provided time restrictions? More... | |
std::vector< DateRange > | getTimeRestrictions () const |
std::string | getAlgo () const |
Protected Member Functions | |
double | getCloudiness (const MeteoData &md, SunObject &sun, bool &is_night) |
Compute the atmospheric cloudiness from the available measurements. More... | |
double | getClearness (const double &cloudiness) const |
Compute the clearness index from an atmospheric cloudiness value. More... | |
double | getHorizon (const MeteoData &md, const double &sun_azi) |
Protected Member Functions inherited from mio::GeneratorAlgorithm | |
GeneratorAlgorithm (const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &i_algo, const std::string &i_section, const double &TZ) | |
protected constructor only to be called by children More... | |
virtual void | parse_args (const std::vector< std::pair< std::string, std::string > > &) |
Static Protected Member Functions | |
static std::vector< std::pair< double, double > > | computeMask (const DEMObject &i_dem, const StationData &sd) |
Static Protected Member Functions inherited from mio::GeneratorAlgorithm | |
static std::set< std::string > | initStationSet (const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &keyword) |
Protected Attributes | |
std::map< std::string, std::pair< double, double > > | last_cloudiness |
std::map< std::string, std::vector< std::pair< double, double > > > | masks |
std::string | horizons_outfile |
const Config & | cfg |
DEMObject | dem |
clf_parametrization | cloudiness_model |
bool | use_rswr |
bool | use_rad_threshold |
bool | write_mask_out |
bool | use_horizons |
bool | from_dem |
Protected Attributes inherited from mio::GeneratorAlgorithm | |
const std::vector< DateRange > | time_restrictions |
const std::set< std::string > | excluded_stations |
const std::set< std::string > | kept_stations |
const std::string | algo |
const std::string | section |
Additional Inherited Members | |
Static Protected Attributes inherited from mio::GeneratorAlgorithm | |
static const double | soil_albedo = .23 |
static const double | snow_albedo = .85 |
static const double | snow_thresh = .1 |
mio::TauCLDGenerator::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 | ||
) |
mio::TauCLDGenerator::~TauCLDGenerator | ( | ) |
|
staticprotected |
|
virtual |
Fill one time series of MeteoData for one station.
This is used by the dataCreators to create a new parameter in one go for the whole timeseries.
[in] | param | meteo parameter to generate |
[in] | ii_min | minimum index to apply it to in vecMeteo |
[in] | ii_max | maximum index to apply it to in vecMeteo |
[in] | vecMeteo | meteo timeseries to process |
Implements mio::GeneratorAlgorithm.
|
virtual |
Implements mio::GeneratorAlgorithm.
|
protected |
Compute the clearness index from an atmospheric cloudiness value.
This is a convenience method that helps process the same way various types of inputs: if a cloudiness is provided (which is quite rare), it can be converted to a clearness index (ie the ratio of the incoming short wave radiation over the ground potential radiation, projected on the horizontal) and then processed the same way as more traditional measurements (ie only ISWR provided) where it will be re-converted to a cloudiness (thus falling abck to the same cloudiness as originally provided).
[in] | cloudiness | cloudiness (between 0 and 1) |
|
protected |
Compute the atmospheric cloudiness from the available measurements.
The clearness index (ie the ratio of the incoming short wave radiation over the ground potential radiation, projected on the horizontal) is computed and used to evaluate the cloudiness, based on the chosen parametrization.
[in] | md | MeteoData be a soil ro a snow albedo |
sun | For better efficiency, the SunObject for this location (so it can be cached) | |
[out] | is_night | set to TRUE if it is night time |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |