MI - Fimex
|
#include <WdbCDMReader.h>
Public Member Functions | |
WdbCDMReader (const std::string &source, const XMLInput &configXML) | |
WdbCDMReader (const std::string &source, const std::string &configFile) | |
virtual | ~WdbCDMReader () |
virtual DataPtr | getDataSlice (const std::string &varName, size_t unLimDimPos) |
data-reading function to be called from the CDMWriter More... | |
virtual DataPtr | getDataSlice (const std::string &varName, const SliceBuilder &sb) |
data-reading function to be called from the CDMWriter More... | |
Public Member Functions inherited from MetNoFimex::CDMReader | |
CDMReader () | |
virtual | ~CDMReader () |
virtual const CDM & | getCDM () const |
virtual CDM & | getInternalCDM () |
virtual std::vector< std::size_t > | getDims (std::string varName) |
Read the sizes of the dimensions belonging to a variable. More... | |
virtual std::vector< std::size_t > | getDimsSlice (std::string varName) |
Read the sizes of the dimensions belonging to a variable slice. More... | |
virtual DataPtr | getData (const std::string &varName) |
data-reading function to be called from the CDMWriter More... | |
virtual DataPtr | getScaledDataSlice (const std::string &varName, size_t unLimDimPos) |
read and scale a dataslice More... | |
virtual DataPtr | getScaledDataSliceInUnit (const std::string &varName, const std::string &unit, size_t unLimDimPos) |
read and scale a dataslice to a known unit More... | |
virtual DataPtr | getScaledDataSlice (const std::string &varName, const SliceBuilder &sb) |
read and scale a dataslice More... | |
virtual DataPtr | getScaledDataSliceInUnit (const std::string &varName, const std::string &unit, const SliceBuilder &sb) |
read and scale a dataslice to a set unit More... | |
virtual DataPtr | getScaledData (const std::string &varName) |
read and scale the complete data More... | |
virtual DataPtr | getScaledDataInUnit (const std::string &varName, const std::string &unit) |
read and scale the complete data to a set unit More... | |
Additional Inherited Members | |
Protected Member Functions inherited from MetNoFimex::CDMReader | |
virtual DataPtr | getDataSliceFromMemory (const CDMVariable &variable, size_t unLimDimPos=0) |
void | getScaleAndOffsetOf (const std::string &varName, double &scale, double &offset) const |
Protected Attributes inherited from MetNoFimex::CDMReader | |
boost::shared_ptr< CDM > | cdm_ |
CDM reader for wdb databases.
Since wdb is a database system, a configuration file is used in place of a "real" data file. This configuration file tells how to connect to a wdb database, and what query to perform on it.
General syntax for the wdb query file may be found in the wdb_query.xsd file, with an annotated example in the wdb.example.wdbml file.
Also, it is possible to use a specification in place of the file. That specification is a semicolon separated list of name-value pairs.
It is possible to use a hybrid specification, in which you give additions to the queries in the query file. If you want to specify queries in this way you must follow the syntax, used in the following example:
"file=whatever.wdbml;dataprovider=whoever;referencetime=latest"
The following keywords are recognized: file, dbname, host, port, user, wciUser, dataprovider, location, referencetime, validtime, parameter and dataversion. They follow the same rule as the corresponding keywords in the xml-files.
Syntax for global configuration is given in wdb_conf.xsd.
Since there is much freedom in wdb, the generated CDMs from different wdb instances can be very different from each other. In general all dimensions of size one will be skipped in the resulting dimensions and variables.
MetNoFimex::WdbCDMReader::WdbCDMReader | ( | const std::string & | source, |
const XMLInput & | configXML | ||
) |
Specifications of where to find the database, and what query to run on it is given in the file with name source. Generic specifications are given in the file with name configfilename.
MetNoFimex::WdbCDMReader::WdbCDMReader | ( | const std::string & | source, |
const std::string & | configFile | ||
) |
|
virtual |
|
virtual |
data-reading function to be called from the CDMWriter
This methods needs to be implemented by the CDMReader. It should provide the data for each variable, either by reading from disk, converting from another CDMReader or reading from an in-memory data-section.
This function should retrieve the whole data for a dataset without unlimited dimension if the unLimDimPos == 0.
varName | name of the variable to read |
unLimDimPos | (optional) if the variable contains a unlimited dimension (max one allowed) an slice of this position is returned |
CDMException | on errors related to the CDM in combination with the underlying data-structure. It might also throw other (IO-)exceptions. |
Implements MetNoFimex::CDMReader.
|
virtual |
data-reading function to be called from the CDMWriter
varName | name of the variable to read |
sb | a SliceBuilder generated from this CDMReaders CDM |
CDMException | on errors related to the CDM in combination with the underlying data-structure. It might also throw other (IO-)exceptions. |
Reimplemented from MetNoFimex::CDMReader.