MI - Fimex
|
#include <fimex/CDMReaderWriter.h>
Public Member Functions | |
CDMReaderWriter () | |
virtual | ~CDMReaderWriter () |
virtual void | sync ()=0 |
flush data to disc More... | |
virtual void | putDataSlice (const std::string &varName, size_t unLimDimPos, const DataPtr data)=0 |
data-writing function More... | |
virtual void | putDataSlice (const std::string &varName, const SliceBuilder &sb, const DataPtr data)=0 |
data-writing function for general slices More... | |
virtual void | putScaledDataSlice (const std::string &varName, size_t unLimDimPos, const DataPtr data) |
unscale and write a dataslice More... | |
virtual void | putScaledDataSliceInUnit (const std::string &varName, const std::string &unit, size_t unLimDimPos, const DataPtr data) |
unscale and write a dataslice from a known unit More... | |
virtual void | putScaledDataSlice (const std::string &varName, const SliceBuilder &sb, const DataPtr data) |
unscale and write a dataslice More... | |
virtual void | putScaledDataSliceInUnit (const std::string &varName, const std::string &dataUnit, const SliceBuilder &sb, const DataPtr data) |
unscale and write a dataslice from a known unit More... | |
![]() | |
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 | getDataSlice (const std::string &varName, size_t unLimDimPos)=0 |
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... | |
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 | |
![]() | |
virtual DataPtr | getDataSliceFromMemory (const CDMVariable &variable, size_t unLimDimPos=0) |
void | getScaleAndOffsetOf (const std::string &varName, double &scale, double &offset) const |
![]() | |
boost::shared_ptr< CDM > | cdm_ |
The CDMReaderWriter is an interface allowing to write data to an opened CDMReader.
MetNoFimex::CDMReaderWriter::CDMReaderWriter | ( | ) |
|
virtual |
|
pure virtual |
data-writing function
This methods needs to be implemented by the CDMReaderWriter. It will write back the data to a variable at unLimPos, without any changes (except eventually required change of datatypes).
This function will write 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 |
data | Data to be written to unLimDimPos |
CDMException | on errors related to the CDM in combination with the underlying data-structure. It might also throw other (IO-)exceptions. |
Implemented in MetNoFimex::NetCDF_CDMReader.
|
pure virtual |
data-writing function for general slices
varName | name of the variable to read |
sb | a SliceBuilder generated from this CDMReaders CDM |
data | Data to be written at the slicePositions |
CDMException | on errors related to the CDM in combination with the underlying data-structure. It might also throw other (IO-)exceptions. |
Implemented in MetNoFimex::NetCDF_CDMReader.
|
virtual |
unscale and write a dataslice
This un-scales (back to the in-file scaling) and writes a data slice; the inverse of getScaledDataSlice.
varName | name of the variable to write |
unLimDimPos | (optional) if the variable contains a unlimited dimension (max one allowed) a slice of this position is written |
data | the data slice to write |
CDMException | on errors related to the CDM in combination with the underlying data-structure. It might also throw other (IO-)exceptions. |
|
virtual |
unscale and write a dataslice
varName | name of the variable to read |
sb | SliceBuilder to restrict the data |
data | the data slice to write |
CDMException | on errors related to the CDM in combination with the underlying data-structure. It might also throw other (IO-)exceptions. |
|
virtual |
unscale and write a dataslice from a known unit
This un-scales (back to the in-file scaling and unit) and writes a data slice; the inverse of getScaledDataSliceInUnit. The data must be in unit 'unit'.
varName | name of the variable to read |
unit | unit-string, the unit of the data passed in 'data' |
unLimDimPos | (optional) if the variable contains a unlimited dimension (max one allowed) a slice of this position is written |
data | the data slice to write, must be in unit 'unit' |
CDMException | on errors related to the CDM in combination with the underlying data-structure. It might also throw other (IO-)exceptions. |
|
virtual |
unscale and write a dataslice from a known unit
varName | name of the variable to read |
dataUnit | unit-string, the unit of the data passed in 'data' |
sb | SliceBuilder to restrict the data |
data | the data slice to write, must be in unit 'unit' |
CDMException | on errors related to the CDM in combination with the underlying data-structure. It might also throw other (IO-)exceptions. |
|
pure virtual |
flush data to disc
Implemented in MetNoFimex::NetCDF_CDMReader.