MI - Fimex
Public Member Functions | Protected Member Functions | List of all members
MetNoFimex::VerticalTransformation Class Referenceabstract

#include <fimex/coordSys/verticalTransform/VerticalTransformation.h>

Inheritance diagram for MetNoFimex::VerticalTransformation:
MetNoFimex::AtmosphereSigma MetNoFimex::Height MetNoFimex::HybridSigmaPressure1 MetNoFimex::HybridSigmaPressure2 MetNoFimex::LnPressure MetNoFimex::OceanSG1 MetNoFimex::Pressure MetNoFimex::OceanSG2

Public Member Functions

virtual ~VerticalTransformation ()
 
virtual std::string getName () const =0
 the indentifier of the vertical transformation More...
 
virtual std::string getParameterString () const =0
 list the parameters More...
 
virtual int getPreferredVerticalType () const =0
 the most natural vertical type, one of the MIFI_VINT_* in fimex/mifi_constants.h More...
 
virtual bool isComplete () const =0
 
virtual boost::shared_ptr< ToVLevelConvertergetConverter (const boost::shared_ptr< CDMReader > &reader, int verticalType, size_t unLimDimPos, boost::shared_ptr< const CoordinateSystem > cs, size_t nx, size_t ny, size_t nz, size_t nt) const
 
boost::shared_ptr< ToVLevelConvertergetConverter (const boost::shared_ptr< CDMReader > &reader, int verticalType, size_t unLimDimPos, boost::shared_ptr< const CoordinateSystem > cs) const
 same as getConverter, but determines nx, nz, nt using MetNoFimex::getSimpleAxes from CDMUtils More...
 

Protected Member Functions

virtual boost::shared_ptr< ToVLevelConvertergetPressureConverter (const boost::shared_ptr< CDMReader > &reader, size_t unLimDimPos, boost::shared_ptr< const CoordinateSystem > cs, size_t nx, size_t ny, size_t nt) const =0
 
virtual boost::shared_ptr< ToVLevelConvertergetAltitudeConverter (const boost::shared_ptr< CDMReader > &reader, size_t unLimDimPos, boost::shared_ptr< const CoordinateSystem > cs, size_t nx, size_t ny, size_t nz, size_t nt) const
 
virtual boost::shared_ptr< ToVLevelConvertergetHeightConverter (const boost::shared_ptr< CDMReader > &reader, size_t unLimDimPos, boost::shared_ptr< const CoordinateSystem > cs, size_t nx, size_t ny, size_t nz, size_t nt) const
 

Detailed Description

Base class for vertical transformations like AtmosphereSigma coordinate or OceanSG1 coordinate, and for completeness also Pressure and Height. Vertical-transformation are usually accessed by CoordinateSystem::getVerticalTransformation:

string varName = "air_temperature";
vector<boost::shared_ptr<const CoordinateSystem> >::iterator varSysIt =
find_if(coordSys.begin(), coordSys.end(), CompleteCoordinateSystemForComparator(varName));
if (varSysIt != coordSys.end()) {
if ((*varSysIt)->hasVerticalTransformation()) {
boost::shared_ptr<const VerticalTransformation> vtran = (*varSysIt)->getVerticalTransformation();
if (vtran->getName() == HybridSigmaPressure1::NAME()) {
const HybridSigmaPressure1* hyb1 = dynamic_cast<const HybridSigmaPressure1*>(vtran.get());
assert(hyb1 != 0);
string apVar = hyb1->ap;
string bVar = hyb1->b;
string psVar = hyb1->ps
...
}
}
}

The qualified names of the VerticalTransformation classes can be found in the respectiv classes inheriting from VerticalTransformation, found in fimex/coordSys/verticalTransform/ *.h . The member-names of the sub-classes describe the parametrization of the VerticalTransformation, and their values reflect the variable-names.

Constructor & Destructor Documentation

virtual MetNoFimex::VerticalTransformation::~VerticalTransformation ( )
inlinevirtual

