Implement bilinear interpolation

This commit is contained in:
robin committed 2024-04-22 00:21:11 +02:00
1 parent a123071fec
commit 51fe302920
12 files changed
+192 -15

No files matched your search

+28
View File
@@ -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];
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.