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