From 560284bd25a43d93e99ff952fdc659824caf863e Mon Sep 17 00:00:00 2001 From: Timothy Nunn Date: Thu, 8 Jan 2026 15:24:33 +0000 Subject: [PATCH] Ensure i_plasma_pedestal=0 profile does not have 0 elements --- process/profiles.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/process/profiles.py b/process/profiles.py index a2cf61dac8..c86714c2f7 100644 --- a/process/profiles.py +++ b/process/profiles.py @@ -301,7 +301,10 @@ def calculate_profile_y( tbeta (float): Second temperature exponent. """ if physics_variables.i_plasma_pedestal == 0: - self.profile_y = t0 * (1 - rho**2) ** alphat + # profile values of 0 cause divide by 0 errors so ensure the profile value is at least 1e-8 + # which is small enough that it won't make a difference to any calculations + self.profile_y = np.maximum(t0 * (1 - rho**2) ** alphat, 1e-8) + return if t0 < temp_plasma_pedestal_kev: logger.info(