MeteoIODoc 2.11.0
mio::TauCLDGenerator Class Reference

Detailed Description

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:

  • CLD_TYPE: cloudiness model, either LHOMME, KASTEN or CRAWFORD (default: KASTEN, see AllSkyLWGenerator for the references of the papers. Please also note that CRAWFORD and LHOMME are exactly identical as the both simply consider that the cloudiness is 1-clearness_index);
  • SHADE_FROM_DEM: if set to true, the DEM defined in the [Input] section will be used to compute the shading;
  • INFILE: a file containing the horizon for some or all stations (see the ProcShade filter for the format);
  • OUTFILE: a file to write the computed horizons to. If some horizons have been read from INFILE, they will also be written out in OUTFILE;
  • USE_RSWR. If set to TRUE, when no ISWR is available but RSWR and HS are available, a ground albedo is estimated (either soil or snow albedo) and ISWR is then computed from RSWR. Unfortunately, this is not very precise... (thus default is false)
  • USE_RAD_THRESHOLD: when relying on measured ISWR to parametrize the cloudiness, there is a risk that the measuring station would stand in a place where it is shaded by the surrounding terrain at some point during the day. This would lead to an overestimation of the cloudiness that is undesirable. In this case, it is possible to set USE_RAD_THRESHOLD to TRUE in order to interpolate the cloudiness over all periods of low radiation measured ISWR. This is less performant that only considering the solar elevation (with shading computed from DEM) but improves things in this specific scenario, when no shading is available.
Note
Please note 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.
[Generators]
TAU_CLD::generator1 = TAU_CLD
TAU_CLD::arg1::use_rswr = false

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):

SLF2 0 5
SLF2 45 25
SLF2 180 30
SLF2 245 10
FLU2 0 7
Note
In order to pre-compute the horizons for multiple stations, write an ini file reading all stations of interest, declare a dataGenerator that relies on TauCLDGenerator and run meteoio_timeseries on it for at least one time step. This will be enough to create the horizon file for all stations...

#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 &param, MeteoData &md, const std::vector< MeteoData > &vecMeteo)
 
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. More...
 
- Public Member Functions inherited from mio::GeneratorAlgorithm
virtual ~GeneratorAlgorithm ()
 
virtual bool generate (const size_t &param, MeteoData &md, const std::vector< MeteoData > &vecMeteo)=0
 
virtual bool create (const size_t &param, const size_t &ii_min, const size_t &ii_max, std::vector< MeteoData > &vecMeteo)=0
 Fill one time series of MeteoData for one station. More...
 
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< DateRangegetTimeRestrictions () const
 
std::string getAlgo () const
 

Protected Member Functions

double interpolateCloudiness (const std::string &station_hash, const double &julian_gmt) const
 
double getCloudiness (const MeteoData &md)
 Return the atmospheric cloudiness. More...
 
double computeCloudiness (const MeteoData &md, 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, cloudCachelast_cloudiness
 
std::map< std::string, std::vector< std::pair< double, double > > > masks
 
std::string horizons_outfile
 
const Configcfg
 
DEMObject dem
 
SunObject sun
 
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< DateRangetime_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
 

Member Enumeration Documentation

◆ clf_parametrization

Enumerator
DEFAULT 
CLF_LHOMME 
KASTEN 
CLF_CRAWFORD 

Constructor & Destructor Documentation

◆ TauCLDGenerator()

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 
)

◆ ~TauCLDGenerator()

mio::TauCLDGenerator::~TauCLDGenerator ( )

Member Function Documentation

◆ computeCloudiness()

double mio::TauCLDGenerator::computeCloudiness ( const MeteoData md,
bool &  is_night 
)
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.

Parameters
[in]mdMeteoData be a soil ro a snow albedo
[out]is_nightset to TRUE if it is night time
Returns
cloudiness (between 0 and 1) or IOUtils::nodata

◆ computeMask()

std::vector< std::pair< double, double > > mio::TauCLDGenerator::computeMask ( const DEMObject i_dem,
const StationData sd 
)
staticprotected

◆ create()

bool mio::TauCLDGenerator::create ( const size_t &  param,
const size_t &  ii_min,
const size_t &  ii_max,
std::vector< MeteoData > &  vecMeteo 
)
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.

Parameters
[in]parammeteo parameter to generate
[in]ii_minminimum index to apply it to in vecMeteo
[in]ii_maxmaximum index to apply it to in vecMeteo
[in]vecMeteometeo timeseries to process
Returns
true if all missing data points for the given parameter could be generated, false otherwise

Implements mio::GeneratorAlgorithm.

◆ generate()

bool mio::TauCLDGenerator::generate ( const size_t &  param,
MeteoData md,
const std::vector< MeteoData > &  vecMeteo 
)
virtual

◆ getClearness()

double mio::TauCLDGenerator::getClearness ( const double &  cloudiness) const
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).

Parameters
[in]cloudinesscloudiness (between 0 and 1)
Returns
clearness index (between 0 and 1)

◆ getCloudiness()

double mio::TauCLDGenerator::getCloudiness ( const MeteoData md)
protected

Return the atmospheric cloudiness.

Based on the available data, it might be a direct copy of a cloudiness value available in the Meteodata, a parametrization based on clearness index (ie the ratio of the incoming short wave radiation over the ground potential radiation, projected on the horizontal) or a temporal interpolations (over the night or while the AWS is in the shade of the terrain).

Parameters
[in]mdMeteoData
Returns
cloudiness (between 0 and 1)

◆ getHorizon()

double mio::TauCLDGenerator::getHorizon ( const MeteoData md,
const double &  sun_azi 
)
protected

◆ interpolateCloudiness()

double mio::TauCLDGenerator::interpolateCloudiness ( const std::string &  station_hash,
const double &  julian_gmt 
) const
protected

Member Data Documentation

◆ cfg

const Config& mio::TauCLDGenerator::cfg
protected

◆ cloudiness_model

clf_parametrization mio::TauCLDGenerator::cloudiness_model
protected

◆ dem

DEMObject mio::TauCLDGenerator::dem
protected

◆ from_dem

bool mio::TauCLDGenerator::from_dem
protected

◆ horizons_outfile

std::string mio::TauCLDGenerator::horizons_outfile
protected

◆ last_cloudiness

std::map< std::string, cloudCache > mio::TauCLDGenerator::last_cloudiness
protected

◆ masks

std::map< std::string , std::vector< std::pair<double,double> > > mio::TauCLDGenerator::masks
protected

◆ sun

SunObject mio::TauCLDGenerator::sun
protected

◆ use_horizons

bool mio::TauCLDGenerator::use_horizons
protected

◆ use_rad_threshold

bool mio::TauCLDGenerator::use_rad_threshold
protected

◆ use_rswr

bool mio::TauCLDGenerator::use_rswr
protected

◆ write_mask_out

bool mio::TauCLDGenerator::write_mask_out
protected

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