diff --git a/process/models/physics/plasma_profiles.py b/process/models/physics/plasma_profiles.py index 1bec9c6397..5ea2da2fb5 100644 --- a/process/models/physics/plasma_profiles.py +++ b/process/models/physics/plasma_profiles.py @@ -319,23 +319,17 @@ def calculate_profile_factors(self): PlasmaProfileShapeType(self.data.physics.i_plasma_pedestal) == PlasmaProfileShapeType.PEDESTAL_PROFILE ): - # Pedestal pressure is the profile value where gradient is maximum - # (i.e the smallest negative value) + # Pedestal pressure is taken at the lower of the temperature and + # density normalised pedestal radii rho = self.neprofile.profile_x - pres_profile = self.data.physics.pres_plasma_thermal_total_profile - dpres_drho = np.gradient(pres_profile, rho) - # Find rho index closest to the normalized pedestal positions - pedestal_rho = np.min([ + pedestal_rho = min( self.data.physics.radius_plasma_pedestal_temp_norm, self.data.physics.radius_plasma_pedestal_density_norm, - ]) + ) closest_idx = np.argmin(np.abs(rho - pedestal_rho)) - mask = np.zeros_like(rho, dtype=bool) - mask[closest_idx:] = True - dpres_drho_pedestal = dpres_drho[mask] - max_grad_idx_pedestal = np.argmax(dpres_drho_pedestal) - max_grad_idx = np.where(mask)[0][max_grad_idx_pedestal] - self.data.physics.pres_plasma_pedestal_thermal = pres_profile[max_grad_idx] + self.data.physics.pres_plasma_pedestal_thermal = ( + self.data.physics.pres_plasma_thermal_total_profile[closest_idx] + ) self.data.physics.pres_plasma_separatrix_thermal = ( self.data.physics.pres_plasma_thermal_total_profile[-1]