diff --git a/pyart/map/gates_to_grid.py b/pyart/map/gates_to_grid.py index 93d72c4fc7..79e77f3422 100644 --- a/pyart/map/gates_to_grid.py +++ b/pyart/map/gates_to_grid.py @@ -72,6 +72,9 @@ def map_gates_to_grid( if isinstance(radars, Radar): radars = (radars, ) + if len(radars) == 0: + raise ValueError('Length of radars tuple cannot be zero') + skip_transform = False if len(radars) == 1 and grid_origin_alt is None and grid_origin is None: skip_transform = True diff --git a/pyart/map/grid_mapper.py b/pyart/map/grid_mapper.py index 1903681e53..191b8f6da4 100644 --- a/pyart/map/grid_mapper.py +++ b/pyart/map/grid_mapper.py @@ -77,6 +77,9 @@ def grid_from_radars(radars, grid_shape, grid_limits, if isinstance(radars, Radar): radars = (radars, ) + if len(radars) == 0: + raise ValueError('Length of radars tuple cannot be zero') + # map the radar(s) to a cartesian grid if gridding_algo == 'map_to_grid': grids = map_to_grid(radars, grid_shape, grid_limits, **kwargs) @@ -396,6 +399,9 @@ def map_to_grid(radars, grid_shape, grid_limits, grid_origin=None, # make a tuple if passed a radar object as the first argument if isinstance(radars, Radar): radars = (radars, ) + + if len(radars) == 0: + raise ValueError('Length of radars tuple cannot be zero') skip_transform = False if len(radars) == 1 and grid_origin_alt is None and grid_origin is None: