diff --git a/parastell/source_mesh.py b/parastell/source_mesh.py index b9ff8d9..0d7d932 100644 --- a/parastell/source_mesh.py +++ b/parastell/source_mesh.py @@ -165,12 +165,14 @@ def toroidal_extent(self): @toroidal_extent.setter def toroidal_extent(self, angle): - if angle > 360.0: + angle = np.deg2rad(angle) + + if angle > 2 * np.pi: e = AttributeError("Toroidal extent cannot exceed 360.0 degrees.") self._logger.error(e.args[0]) raise e - if angle == 360.0 and self._num_toroidal_pts % 2 != 1: + if angle == 2 * np.pi and self._num_toroidal_pts % 2 != 1: e = AttributeError( "To ensure that tetrahedral faces are coincident at the end of " "the closed toroidal loop, the number of toroidal intervals " @@ -180,7 +182,7 @@ def toroidal_extent(self, angle): self._logger.error(e.args[0]) raise e - self._toroidal_extent = np.deg2rad(angle) + self._toroidal_extent = angle @property def logger(self):