Skip to content

Commit

Permalink
Downsampling alg - replace pm inf with pm 10000
Browse files Browse the repository at this point in the history
  • Loading branch information
mlauer154 committed Oct 10, 2023
1 parent 4269274 commit 45db647
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion pymead/core/airfoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pymead/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.0.0-alpha.17"
__version__ = "2.0.0-alpha.18"

0 comments on commit 45db647

Please sign in to comment.