Commit 641823c8 authored by Purves, Murray's avatar Purves, Murray
Browse files

WIP New base values interpolation

parent ff4b78bf
Pipeline #27282 failed with stages
in 6 minutes and 22 seconds
......@@ -162,6 +162,12 @@ std::vector<float> interpolateToOtherBaseValues(
const std::vector<float> &valuesToInterpolate, const bool circular,
const float missingValues)
{
// First interpolate across the existing data to ensure there are no missing
std::vector<float> initialInterpolatedValues = interpolateValues(
baseValues, valuesToInterpolate, circular, missingValues);
// TODO the rest
return std::vector<float>();
}
......
......@@ -101,3 +101,21 @@ TEST(Interpolate, FillInEnd)
EXPECT_NEAR(expectValues1[i], testValues1[i], expectValues1[i] * tolerance);
}
}
TEST(Interpolate, NewBaseValues)
{
float missingValue = -9999.f;
float tolerance = 0.0001;
std::vector<float> baseValues1{12.f, 23.f, 100.f, 100.f};
std::vector<float> newBaseValues1{10.f, 20.f, 30.f, 40.f, 50.f, 60.f};
std::vector<float> interpValues1{103.23, 200.2, missingValue, missingValue};
std::vector<float> expectValues1{103.23, 200.2, 200.2, 200.2};
std::vector<float> testValues1 =
interpolateToOtherBaseValues(baseValues1, newBaseValues1, interpValues1);
ASSERT_EQ(expectValues1.size(), testValues1.size());
for (int i = 0; i < testValues1.size(); ++i)
{
EXPECT_NEAR(expectValues1[i], testValues1[i], expectValues1[i] * tolerance);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment