public void EvaluateCoordinateForCornerCases() { var grid = new RegularGridCoverage(2, 2, 5.0, 5.0); grid.SetValues(new[] { 12.34 }); Assert.AreEqual(12.34, grid.Evaluate(new Coordinate(0.0, 0.0))); Assert.AreEqual(12.34, grid.Evaluate(new Coordinate(10.0, 0.0))); Assert.AreEqual(12.34, grid.Evaluate(new Coordinate(0.0, 10.0))); Assert.AreEqual(12.34, grid.Evaluate(new Coordinate(10.0, 10.0))); }
public void EvaluateTimeDependent() { var grid = new RegularGridCoverage(2, 2, 1, 1) { IsTimeDependent = true }; var values = new[, ] { { 1.0, 2.0 }, { 3.0, 4.0 } }; grid[new DateTime(2000, 1, 1)] = values; grid[new DateTime(2000, 1, 3)] = values; // evaluate value, interpolated in time and space (default interpolation is piecewise constant) var value = grid.Evaluate(new Coordinate(0.5, 0.5), new DateTime(2000, 1, 2)); value .Should("evaluate time-dependent regular grid coverage value").Be.EqualTo(1.0); }
public void EvaluateCoordinateForCornerCases() { var grid = new RegularGridCoverage(2, 2, 5.0, 5.0); grid.SetValues(new[]{12.34}); Assert.AreEqual(12.34, grid.Evaluate(new Coordinate(0.0, 0.0))); Assert.AreEqual(12.34, grid.Evaluate(new Coordinate(10.0, 0.0))); Assert.AreEqual(12.34, grid.Evaluate(new Coordinate(0.0, 10.0))); Assert.AreEqual(12.34, grid.Evaluate(new Coordinate(10.0, 10.0))); }
public void EvaluateTimeDependent() { var grid = new RegularGridCoverage(2, 2, 1, 1) { IsTimeDependent = true }; var values = new[,] { {1.0, 2.0}, {3.0, 4.0} }; grid[new DateTime(2000, 1, 1)] = values; grid[new DateTime(2000, 1, 3)] = values; // evaluate value, interpolated in time and space (default interpolation is piecewise constant) var value = grid.Evaluate(new Coordinate(0.5, 0.5), new DateTime(2000, 1, 2)); value .Should("evaluate time-dependent regular grid coverage value").Be.EqualTo(1.0); }