Implement bilinear interpolation
This commit is contained in:
1 parent
a123071fec
commit
51fe302920
12 files changed
+192
-15
No files matched your search
@@ -0,0 +1,28 @@
|
||||
#include <mdspan>
|
||||
#include <ranges>
|
||||
|
||||
#include "UVGrid.h"
|
||||
#include "readdata.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
UVGrid::UVGrid() {
|
||||
auto [us, sizeU] = readHydrodynamicU();
|
||||
auto [vs, sizeV] = readHydrodynamicV();
|
||||
// Assuming sizeU == sizeV
|
||||
uvData = views::zip(us, vs) | ranges::to<vector>();
|
||||
uvMatrix = mdspan(uvData.data(), sizeU);
|
||||
tie(times, lats, lons) = readGrid();
|
||||
}
|
||||
|
||||
double UVGrid::lonStep() const {
|
||||
return lons[1] - lons[0];
|
||||
}
|
||||
|
||||
double UVGrid::latStep() const {
|
||||
return lats[1]-lats[0];
|
||||
}
|
||||
|
||||
int UVGrid::timeStep() const {
|
||||
return times[1]-times[0];
|
||||
}
|
||||