#include <CDMExtractor.h>
Public Member Functions | |
CDMExtractor (boost::shared_ptr< CDMReader > dataReader) | |
virtual | ~CDMExtractor () |
virtual boost::shared_ptr< Data > | getDataSlice (const std::string &varName, size_t unLimDimPos=0) throw (CDMException) |
data-reading function to be called from the CDMWriter | |
virtual void | removeVariable (std::string variable) throw (CDMException) |
Remove a variable from the CDM. | |
virtual void | reduceDimension (std::string dimName, size_t start, size_t length) throw (CDMException) |
Reduce a dimension of the file. | |
virtual void | reduceDimensionStartEnd (std::string dimName, size_t start=0, long end=0) throw (CDMException) |
Reduce a dimension of the file. | |
virtual void | changeDataType (std::string variable, CDMDataType datatype) throw (CDMException) |
change the datatype of the variable |
MetNoFimex::CDMExtractor::CDMExtractor | ( | boost::shared_ptr< CDMReader > | dataReader | ) |
virtual MetNoFimex::CDMExtractor::~CDMExtractor | ( | ) | [virtual] |
virtual boost::shared_ptr<Data> MetNoFimex::CDMExtractor::getDataSlice | ( | const std::string & | varName, | |
size_t | unLimDimPos = 0 | |||
) | throw (CDMException) [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 |
Implements MetNoFimex::CDMReader.
virtual void MetNoFimex::CDMExtractor::removeVariable | ( | std::string | variable | ) | throw (CDMException) [virtual] |
Remove a variable from the CDM.
name | of the variable |
CDMException | if variable doesn't exist |
virtual void MetNoFimex::CDMExtractor::reduceDimension | ( | std::string | dimName, | |
size_t | start, | |||
size_t | length | |||
) | throw (CDMException) [virtual] |
Reduce a dimension of the file.
name | dimension to change | |
start | start-position corresponding to the original dimension | |
size | size of the new dimension |
CDMException | if dimension doesn't exist or start+size outside range of the original dimension |
virtual void MetNoFimex::CDMExtractor::reduceDimensionStartEnd | ( | std::string | dimName, | |
size_t | start = 0 , |
|||
long | end = 0 | |||
) | throw (CDMException) [virtual] |
Reduce a dimension of the file.
name | dimension to change | |
start | start-position corresponding to the original dimension, defaults to 0 | |
end | end-position of dimension, 0 means full size, negative values start from end |
CDMException | if dimension doesn't exist or start+size outside range of the original dimension |
virtual void MetNoFimex::CDMExtractor::changeDataType | ( | std::string | variable, | |
CDMDataType | datatype | |||
) | throw (CDMException) [virtual] |
change the datatype of the variable
a change of the variable will also change the datatype of the _FillValue attribute
variable | name of the variable | |
datatype | new datatype |
CDMException | if variable doesn't exist or conversion to datatype is not supported |