SNOWPACK 3.7.0
DataResampler Class Reference

Detailed Description

Resample data. The data (double) is given as a x-vector xVec and y-Vector yVec. The new sampling can be defined by an interval dx or by an arbitrary x-vector xVecGoal. Two methods are implemented one for point data and one for range data. For point data the new values are interpolated and extrapolated. For range data the new range-values are averaged over the old ranges. The size of a range (=thickness of a layer) is defined by the difference: xVec[i+1]-xVec[i] and for the last range: xMax-xVec[i] Assumptions:

  • xVec[i] < xVec[i+1]
  • xVecGoal[i] < xVecGoal[i+1]

Additional assumptions for the range data:

  • xVec[0] >= 0
  • xVecGoal[0] >= 0
  • the last value of xVec and xVecGoal has to be smaller (not equal!) than xMax

Examples: Point-data example with rotation: Input: xVec:{10, 50, 184} yVec:{273.15, 263.15, 253.15} xVecGoal:{0, 84} xMax=184 Rotation result: xVec:{0, 134, 174} yVec:{253.15, 263.15, 273.15} Final (resampled) result: xVec:{0,84} yVec:{253.15, 259.42}

Range-data example with rotation: Input: xVec:{0, 10, 50} yVec:{300,400,400} xVecGoal:{0,84} xMax=184 Rotation result: xVec:{0, 134, 174} yVec:{400,400,300} Final (resampled) result: xVec:{0,84} yVec:{400,390}

Author
Thiemo Theile
Date
2018

Public Member Functions

 DataResampler (const std::vector< double > &xVecIn, const std::vector< double > &yVecIn, const double dxIn, const double xMaxIn, const bool isRangeMeasurement, const bool changeDirectionIn)
 
 DataResampler (const std::vector< double > &xVecIn, const std::vector< double > &yVecIn, const std::vector< double > &xVecGoalIn, const double xMaxIn, const bool isRangeMeasurement, const bool changeDirectionIn)
 
std::vector< double > getResampledXVec ()
 
std::vector< double > getResampledYVec ()
 
void printProfile (const std::string message)
 
bool resample ()
 

Constructor & Destructor Documentation

◆ DataResampler() [1/2]

DataResampler::DataResampler ( const std::vector< double > &  xVecIn,
const std::vector< double > &  yVecIn,
const double  dxIn,
const double  xMaxIn,
const bool  isRangeMeasurement,
const bool  changeDirectionIn 
)

◆ DataResampler() [2/2]

DataResampler::DataResampler ( const std::vector< double > &  xVecIn,
const std::vector< double > &  yVecIn,
const std::vector< double > &  xVecGoalIn,
const double  xMaxIn,
const bool  isRangeMeasurement,
const bool  changeDirectionIn 
)

Member Function Documentation

◆ getResampledXVec()

std::vector< double > DataResampler::getResampledXVec ( )

◆ getResampledYVec()

std::vector< double > DataResampler::getResampledYVec ( )

◆ printProfile()

void DataResampler::printProfile ( const std::string  message = "profile:")

◆ resample()

bool DataResampler::resample ( )

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