Member Function Documentation

virtual boost::shared_ptr<ToVLevelConverter> MetNoFimex::VerticalTransformation::getAltitudeConverter ( const boost::shared_ptr< CDMReader > &  reader,
size_t  unLimDimPos,
boost::shared_ptr< const CoordinateSystem cs,
size_t  nx,
size_t  ny,
size_t  nz,
size_t  nt 
) const
protectedvirtual

Default implementation: Convert to altitude (height above MSL) with pressure(-converter) and standard atmosphere.

Parameters
reader
unLimDimPos
cs
nx
ny
nz
nt
Returns

Reimplemented in MetNoFimex::OceanSG1, and MetNoFimex::Height.

Referenced by ~VerticalTransformation().

virtual boost::shared_ptr<ToVLevelConverter> MetNoFimex::VerticalTransformation::getConverter ( const boost::shared_ptr< CDMReader > &  reader,
int  verticalType,
size_t  unLimDimPos,
boost::shared_ptr< const CoordinateSystem cs,
size_t  nx,
size_t  ny,
size_t  nz,
size_t  nt 
) const
virtual

get a converter. Pressure will be in unit hPa, height/depth in unit m.

Parameters
readera reader to fetch the data from
verticalTypeone of the MIFI_VINT_* in fimex/mifi_constants.h
unLimDimPosthe unlimited position to start at
csthe coordinate system one is interested in
nxx-size of the resulting data
nyy-size of the resulting data
nzz-size of the resulting data
ntThe final t-size will be nt-unLimDimPos.
Returns

Referenced by ~VerticalTransformation().

boost::shared_ptr<ToVLevelConverter> MetNoFimex::VerticalTransformation::getConverter ( const boost::shared_ptr< CDMReader > &  reader,
int  verticalType,
size_t  unLimDimPos,
boost::shared_ptr< const CoordinateSystem cs 
) const

same as getConverter, but determines nx, nz, nt using MetNoFimex::getSimpleAxes from CDMUtils

virtual boost::shared_ptr<ToVLevelConverter> MetNoFimex::VerticalTransformation::getHeightConverter ( const boost::shared_ptr< CDMReader > &  reader,
size_t  unLimDimPos,
boost::shared_ptr< const CoordinateSystem cs,
size_t  nx,
size_t  ny,
size_t  nz,
size_t  nt 
) const
protectedvirtual

Default implementation: Convert to height above ground with pressure(-converter) and standard atmosphere.

Parameters
reader
unLimDimPos
cs
nx
ny
nz
nt
Returns

Reimplemented in MetNoFimex::Height.

Referenced by ~VerticalTransformation().

virtual std::string MetNoFimex::VerticalTransformation::getName ( ) const
pure virtual
virtual std::string MetNoFimex::VerticalTransformation::getParameterString ( ) const
pure virtual
virtual int MetNoFimex::VerticalTransformation::getPreferredVerticalType ( ) const
pure virtual
virtual boost::shared_ptr<ToVLevelConverter> MetNoFimex::VerticalTransformation::getPressureConverter ( const boost::shared_ptr< CDMReader > &  reader,
size_t  unLimDimPos,
boost::shared_ptr< const CoordinateSystem cs,
size_t  nx,
size_t  ny,
size_t  nt 
) const
protectedpure virtual
virtual bool MetNoFimex::VerticalTransformation::isComplete ( ) const
pure virtual

Indicate if all parameters are given to fully describe the transformation.

Even a fully described transformation does not guarantee that a converter exists (e.g. height -> altitude requires in addition topography).

And converters might exist, even if a transformation is not complete.

Implemented in MetNoFimex::OceanSG1, MetNoFimex::HybridSigmaPressure1, MetNoFimex::HybridSigmaPressure2, MetNoFimex::AtmosphereSigma, MetNoFimex::LnPressure, MetNoFimex::Pressure, and MetNoFimex::Height.

Referenced by ~VerticalTransformation().


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