From 360ec278d6a44487b543abd58a7bbee6de1f8c4b Mon Sep 17 00:00:00 2001 From: Tomas Odstrcil <32073690+odstrcilt@users.noreply.github.com> Date: Wed, 29 Nov 2023 12:00:05 -0800 Subject: [PATCH] Issue with near axis interpolation --- aurora/interp.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/aurora/interp.py b/aurora/interp.py index 6e60b325..9455b36f 100644 --- a/aurora/interp.py +++ b/aurora/interp.py @@ -109,10 +109,11 @@ def interp_quad(x, y, d, rLCFS, r): """Function 'interp' used for kinetic profiles.""" f = interp1d(x, np.log(y), kind="quadratic", assume_sorted=True, copy=False) idx = np.searchsorted(r, rLCFS) - core = np.exp(f(np.clip(r[:idx] / rLCFS, 0, x[-1]))) + core = np.exp(f(np.clip(r[:idx] / rLCFS, x[0], x[-1]))) edge = core[..., [idx - 1]] * np.exp( -np.outer(1.0 / np.asarray(d), r[idx:] - r[idx - 1]) ) + return np.concatenate([core, edge], axis=-1) @@ -122,12 +123,12 @@ def interpa_quad(x, y, rLCFS, r): f = interp1d( x, np.log(y), - bounds_error=False, kind="quadratic", assume_sorted=True, copy=False, ) - return np.exp(f(np.minimum(r / rLCFS, x[-1]))) + + return np.exp(f(np.clip(r / rLCFS, x[0], x[-1]))) def interp(x, y, rLCFS, r):