MeteoIODoc 20261003.b9219c1f
Environmental timeseries pre-processing
Loading...
Searching...
No Matches
mio::GridsManager Class Reference

#include <GridsManager.h>

Public Member Functions

 GridsManager (IOHandler &in_iohandler, const Config &in_cfg)
 
void read2DGrid (Grid2DObject &grid_out, const std::string &option="")
 Read the requested grid, according to the configured processing level.
 
void read2DGrid (Grid2DObject &grid_out, const MeteoGrids::Parameters &parameter, const Date &date, const bool &enable_grid_resampling=true)
 Read the requested grid, according to the configured processing level.
 
void read3DGrid (Grid3DObject &grid_out, const std::string &i_filename="")
 
void read3DGrid (Grid3DObject &grid_out, const MeteoGrids::Parameters &parameter, 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 &landuse_out)
 
void write2DGrid (const Grid2DObject &grid_in, const std::string &options="")
 
void write2DGrid (const Grid2DObject &grid_in, const MeteoGrids::Parameters &parameter, const Date &date)
 
void write3DGrid (const Grid3DObject &grid_out, const std::string &options="")
 
void write3DGrid (const Grid3DObject &grid_out, const MeteoGrids::Parameters &parameter, const Date &date)
 
void setProcessingLevel (const unsigned int &i_level)
 Set the desired ProcessingLevel.
 
void clear_cache ()
 
const Config & getConfig () const
 Returns the internal Config object.
 
const IOHandler & getIOHandler () const
 Returns the internal IOHandler object.
 
std::vector< StationData > initVirtualStationsAtAllGridPoints (const DEMObject &dem) const
 Create a list of virtual stations from each grid point.
 
std::vector< StationData > initVirtualStations (const DEMObject &dem, const bool &adjust_coordinates, const bool &fourNeighbors) const
 Create a list of virtual stations from the user-provided input.
 
METEO_SET getVirtualStationsFromGrid (const DEMObject &dem, const std::vector< size_t > &v_params, const std::vector< StationData > &v_stations, const Date &date, const bool &PtsExtract=false)
 Extract time series from grids at the specified points (virtual stations).
 
std::vector< METEO_SET > getVirtualStationsFromGrid (const DEMObject &dem, const std::vector< size_t > &v_params, const std::vector< StationData > &v_stations, const Date &dateStart, const Date &dateEnd, const bool &PtsExtract=false)
 Extract time series from grids at the specified points (virtual stations).
 
const std::string toString () const
 

Constructor & Destructor Documentation

◆ GridsManager()

mio::GridsManager::GridsManager ( IOHandler &  in_iohandler,
const Config &  in_cfg 
)

Member Function Documentation

◆ clear_cache()

void mio::GridsManager::clear_cache ( )
inline

◆ getConfig()

const Config & mio::GridsManager::getConfig ( ) const
inline

Returns the internal Config object.

Returns
const reference to the internal Config object

◆ getIOHandler()

const IOHandler & mio::GridsManager::getIOHandler ( ) const
inline

Returns the internal IOHandler object.

Returns
const reference to the internal IOHandler object

◆ getVirtualStationsFromGrid() [1/2]

METEO_SET mio::GridsManager::getVirtualStationsFromGrid ( const DEMObject &  dem,
const std::vector< size_t > &  v_params,
const std::vector< StationData > &  v_stations,
const Date &  date,
const bool &  PtsExtract = false 
)

Extract time series from grids at the specified points (virtual stations).

Parameters
[in]demthe Digital Elevation Model to use to check the geolocalization of the grids
[in]v_paramsthe MeteoGrids parameter index that have to be extracted
[in]v_stationsa vector of StationData where to provide the meteorological data
[in]datewhen to extract the virtual stations
[in]PtsExtractuse the method to only request points instead of full grids from the plugin?
Returns
a vector of meteodata for the configured virtual stations at the provided date, for the provided parameters

◆ getVirtualStationsFromGrid() [2/2]

std::vector< METEO_SET > mio::GridsManager::getVirtualStationsFromGrid ( const DEMObject &  dem,
const std::vector< size_t > &  v_params,
const std::vector< StationData > &  v_stations,
const Date &  dateStart,
const Date &  dateEnd,
const bool &  PtsExtract = false 
)

Extract time series from grids at the specified points (virtual stations).

