From 83ea2523410da6762b5e09843760477e694d339d Mon Sep 17 00:00:00 2001 From: YigitElma Date: Wed, 14 Aug 2024 00:35:16 -0400 Subject: [PATCH] use given iota for normalization scales --- desc/objectives/normalization.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/desc/objectives/normalization.py b/desc/objectives/normalization.py index 255eb346f4..2fafba628e 100644 --- a/desc/objectives/normalization.py +++ b/desc/objectives/normalization.py @@ -41,7 +41,10 @@ def get_lowest_mode(basis, coeffs): scales["A"] = np.pi * scales["a"] ** 2 scales["V"] = 2 * np.pi * scales["R0"] * scales["A"] scales["B_T"] = abs(thing.Psi) / scales["A"] - iota_avg = np.mean(np.abs(thing.get_profile("iota")(np.linspace(0, 1, 20)))) + if thing.iota is not None: + iota_avg = np.mean(np.abs(thing.iota(np.linspace(0, 1, 20)))) + else: + iota_avg = np.mean(np.abs(thing.get_profile("iota")(np.linspace(0, 1, 20)))) if np.isclose(iota_avg, 0): scales["B_P"] = scales["B_T"] else: