MI - Fimex
Public Member Functions | Static Public Member Functions | List of all members
MetNoFimex::GribCDMReader Class Reference

#include <GribCDMReader.h>

Inheritance diagram for MetNoFimex::GribCDMReader:
MetNoFimex::CDMReader

Public Member Functions

 GribCDMReader (const std::vector< std::string > &fileNames, const XMLInput &configXML, const std::vector< std::pair< std::string, std::string > > &members=std::vector< std::pair< std::string, std::string > >())
 
 GribCDMReader (const std::string &grbmlFileName, const XMLInput &configXML, const std::vector< std::pair< std::string, std::string > > &members=std::vector< std::pair< std::string, std::string > >())
 
virtual ~GribCDMReader ()
 
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 CDMgetCDM () const
 
virtual CDMgetInternalCDM ()
 
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...
 

Static Public Member Functions

static boost::shared_ptr< XMLDocinitXMLConfig (const XMLInput &configXML)
 
static std::string getConfigEarthFigure (boost::shared_ptr< XMLDoc > doc)
 
static std::string getConfigExtraKeys (boost::shared_ptr< XMLDoc > doc)
 

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< CDMcdm_
 

Constructor & Destructor Documentation

MetNoFimex::GribCDMReader::GribCDMReader ( const std::vector< std::string > &  fileNames,
const XMLInput configXML,
const std::vector< std::pair< std::string, std::string > > &  members = std::vectorstd::pairstd::stringstd::string > >() 
)
MetNoFimex::GribCDMReader::GribCDMReader ( const std::string grbmlFileName,
const XMLInput configXML,
const std::vector< std::pair< std::string, std::string > > &  members = std::vectorstd::pairstd::stringstd::string > >() 
)
virtual MetNoFimex::GribCDMReader::~GribCDMReader ( )
virtual

Member Function Documentation

static std::string MetNoFimex::GribCDMReader::getConfigEarthFigure ( boost::shared_ptr< XMLDoc doc)
static

read the earth-figure from the xml-file

Returns
"" or proj4-string as in xml-file
static std::string MetNoFimex::GribCDMReader::getConfigExtraKeys ( boost::shared_ptr< XMLDoc doc)
static

read the non-standard attributes of parameters from the xml-config

Returns
"" or a comma delimited string with attributes
virtual DataPtr MetNoFimex::GribCDMReader::getDataSlice ( const std::string varName,
size_t  unLimDimPos 
)
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.

Parameters
varNamename of the variable to read
unLimDimPos(optional) if the variable contains a unlimited dimension (max one allowed) an slice of this position is returned
Exceptions
CDMExceptionon errors related to the CDM in combination with the underlying data-structure. It might also throw other (IO-)exceptions.

Implements MetNoFimex::CDMReader.

virtual DataPtr MetNoFimex::GribCDMReader::getDataSlice ( const std::string varName,
const SliceBuilder sb 
)
virtual

data-reading function to be called from the CDMWriter

Parameters
varNamename of the variable to read
sba SliceBuilder generated from this CDMReaders CDM
Exceptions
CDMExceptionon errors related to the CDM in combination with the underlying data-structure. It might also throw other (IO-)exceptions.
Warning
This method has a default implementation depending on getDataSlice(const std::string&, size_t), but should be implemented for performance reasons. If you want to fall back to the default implementation, remember to use 'using CDMReader::getDataSlice;'

Reimplemented from MetNoFimex::CDMReader.

static boost::shared_ptr<XMLDoc> MetNoFimex::GribCDMReader::initXMLConfig ( const XMLInput configXML)
static

Read a initialized cdmGribReader xml-document

Parameters
configXML
Returns
the XMLDoc dom object

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