From 87858bb7924ed381e9d418e06049f07bf63fff30 Mon Sep 17 00:00:00 2001 From: HappyXiaoAnAn <97467947+HappyXiaoAnAn@users.noreply.github.com> Date: Fri, 22 Dec 2023 22:53:24 +0800 Subject: [PATCH] Update rainbow_wrl.py Raise error when range resolution changes between sweeps. --- pyart/aux_io/rainbow_wrl.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pyart/aux_io/rainbow_wrl.py b/pyart/aux_io/rainbow_wrl.py index 011adf3bd6..ba9d3eca84 100755 --- a/pyart/aux_io/rainbow_wrl.py +++ b/pyart/aux_io/rainbow_wrl.py @@ -278,6 +278,13 @@ def read_rainbow_wrl( sweep_end_ray_index["data"] = seri # range + if not single_slice: + # all sweeps have to have the same range resolution + for i in range(nslices): + slice_info = rbf["volume"]["scan"]["slice"][i] + if (slice_info['rangestep'] != common_slice_info["rangestep"]): + raise ValueError("range resolution changes between sweeps") + r_res = float(common_slice_info["rangestep"]) * 1000.0 if "start_range" in common_slice_info.keys(): start_range = float(common_slice_info["start_range"]) * 1000.0