#include <IOManager.h>
Public Member Functions | |
IOManager (const std::string &filename_in) | |
IOManager (const Config &i_cfg) | |
void | read2DGrid (Grid2DObject &grid_out, const std::string &options="") |
void | read2DGrid (Grid2DObject &grid_out, const MeteoGrids::Parameters ¶meter, const Date &date) |
void | read3DGrid (Grid3DObject &grid_out, const std::string &options="") |
void | read3DGrid (Grid3DObject &grid_out, const MeteoGrids::Parameters ¶meter, const Date &date) |
void | readDEM (DEMObject &dem_out) |
void | readAssimilationData (const Date &date_in, Grid2DObject &da_out) |
void | readLanduse (Grid2DObject &landuse_out) |
void | readGlacier (Grid2DObject &glacier_out) |
void | readPOI (std::vector< Coords > &pts) |
void | write2DGrid (const Grid2DObject &grid_in, const std::string &options="") |
void | write2DGrid (const Grid2DObject &grid_in, const MeteoGrids::Parameters ¶meter, const Date &date) |
void | write3DGrid (const Grid3DObject &grid_in, const std::string &options="") |
void | write3DGrid (const Grid3DObject &grid_in, const MeteoGrids::Parameters ¶meter, const Date &date) |
bool | list2DGrids (const Date &start, const Date &end, std::map< Date, std::set< size_t > > &list) |
void | setOfstreamDefault (const Config &i_cfg) |
size_t | getStationData (const Date &date, STATIONS_SET &vecStation) |
size_t | getMeteoData (const Date &dateStart, const Date &dateEnd, std::vector< METEO_SET > &vecVecMeteo) |
Fill vecMeteo with a time series of objects corresponding to the interval indicated by dateStart and dateEnd. Depending on the ProcessingLevel for the instance of the IOManager the data returned will be either raw (read directly from the IOHandler) or processed (read from a buffer and filtered through the MeteoProcessor) More... | |
size_t | getMeteoData (const Date &i_date, METEO_SET &vecMeteo) |
Fill vector<MeteoData> object with multiple instances of MeteoData corresponding to the instant indicated by a Date object. Each MeteoData instance within the vector represents the data for one station at the given instant. Depending on the ProcessingLevel configured data will be either raw (read directly from the IOHandler) or processed (read from a buffer, filtered and resampled). More... | |
void | push_meteo_data (const IOUtils::ProcessingLevel &level, const Date &date_start, const Date &date_end, const std::vector< METEO_SET > &vecMeteo) |
Push a vector of time series of MeteoData objects into the IOManager. This overwrites any internal buffers that are used and subsequent calls to getMeteoData or interpolate will be performed upon this data. This method is a way to bypass the internal reading of MeteoData from a certain source and is useful in case the user is only interested in data processing and interpolation performed by the IOManager object. More... | |
bool | getMeteoData (const Date &date, const DEMObject &dem, const MeteoData::Parameters &meteoparam, Grid2DObject &result) |
Fill Grid2DObject with spatial data. Depending on which meteo plugin is in use, this might be spatially interpolated point measurements or grids as provided by the data source itself. Depending on the ProcessingLevel configured data will be either raw (read directly from the IOHandler) or processed (read from a buffer, filtered and resampled). More... | |
bool | getMeteoData (const Date &date, const DEMObject &dem, const std::string ¶m_name, Grid2DObject &result) |
bool | getMeteoData (const Date &date, const DEMObject &dem, const MeteoData::Parameters &meteoparam, Grid2DObject &result, std::string &info_string) |
bool | getMeteoData (const Date &date, const DEMObject &dem, const std::string ¶m_name, Grid2DObject &result, std::string &info_string) |
void | interpolate (const Date &date, const DEMObject &dem, const MeteoData::Parameters &meteoparam, const std::vector< Coords > &in_coords, std::vector< double > &result) |
void | interpolate (const Date &date, const DEMObject &dem, const MeteoData::Parameters &meteoparam, const std::vector< Coords > &in_coords, std::vector< double > &result, std::string &info_string) |
void | interpolate (const Date &date, const DEMObject &dem, const MeteoData::Parameters &meteoparam, const std::vector< StationData > &in_stations, std::vector< double > &result, std::string &info_string) |
void | setProcessingLevel (const unsigned int &i_level) |
Set the desired ProcessingLevel of the IOManager instance The processing level affects the way meteo data is read and processed Three values are possible: More... | |
void | setMinBufferRequirements (const double &buffer_size, const double &buff_before) |
Set buffer window properties requirements as known to the application itself. This will compare these requirements with the ones expressed by the end user and keep the max between them. The method can be called several times, it will NOT reset the calculated buffer's requirements but keep on merging with new submissions. Any parameter given as IOUtils::nodata will be ignored. More... | |
double | getAvgSamplingRate () const |
Returns the average sampling rate in the data. This computes the average sampling rate of the data that is contained in the buffer. This is a quick estimate, centered on how often a station measures "something" (ie, how many timestamps do we have for this station in the buffer). if the station measures TA at h+0 and h+30 and RH at h+15 and h+45, it would return 4 measurements per hour. If the station measures TA and RH at h+0 and h+30, it would return 2 measurements per hour. More... | |
void | writeMeteoData (const std::vector< METEO_SET > &vecMeteo, const std::string &option="") |
const Config | getConfig () const |
Returns a copy of the internal Config object. This is convenient to clone an iomanager. More... | |
const std::string | toString () const |
void | add_to_points_cache (const Date &i_date, const METEO_SET &vecMeteo) |
Add a METEO_SET for a specific instance to the point cache. This is a way to manipulate MeteoData variables and be sure that the manipulated values are later used for requests regarding that specific date (e.g. 2D interpolations) More... | |
void | clear_cache () |
Clear the all cache. All raw, filtered and resampled values are dismissed, will need to be re-read and/or recalculated. More... | |
mio::IOManager::IOManager | ( | const std::string & | filename_in | ) |
mio::IOManager::IOManager | ( | const Config & | i_cfg | ) |
Add a METEO_SET for a specific instance to the point cache. This is a way to manipulate MeteoData variables and be sure that the manipulated values are later used for requests regarding that specific date (e.g. 2D interpolations)
i_date | Representing a point in time |
vecMeteo | A vector of MeteoData objects to be copied into the point cache |
void mio::IOManager::clear_cache | ( | ) |
Clear the all cache. All raw, filtered and resampled values are dismissed, will need to be re-read and/or recalculated.
double mio::IOManager::getAvgSamplingRate | ( | ) | const |
Returns the average sampling rate in the data. This computes the average sampling rate of the data that is contained in the buffer. This is a quick estimate, centered on how often a station measures "something" (ie, how many timestamps do we have for this station in the buffer). if the station measures TA at h+0 and h+30 and RH at h+15 and h+45, it would return 4 measurements per hour. If the station measures TA and RH at h+0 and h+30, it would return 2 measurements per hour.
|
inline |
bool mio::IOManager::getMeteoData | ( | const Date & | date, |
const DEMObject & | dem, | ||
const MeteoData::Parameters & | meteoparam, | ||
Grid2DObject & | result | ||
) |
Fill Grid2DObject with spatial data. Depending on which meteo plugin is in use, this might be spatially interpolated point measurements or grids as provided by the data source itself. Depending on the ProcessingLevel configured data will be either raw (read directly from the IOHandler) or processed (read from a buffer, filtered and resampled).
NOTE:
Example Usage:
date | A Date object representing the date/time for the sought MeteoData objects |
dem | Digital Elevation Model data |
meteoparam | which meteo parameter to return |
result | grid returned filled with the requested data |
bool mio::IOManager::getMeteoData | ( | const Date & | date, |
const DEMObject & | dem, | ||
const MeteoData::Parameters & | meteoparam, | ||
Grid2DObject & | result, | ||
std::string & | info_string | ||
) |
bool mio::IOManager::getMeteoData | ( | const Date & | date, |
const DEMObject & | dem, | ||
const std::string & | param_name, | ||
Grid2DObject & | result | ||
) |
bool mio::IOManager::getMeteoData | ( | const Date & | date, |
const DEMObject & | dem, | ||
const std::string & | param_name, | ||
Grid2DObject & | result, | ||
std::string & | info_string | ||
) |
size_t mio::IOManager::getMeteoData | ( | const Date & | dateStart, |
const Date & | dateEnd, | ||
std::vector< METEO_SET > & | vecVecMeteo | ||
) |
Fill vecMeteo with a time series of objects corresponding to the interval indicated by dateStart and dateEnd. Depending on the ProcessingLevel for the instance of the IOManager the data returned will be either raw (read directly from the IOHandler) or processed (read from a buffer and filtered through the MeteoProcessor)
vecMeteo will be empty if no datasets were retrieved in the interval defined by dateStart and dateEnd
Example Usage:
dateStart | A Date object representing the beginning of an interval (inclusive) |
dateEnd | A Date object representing the end of an interval (inclusive) |
vecVecMeteo | A vector of vector<MeteoData> objects to be filled with data |
Fill vector<MeteoData> object with multiple instances of MeteoData corresponding to the instant indicated by a Date object. Each MeteoData instance within the vector represents the data for one station at the given instant. Depending on the ProcessingLevel configured data will be either raw (read directly from the IOHandler) or processed (read from a buffer, filtered and resampled).
NOTE:
Example Usage:
i_date | A Date object representing the date/time for the sought MeteoData objects |
vecMeteo | A vector of MeteoData objects to be filled with data |
size_t mio::IOManager::getStationData | ( | const Date & | date, |
STATIONS_SET & | vecStation | ||
) |
void mio::IOManager::interpolate | ( | const Date & | date, |
const DEMObject & | dem, | ||
const MeteoData::Parameters & | meteoparam, | ||
const std::vector< Coords > & | in_coords, | ||
std::vector< double > & | result | ||
) |
void mio::IOManager::interpolate | ( | const Date & | date, |
const DEMObject & | dem, | ||
const MeteoData::Parameters & | meteoparam, | ||
const std::vector< Coords > & | in_coords, | ||
std::vector< double > & | result, | ||
std::string & | info_string | ||
) |
void mio::IOManager::interpolate | ( | const Date & | date, |
const DEMObject & | dem, | ||
const MeteoData::Parameters & | meteoparam, | ||
const std::vector< StationData > & | in_stations, | ||
std::vector< double > & | result, | ||
std::string & | info_string | ||
) |
|
inline |
|
inline |
Push a vector of time series of MeteoData objects into the IOManager. This overwrites any internal buffers that are used and subsequent calls to getMeteoData or interpolate will be performed upon this data. This method is a way to bypass the internal reading of MeteoData from a certain source and is useful in case the user is only interested in data processing and interpolation performed by the IOManager object.
level | Level of processing that has already been performed on the data (raw XOR filtered) |
date_start | Representing the beginning of the data |
date_end | Representing the end of the data |
vecMeteo | The actual data being pushed into the IOManager object |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Set buffer window properties requirements as known to the application itself. This will compare these requirements with the ones expressed by the end user and keep the max between them. The method can be called several times, it will NOT reset the calculated buffer's requirements but keep on merging with new submissions. Any parameter given as IOUtils::nodata will be ignored.
buffer_size | buffer size in days |
buff_before | buffer centering in days |
void mio::IOManager::setOfstreamDefault | ( | const Config & | i_cfg | ) |
void mio::IOManager::setProcessingLevel | ( | const unsigned int & | i_level | ) |
Set the desired ProcessingLevel of the IOManager instance The processing level affects the way meteo data is read and processed Three values are possible:
The three values can be combined: e.g. IOUtils::filtered | IOUtils:resampled
i_level | The ProcessingLevel values that shall be used to process data |
const std::string mio::IOManager::toString | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |