This class is handled by a GridManager and performs grid filtering and temporal resampling.
#include <GridProcessor.h>
Public Member Functions | |
GridProcessor (const Config &cfg) | |
Constructor for a grid processor. More... | |
bool | resample (const Date &date, const MeteoGrids::Parameters ¶meter, const std::map< Date, Grid2DObject > &all_grids, Grid2DObject &resampled_grid) |
This function forwards interpolation requests. More... | |
double | getWindowSize () const |
Static Public Member Functions | |
static std::map< Date, Grid2DObject >::const_iterator | seek (const Date &date, const std::map< Date, Grid2DObject > &grids, const bool &exact_match=false) |
Search a list of grids for a specific date. More... | |
static std::map< Date, Grid2DObject >::const_iterator | seek_before (const Date &date, const std::map< Date, Grid2DObject > &grids) |
Find a grid that is available right after a specific date. More... | |
static std::map< Date, Grid2DObject >::const_iterator | seek_after (const Date &date, const std::map< Date, Grid2DObject > &grids) |
Find a grid that is available before a specific date. More... | |
mio::GridProcessor::GridProcessor | ( | const Config & | cfg | ) |
Constructor for a grid processor.
A GridProcessor object manages grid filtering and grid resampling; the latter through a Grid1dInterpolator.
[in] | cfg | The current simulation's configuration. |
|
inline |
bool mio::GridProcessor::resample | ( | const Date & | date, |
const MeteoGrids::Parameters & | parameter, | ||
const std::map< Date, Grid2DObject > & | all_grids, | ||
Grid2DObject & | resampled_grid | ||
) |
This function forwards interpolation requests.
Delegate a resampling request to the Grid1dInterpolator (which will in turn forward the call to the actual interpolation routine).
[in] | date | Date to resample to. |
[in] | parameter | Meteo parameter to resample. |
[in] | all_grids | A list of all grids to use for resampling, including the corresponding dates. |
[out] | resampled_grid | Grid filled with resampled data. |
|
static |
Search a list of grids for a specific date.
This function takes a map of date/grid combinations and searches it for a specific date.
[in] | date | Date to look for. |
[in] | grids | A map with the dates as keys, and corresponding grids as values. |
[in] | exact_match | Does the date have to match exactly? |
|
static |
Find a grid that is available before a specific date.
This function takes a map of date/grid combinations and searches it for the grid that comes right before a specified date.
[in] | date | Date to look for. |
[in] | grids | A map with the dates as keys, and corresponding grids as values. |
|
static |
Find a grid that is available right after a specific date.
This function takes a map of date/grid combinations and searches it for the first grid that comes after a specified date.
[in] | date | Date to look for. |
[in] | grids | A map with the dates as keys, and corresponding grids as values. |