From 45db6476e7d370900eb77264d571a77fbf65c2b9 Mon Sep 17 00:00:00 2001 From: mlauer154 Date: Tue, 10 Oct 2023 17:13:43 -0500 Subject: [PATCH] Downsampling alg - replace pm inf with pm 10000 --- pymead/core/airfoil.py | 9 ++++++++- pymead/version.py | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pymead/core/airfoil.py b/pymead/core/airfoil.py index 408f9ebc..9b1ad409 100644 --- a/pymead/core/airfoil.py +++ b/pymead/core/airfoil.py @@ -903,7 +903,14 @@ def downsample(self, max_airfoil_points: int, curvature_exp: float = 2.0): new_t_concat = np.array([]) for c_idx, curve in enumerate(self.curve_list): - exp_R = np.abs(curve.R) ** (1 / curvature_exp) + temp_R = deepcopy(curve.R) + for r_idx, r in enumerate(temp_R): + if np.isinf(r) and r > 0: + temp_R[r_idx] = 10000 + elif np.isinf(r) and r < 0: + temp_R[r_idx] = -10000 + + exp_R = np.abs(temp_R) ** (1 / curvature_exp) new_t = np.zeros(exp_R.shape) for i in range(1, new_t.shape[0]): new_t[i] = new_t[i - 1] + (exp_R[i] + exp_R[i - 1]) / 2 diff --git a/pymead/version.py b/pymead/version.py index 7d2091a7..1ccfee25 100644 --- a/pymead/version.py +++ b/pymead/version.py @@ -1 +1 @@ -__version__ = "2.0.0-alpha.17" +__version__ = "2.0.0-alpha.18"