From 15b2423d0c7fc5e776e8f6b0275b37193924e90a Mon Sep 17 00:00:00 2001 From: Walter Simson Date: Tue, 19 Dec 2023 11:57:10 -0800 Subject: [PATCH] fix num_radial --- kwave/utils/mapgen.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kwave/utils/mapgen.py b/kwave/utils/mapgen.py index ce7dbef6..629f9ed5 100644 --- a/kwave/utils/mapgen.py +++ b/kwave/utils/mapgen.py @@ -60,10 +60,8 @@ def make_spiral_circle_points(num_points: int, radius: float) -> np.ndarray: def make_concentric_circle_points(num_points: int, radius: float) -> Tuple[np.ndarray, int]: num_radial = int(np.ceil(np.sqrt(num_points / np.pi))) - try: - d_radial = radius / (num_radial - 1) - except ZeroDivisionError: - d_radial = float('inf') + + assert num_radial > 1, "The number of radial points must be greater than 1." r = np.arange(num_radial) * (radius - d_radial / 2) / (num_radial - 1)