This class is the class to use for raw I/O operations. It is responsible for transparently loading the plugins and it follows the interface defined by the IOInterface class with the addition of a few convenience methods.
#include <IOHandler.h>
Public Member Functions | |
IOHandler (const IOHandler &) | |
IOHandler (const Config &) | |
virtual | ~IOHandler () noexcept |
IOHandler & | operator= (const IOHandler &) |
Assignement operator. More... | |
virtual bool | list2DGrids (const Date &start, const Date &end, std::map< Date, std::set< size_t > > &list) |
Return the list of grids within a given time period that could be read by the plugin, if requested. More... | |
virtual void | read2DGrid (Grid2DObject &out_grid, const std::string ¶meter="") |
A generic function for parsing 2D grids into a Grid2DObject. The string parameter shall be used for addressing the specific 2D grid to be parsed into the Grid2DObject, relative to GRID2DPATH for most plugins. More... | |
virtual void | read2DGrid (Grid2DObject &grid_out, const MeteoGrids::Parameters ¶meter, const Date &date) |
Read the given meteo parameter into a Grid2DObject. Each plugin has its own logic for finding the requested meteo parameter grid relative to GRID2DPATH for most plugins. More... | |
virtual void | readPointsIn2DGrid (std::vector< double > &data, const MeteoGrids::Parameters ¶meter, const Date &date, const std::vector< std::pair< size_t, size_t > > &Pts) |
Read the given meteo parameter into a vector for a list of points. Each plugin has its own logic for finding the requested meteo parameter grid relative to GRID2DPATH for most plugins. More... | |
virtual void | read3DGrid (Grid3DObject &grid_out, const std::string &i_filename="") |
A generic function for parsing 3D grids into a Grid3DObject. The string parameter shall be used for addressing the specific 3D grid to be parsed into the Grid3DObject, relative to GRID3DPATH for most plugins. More... | |
virtual void | read3DGrid (Grid3DObject &grid_out, const MeteoGrids::Parameters ¶meter, const Date &date) |
Read the given meteo parameter into a Grid3DObject. Each plugin has its own logic for finding the requested meteo parameter grid relative to GRID3DPATH for most plugins. More... | |
virtual void | readDEM (DEMObject &dem_out) |
Parse the DEM (Digital Elevation Model) into the Grid2DObject. More... | |
virtual void | readLanduse (Grid2DObject &landuse_out) |
Parse the landuse model into the Grid2DObject. More... | |
virtual void | readGlacier (Grid2DObject &glacier_out) |
Parse the input glacier grid into the Grid2DObject. More... | |
virtual void | readStationData (const Date &date, STATIONS_SET &vecStation) |
virtual void | writeMeteoData (const std::vector< METEO_SET > &vecMeteo, const std::string &name="") |
virtual void | readMeteoData (const Date &dateStart, const Date &dateEnd, std::vector< METEO_SET > &vecMeteo) |
virtual void | readAssimilationData (const Date &, Grid2DObject &da_out) |
Parse the assimilation data into a Grid2DObject for a certain date represented by the Date object. More... | |
virtual void | readPOI (std::vector< Coords > &pts) |
Read a list of points by their grid coordinates This allows for example to get a list of points where to produce more detailed outputs. More... | |
virtual void | write2DGrid (const Grid2DObject &grid_in, const std::string &name) |
Write a Grid2DObject The filename is specified relative to GRID2DPATH for most plugins. More... | |
virtual void | write2DGrid (const Grid2DObject &grid_in, const MeteoGrids::Parameters ¶meter, const Date &date) |
Write a Grid2DObject containing a known meteorological parameter A filename is built relative to GRID2DPATH for most plugins. More... | |
virtual void | write3DGrid (const Grid3DObject &grid_out, const std::string &options) |
Write a Grid3DObject The filename is specified relative to GRID3DPATH for most plugins. More... | |
virtual void | write3DGrid (const Grid3DObject &grid_out, const MeteoGrids::Parameters ¶meter, const Date &date) |
Write a Grid3DObject comtaining a known meteorological parameter A filename is build relative to GRID3DPATH for most plugins. More... | |
const std::string | toString () const |
![]() | |
virtual | ~IOInterface () |
virtual void | readStationData (const Date &date, std::vector< StationData > &vecStation) |
Fill vecStation with StationData objects for a certain date of interest. More... | |
virtual void | readMeteoData (const Date &dateStart, const Date &dateEnd, std::vector< std::vector< MeteoData > > &vecMeteo) |
Fill vecMeteo with a time series of objects corresponding to the interval indicated by dateStart and dateEnd. More... | |
virtual void | writeMeteoData (const std::vector< std::vector< MeteoData > > &vecMeteo, const std::string &name="") |
Write vecMeteo time series to a certain destination. More... | |
Additional Inherited Members | |
![]() | |
static void | set2DGridLatLon (Grid2DObject &grid, const double &i_ur_lat, const double &i_ur_lon) |
static double | computeGridXYCellsize (const std::vector< double > &vecX, const std::vector< double > &vecY) |
static std::vector< LinesRange > | initLinesRestrictions (const std::string &args, const std::string &where, const bool &negate) |
built the set of line ranges to read or skip. More... | |
![]() | |
static void | mergeLinesRanges (std::vector< LinesRange > &lines_specs) |
Merge potentially overlaping line ranges. More... | |
mio::IOHandler::IOHandler | ( | const IOHandler & | aio | ) |
mio::IOHandler::IOHandler | ( | const Config & | cfgreader | ) |
|
virtualnoexcept |
|
virtual |
Return the list of grids within a given time period that could be read by the plugin, if requested.
This call should be implemented by all plugins reading grids, so the GridsManager can perform all kinds of advanced features with grids (computing a parameter from other ones, temporally interpolating, etc)
[in] | start | the start of the time interval |
[in] | end | the end of the interval |
[out] | list | the list of grids. The first key is the date, then a set of parameters (from MeteoGrids::Parameters) |
Reimplemented from mio::IOInterface.
|
virtual |
Read the given meteo parameter into a Grid2DObject. Each plugin has its own logic for finding the requested meteo parameter grid relative to GRID2DPATH for most plugins.
grid_out | A Grid2DObject instance |
parameter | The meteo parameter grid type to return (ie: air temperature, wind component, etc) |
date | date of the data to read |
Reimplemented from mio::IOInterface.
|
virtual |
A generic function for parsing 2D grids into a Grid2DObject. The string parameter shall be used for addressing the specific 2D grid to be parsed into the Grid2DObject, relative to GRID2DPATH for most plugins.
grid_out | A Grid2DObject instance |
parameter | A std::string representing some information for the function on what grid to retrieve |
Reimplemented from mio::IOInterface.
|
virtual |
Read the given meteo parameter into a Grid3DObject. Each plugin has its own logic for finding the requested meteo parameter grid relative to GRID3DPATH for most plugins.
grid_out | A Grid3DObject instance |
parameter | The meteo parameter grid type to return (ie: air temperature, wind component, etc) |
date | date of the data to read |
Reimplemented from mio::IOInterface.
|
virtual |
A generic function for parsing 3D grids into a Grid3DObject. The string parameter shall be used for addressing the specific 3D grid to be parsed into the Grid3DObject, relative to GRID3DPATH for most plugins.
grid_out | A Grid3DObject instance |
parameter | A std::string representing some information for the function on what grid to retrieve |
Reimplemented from mio::IOInterface.
|
virtual |
Parse the assimilation data into a Grid2DObject for a certain date represented by the Date object.
Example Usage:
date_in | A Date object representing the date of the assimilation data |
da_out | A Grid2DObject that holds the assimilation data for every grid point |
Reimplemented from mio::IOInterface.
|
virtual |
Parse the DEM (Digital Elevation Model) into the Grid2DObject.
Example Usage:
dem_out | A Grid2DObject that holds the DEM |
Reimplemented from mio::IOInterface.
|
virtual |
Parse the input glacier grid into the Grid2DObject.
Example Usage:
glacier_out | A Grid2DObject that holds the glacier height |
Reimplemented from mio::IOInterface.
|
virtual |
Parse the landuse model into the Grid2DObject.
Example Usage:
landuse_out | A Grid2DObject that holds the landuse model |
Reimplemented from mio::IOInterface.
|
virtual |
|
virtual |
Read a list of points by their grid coordinates This allows for example to get a list of points where to produce more detailed outputs.
pts | (std::vector<Coords>) A vector of points coordinates |
Reimplemented from mio::IOInterface.
|
virtual |
Read the given meteo parameter into a vector for a list of points. Each plugin has its own logic for finding the requested meteo parameter grid relative to GRID2DPATH for most plugins.
data | A double vector to hold the data |
parameter | The meteo parameter grid type to return (ie: air temperature, wind component, etc) |
date | date of the data to read |
Pts | vector of points to read from the grid |
Reimplemented from mio::IOInterface.
|
virtual |
const std::string mio::IOHandler::toString | ( | ) | const |
|
virtual |
Write a Grid2DObject containing a known meteorological parameter A filename is built relative to GRID2DPATH for most plugins.
grid_out | (Grid2DObject) The grid to write |
parameter | The meteo parameter grid type of the provided grid object (ie: air temperature, wind component, etc) |
date | date of the data to write |
Reimplemented from mio::IOInterface.
|
virtual |
Write a Grid2DObject The filename is specified relative to GRID2DPATH for most plugins.
grid_out | (Grid2DObject) The grid to write |
options | (string) Identifier useful for the output plugin (it could become part of a file name, a db table, etc) |
Reimplemented from mio::IOInterface.
|
virtual |
Write a Grid3DObject comtaining a known meteorological parameter A filename is build relative to GRID3DPATH for most plugins.
grid_out | (Grid3DObject) The grid to write |
parameter | The meteo parameter grid type of the provided grid object (ie: air temperature, wind component, etc) |
date | date of the data to write |
Reimplemented from mio::IOInterface.
|
virtual |
Write a Grid3DObject The filename is specified relative to GRID3DPATH for most plugins.
grid_out | (Grid3DObject) The grid to write |
options | (string) Identifier useful for the output plugin (it could become part of a file name, a db table, etc) |
Reimplemented from mio::IOInterface.
|
virtual |