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

#include <fimex/CDMProcessor.h>

Inheritance diagram for MetNoFimex::CDMProcessor:
MetNoFimex::CDMReader

Public Member Functions

 CDMProcessor (boost::shared_ptr< CDMReader > dataReader)
 
virtual ~CDMProcessor ()
 
void addVerticalVelocity ()
 
void accumulate (const std::string &varName)
 
void deAccumulate (const std::string &varName)
 
void rotateVectorToLatLon (bool toLatLon, const std::vector< std::string > &varNameX, const std::vector< std::string > &varNameY, const std::vector< std::string > &stdNameX=std::vector< std::string >(0), const std::vector< std::string > &stdNameY=std::vector< std::string >(0))
 
void rotateAllVectorsToLatLon (bool toLatLon)
 
void rotateDirectionToLatLon (bool toLatLon, const std::vector< std::string > &varNames)
 
virtual DataPtr getDataSlice (const std::string &varName, size_t unLimDimPos)
 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 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

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

Detailed Description

The CDMProcessor is a class for various smaller data-manipulations. Examples are deaccumulation along the time-axis, ...

Constructor & Destructor Documentation

MetNoFimex::CDMProcessor::CDMProcessor ( boost::shared_ptr< CDMReader dataReader)
virtual MetNoFimex::CDMProcessor::~CDMProcessor ( )
virtual

Member Function Documentation

void MetNoFimex::CDMProcessor::accumulate ( const std::string varName)

mark a variable for accumulation along the unlimited dimension, i.e. vnew(0) = vold(0) vnew(n) = vold(n)+vold(n-1)

Parameters
varNamename of the variable to de-accumulate
Warning
does not handle fill-values unless those are NaNs
void MetNoFimex::CDMProcessor::addVerticalVelocity ( )

add vertical velocity to this CDM, using continuity equation on model-levels

void MetNoFimex::CDMProcessor::deAccumulate ( const std::string varName)

mark a variable for de-accumulation along the unlimited dimension, i.e. vnew(n) = vold(n)-vold(n-1)

Parameters
varNamename of the variable to de-accumulate
Warning
does not handle fill-values unless those are NaNs
virtual DataPtr MetNoFimex::CDMProcessor::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.

void MetNoFimex::CDMProcessor::rotateAllVectorsToLatLon ( bool  toLatLon)

rotate all the vectors from direction in x/y axes to direction in lat/lon axes vectors are detected automatically

Parameters
toLatLonconvert to latLon if true, otherwise, convert latLon to grid-axes
void MetNoFimex::CDMProcessor::rotateDirectionToLatLon ( bool  toLatLon,
const std::vector< std::string > &  varNames 
)

rotate the direction given in degree from y axes to direction in lat axes (north)

Parameters
toLatLonconvert to latLon if true, otherwise, convert latLon to grid-axes
varNamesthe variable-names containing directions given as angles in degree
void MetNoFimex::CDMProcessor::rotateVectorToLatLon ( bool  toLatLon,
const std::vector< std::string > &  varNameX,
const std::vector< std::string > &  varNameY,
const std::vector< std::string > &  stdNameX = std::vectorstd::string >(0),
const std::vector< std::string > &  stdNameY = std::vectorstd::string >(0) 
)

rotate the vector from direction in x/y axes to direction in lat/lon axes

Parameters
toLatLonconvert to latLon if true, otherwise, convert latLon to grid-axes
varNameXthe x-part of the vector
varNameYthe y-part of the vector
stdNameXoptional new standard_name for x
stdNameYoptional new standard_name for y

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