diff --git a/include/gridpp.h b/include/gridpp.h index d19b7435..9b20b6ac 100644 --- a/include/gridpp.h +++ b/include/gridpp.h @@ -11,7 +11,7 @@ #endif #include -#define GRIDPP_VERSION "0.5.0a2" +#define GRIDPP_VERSION "0.5.0" #define __version__ GRIDPP_VERSION namespace gridpp { @@ -354,8 +354,6 @@ namespace gridpp { float calc_score(const vec& ref, const vec& fcst, float threshold, Metric metric); float calc_score(const vec& ref, const vec& fcst, float threshold, float fthreshold, Metric metric); - void advection_implicit(const vec2& y_dist, const vec2& x_dist, float dt, ivec2& y_coord, ivec2& x_coord); - vec2 correction(const Grid& rgrid, const vec2& rvalues, const Points& npoints, const vec& nvalues, float mean_radius, float outer_radius, float inner_radius, int min_num, int max_num, CorrectionType type, ivec2& count); // Apply correction based on multiple timesteps vec2 correction(const Grid& rgrid, const vec3& rvalues, const Points& npoints, const vec2& nvalues, const vec2& apply_values, float mean_radius, float outer_radius, float inner_radius, int min_num, int max_num, CorrectionType type, ivec2& count); diff --git a/src/api/advection.cpp b/src/api/advection.cpp deleted file mode 100644 index dd34537a..00000000 --- a/src/api/advection.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "gridpp.h" -#include - -using namespace gridpp; - -void gridpp::advection_implicit(const vec2& y_dist, const vec2& x_dist, float dt, ivec2& y_coord, ivec2& x_coord) { - int Y = y_dist.size(); - int X = y_dist[0].size(); - y_coord.clear(); - x_coord.clear(); - y_coord.resize(Y); - x_coord.resize(Y); - for(int y = 0; y < Y; y++) { - y_coord[y].resize(X); - x_coord[y].resize(X); - for(int x = 0; x < X; x++) { - y_coord[y][x] = gridpp::MV; - x_coord[y][x] = gridpp::MV; - } - } - for(int y = 0; y < Y; y++) { - for(int x = 0; x < X; x++) { - int l = int(y + dt * y_dist[y][x]); - int k = int(x + dt * x_dist[y][x]); - if(k >= 0 && k < X && l >= 0 && l < Y) { - y_coord[l][k] = y; - x_coord[l][k] = x; - } - } - } -} diff --git a/tests/advection_test.py b/tests/advection_test.py deleted file mode 100644 index 8d873b30..00000000 --- a/tests/advection_test.py +++ /dev/null @@ -1,19 +0,0 @@ -from __future__ import print_function -import unittest -import gridpp -import numpy as np - - -class AdvectionTest(unittest.TestCase): - def test_1(self): - Y = 3 - X = 3 - y_dist = np.ones([Y, X]) - for x in range(3): - y_dist[:, x] = x - x_dist = np.zeros([Y, X]) - y, x = gridpp.advection_implicit(y_dist, x_dist, 1) - - -if __name__ == '__main__': - unittest.main()