MeteoIODoc  2.10.0
mio::GrassIO Class Reference

Detailed Description

This class enables the access to 2D grids stored in GRASS ASCII (e.g. JGrass) format.

Author
Thomas Egger
Date
2008-08-03

#include <GrassIO.h>

Public Member Functions

 GrassIO (const std::string &configfile)
 
 GrassIO (const GrassIO &)
 
 GrassIO (const Config &)
 
virtual bool list2DGrids (const Date &, const Date &, std::map< Date, std::set< size_t > > &)
 Return the list of grids within a given time period that could be read by the plugin, if requested. More...
 
virtual void read2DGrid (Grid2DObject &dem_out, const std::string &parameter="")
 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 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 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 write2DGrid (const Grid2DObject &grid_in, const std::string &options)
 Write a Grid2DObject The filename is specified relative to GRID2DPATH for most plugins. More...
 
virtual void read2DGrid (Grid2DObject &grid_out, const std::string &parameter="")
 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 &parameter, 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 write2DGrid (const Grid2DObject &grid_out, const std::string &options="")
 Write a Grid2DObject The filename is specified relative to GRID2DPATH for most plugins. More...
 
virtual void write2DGrid (const Grid2DObject &grid_out, const MeteoGrids::Parameters &parameter, const Date &date)
 Write a Grid2DObject containing a known meteorological parameter A filename is built relative to GRID2DPATH for most plugins. More...
 
- Public Member Functions inherited from mio::IOInterface
virtual ~IOInterface ()
 
virtual void read2DGrid (Grid2DObject &grid_out, const MeteoGrids::Parameters &parameter, 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 &parameter, 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 &parameter="")
 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 &parameter, 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 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...
 
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_out, const MeteoGrids::Parameters &parameter, 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 &parameter, const Date &date)
 Write a Grid3DObject comtaining a known meteorological parameter A filename is build relative to GRID3DPATH for most plugins. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from mio::IOInterface
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< LinesRangeinitLinesRestrictions (const std::string &args, const std::string &where, const bool &negate)
 built the set of line ranges to read or skip. More...
 
- Static Protected Member Functions inherited from mio::IOInterface
static void mergeLinesRanges (std::vector< LinesRange > &lines_specs)
 Merge potentially overlaping line ranges. More...
 

Constructor & Destructor Documentation

◆ GrassIO() [1/3]

mio::GrassIO::GrassIO ( const std::string &  configfile)

◆ GrassIO() [2/3]

mio::GrassIO::GrassIO ( const GrassIO )

◆ GrassIO() [3/3]

mio::GrassIO::GrassIO ( const Config cfgreader)

Member Function Documentation

◆ list2DGrids()

virtual bool mio::GrassIO::list2DGrids ( const Date start,
const Date end,
std::map< Date, std::set< size_t > > &  list 
)
inlinevirtual

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)

Parameters
[in]startthe start of the time interval
[in]endthe end of the interval
[out]listthe list of grids. The first key is the date, then a set of parameters (from MeteoGrids::Parameters)
Returns
true if the list could be filled (even if empty), false if such as list can not be filled by the plugin (for example, it does not have the data before actually reading it)

Reimplemented from mio::IOInterface.

◆ read2DGrid() [1/3]

void mio::GrassIO::read2DGrid ( Grid2DObject grid_out,
const std::string &  parameter = "" 
)
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.

Parameters
grid_outA Grid2DObject instance
parameterA std::string representing some information for the function on what grid to retrieve

Reimplemented from mio::IOInterface.

◆ read2DGrid() [2/3]

void mio::IOInterface::read2DGrid

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.

Parameters
grid_outA Grid2DObject instance
parameterThe meteo parameter grid type to return (ie: air temperature, wind component, etc)
datedate of the data to read

◆ read2DGrid() [3/3]

void mio::IOInterface::read2DGrid

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.

Parameters
grid_outA Grid2DObject instance
parameterA std::string representing some information for the function on what grid to retrieve

◆ readAssimilationData()

void mio::GrassIO::readAssimilationData ( const Date date_in,
Grid2DObject da_out 
)
virtual

Parse the assimilation data into a Grid2DObject for a certain date represented by the Date object.

Example Usage:

Grid2DObject adata;
Date d1(2008,06,21,11,0, 1.); //21.6.2008 11:00 UTC+1
IOHandler io1("io.ini");
io1.readAssimilationData(d1, adata);
Parameters
date_inA Date object representing the date of the assimilation data
da_outA Grid2DObject that holds the assimilation data for every grid point

Reimplemented from mio::IOInterface.

◆ readDEM()

void mio::GrassIO::readDEM ( DEMObject dem_out)
virtual

Parse the DEM (Digital Elevation Model) into the Grid2DObject.

Example Usage:

Grid2DObject dem;
IOHandler io1("io.ini");
io1.readDEM(dem);
Parameters
dem_outA Grid2DObject that holds the DEM

Reimplemented from mio::IOInterface.

◆ readGlacier()

void mio::GrassIO::readGlacier ( Grid2DObject glacier_out)
virtual

Parse the input glacier grid into the Grid2DObject.

Example Usage:

Grid2DObject glacier;
IOHandler io1("io.ini");
io1.readGlacier(glacier);
Parameters
glacier_outA Grid2DObject that holds the glacier height

Reimplemented from mio::IOInterface.

◆ readLanduse()

void mio::GrassIO::readLanduse ( Grid2DObject landuse_out)
virtual

Parse the landuse model into the Grid2DObject.

Example Usage:

Grid2DObject landuse;
IOHandler io1("io.ini");
io1.readLanduse(landuse);
Parameters
landuse_outA Grid2DObject that holds the landuse model

Reimplemented from mio::IOInterface.

◆ write2DGrid() [1/3]

void mio::GrassIO::write2DGrid ( const Grid2DObject grid_out,
const std::string &  options 
)
virtual

Write a Grid2DObject The filename is specified relative to GRID2DPATH for most plugins.

Parameters
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.

◆ write2DGrid() [2/3]

void mio::IOInterface::write2DGrid

Write a Grid2DObject containing a known meteorological parameter A filename is built relative to GRID2DPATH for most plugins.

Parameters
grid_out(Grid2DObject) The grid to write
parameterThe meteo parameter grid type of the provided grid object (ie: air temperature, wind component, etc)
datedate of the data to write

◆ write2DGrid() [3/3]

void mio::IOInterface::write2DGrid

Write a Grid2DObject The filename is specified relative to GRID2DPATH for most plugins.

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

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