Parameters
[in]demthe Digital Elevation Model to use to check the geolocalization of the grids
[in]v_paramsthe MeteoGrids parameter index that have to be extracted
[in]v_stationsa vector of StationData where to provide the meteorological data
[in]dateStartwhen to start extracting the virtual stations
[in]dateEndwhen to stop extracting the virtual stations
[in]PtsExtractuse the method to only request points instead of full grids from the plugin?
Returns
a vector of meteodata for the configured virtual stations at the provided date, for the provided parameters

◆ initVirtualStations()

std::vector< StationData > mio::GridsManager::initVirtualStations ( const DEMObject &  dem,
const bool &  adjust_coordinates,
const bool &  fourNeighbors 
) const

Create a list of virtual stations from the user-provided input.

Please note that the two options are mutually exclusive.

Parameters
[in]demthe Digital Elevation Model to use
[in]adjust_coordinatesshould the coordinates be recomputed to match DEM cells?
[in]fourNeighborspick the surrounding four nodes instead of only the exact one?
Returns
a vector of virtual stations

◆ initVirtualStationsAtAllGridPoints()

std::vector< StationData > mio::GridsManager::initVirtualStationsAtAllGridPoints ( const DEMObject &  dem) const

Create a list of virtual stations from each grid point.

Please note that the two options are mutually exclusive.

Parameters
[in]demthe Digital Elevation Model to use (each grid point will be made into a virtual station)
Returns
a vector of virtual stations

◆ read2DGrid() [1/2]

void mio::GridsManager::read2DGrid ( Grid2DObject &  grid2D,
const MeteoGrids::Parameters &  parameter,
const Date &  date,
const bool &  enable_grid_resampling = true 
)

Read the requested grid, according to the configured processing level.

If the grid has been buffered, it will be returned from the buffer. If it is not available but can be generated, it will be generated transparently. If everything fails, it will thrown an exception.

Parameters
[out]grid2Da grid filled with the requested parameter
[in]parameterthe parameter to get
[in]datethe timestamp that we would like to have
[in]enable_grid_resamplingCompletely enable or disable temporal grid resampling.

◆ read2DGrid() [2/2]

void mio::GridsManager::read2DGrid ( Grid2DObject &  grid2D,
const std::string &  option = "" 
)

Read the requested grid, according to the configured processing level.

If the grid has been buffered, it will be returned from the buffer. If it is not available but can be generated, it will be generated transparently. If everything fails, it will throw an exception.

Parameters
[out]grid2Da grid filled with the requested parameter
optiona parameter used to figure out which filename or grid to read

◆ read3DGrid() [1/2]

void mio::GridsManager::read3DGrid ( Grid3DObject &  grid_out,
const MeteoGrids::Parameters &  parameter,
const Date &  date 
)
inline

◆ read3DGrid() [2/2]

void mio::GridsManager::read3DGrid ( Grid3DObject &  grid_out,
const std::string &  i_filename = "" 
)
inline

◆ readAssimilationData()

void mio::GridsManager::readAssimilationData ( const Date &  date_in,
Grid2DObject &  da_out 
)

◆ readDEM()

void mio::GridsManager::readDEM ( DEMObject &  dem_out)

◆ readGlacier()

void mio::GridsManager::readGlacier ( Grid2DObject &  landuse_out)

◆ readLanduse()

void mio::GridsManager::readLanduse ( Grid2DObject &  landuse_out)

◆ setProcessingLevel()

void mio::GridsManager::setProcessingLevel ( const unsigned int &  i_level)

Set the desired ProcessingLevel.

The processing level affects the way meteo data is read and processed. Three values are possible:

This only affects the function getMeteoData(const Date&, METEO_DATASET&). The three values can be combined: e.g. IOUtils::filtered | IOUtils:resampled

Parameters
i_levelThe ProcessingLevel values that shall be used to process data

◆ toString()

const std::string mio::GridsManager::toString ( ) const

◆ write2DGrid() [1/2]

void mio::GridsManager::write2DGrid ( const Grid2DObject &  grid_in,
const MeteoGrids::Parameters &  parameter,
const Date &  date 
)
inline

◆ write2DGrid() [2/2]

void mio::GridsManager::write2DGrid ( const Grid2DObject &  grid_in,
const std::string &  options = "" 
)
inline

◆ write3DGrid() [1/2]

void mio::GridsManager::write3DGrid ( const Grid3DObject &  grid_out,
const MeteoGrids::Parameters &  parameter,
const Date &  date 
)
inline

◆ write3DGrid() [2/2]

void mio::GridsManager::write3DGrid ( const Grid3DObject &  grid_out,
const std::string &  options = "" 
)
inline

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