From 056af208daf1505ed3a1f26415e7ac774a3662df Mon Sep 17 00:00:00 2001 From: kpentland Date: Wed, 8 Oct 2025 09:26:33 +0100 Subject: [PATCH] fixing multiple typos in squareness calculation --- freegs4e/equilibrium.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/freegs4e/equilibrium.py b/freegs4e/equilibrium.py index c0cfea5..3a91ec2 100644 --- a/freegs4e/equilibrium.py +++ b/freegs4e/equilibrium.py @@ -1523,9 +1523,9 @@ def squareness(self): ui_ellipse = sh.Polygon( ellipse_points( R0=self._sep_RZmax, - Z0=self._sep_ZRmax, + Z0=self._sep_ZRmin, A=self._sep_RZmax - self._sep_Rmin, - B=self._sep_Zmax - self._sep_ZRmax, + B=self._sep_Zmax - self._sep_ZRmin, ) ) lo_ellipse = sh.Polygon( @@ -1539,9 +1539,9 @@ def squareness(self): li_ellipse = sh.Polygon( ellipse_points( R0=self._sep_RZmin, - Z0=self._sep_ZRmax, + Z0=self._sep_ZRmin, A=self._sep_RZmin - self._sep_Rmin, - B=self._sep_ZRmax - self._sep_Zmin, + B=self._sep_ZRmin - self._sep_Zmin, ) ) @@ -1554,7 +1554,7 @@ def squareness(self): ) ui_diag = sh.LineString( [ - [self._sep_RZmax, self._sep_ZRmax], + [self._sep_RZmax, self._sep_ZRmin], [self._sep_Rmin, self._sep_Zmax], ] ) @@ -1566,21 +1566,21 @@ def squareness(self): ) li_diag = sh.LineString( [ - [self._sep_RZmin, self._sep_ZRmax], + [self._sep_RZmin, self._sep_ZRmin], [self._sep_Rmin, self._sep_Zmin], ] ) # find intersecting line lengths uo_diag_core = uo_diag.intersection(plasma_boundary).length - ui_diag_core = uo_diag.intersection(plasma_boundary).length - lo_diag_core = uo_diag.intersection(plasma_boundary).length - li_diag_core = uo_diag.intersection(plasma_boundary).length + ui_diag_core = ui_diag.intersection(plasma_boundary).length + lo_diag_core = lo_diag.intersection(plasma_boundary).length + li_diag_core = li_diag.intersection(plasma_boundary).length uo_diag_ellipse = uo_diag.intersection(uo_ellipse).length - ui_diag_ellipse = uo_diag.intersection(ui_ellipse).length - lo_diag_ellipse = uo_diag.intersection(lo_ellipse).length - li_diag_ellipse = uo_diag.intersection(li_ellipse).length + ui_diag_ellipse = ui_diag.intersection(ui_ellipse).length + lo_diag_ellipse = lo_diag.intersection(lo_ellipse).length + li_diag_ellipse = li_diag.intersection(li_ellipse).length # calculate squarenesses s_uo = (uo_diag_core - uo_diag_ellipse) / (