From d58b6871c7bf37414c2a348b8796bf2625cde460 Mon Sep 17 00:00:00 2001 From: Max Grover Date: Thu, 2 Nov 2023 08:14:27 -0500 Subject: [PATCH] FIX: Fix setting scan_mode when scan_name is empty (#1484) * FIX: Fix python version used in CI system * FIX: Fix incorrect arg in ci workflow * DEL: Remove pinning of libnetcdf * FIX: Fix when sweep_name is an empty attribute * FIX: Add more robust check --- pyart/io/cfradial.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pyart/io/cfradial.py b/pyart/io/cfradial.py index 1ecb7d09dc..d3c908d9ed 100644 --- a/pyart/io/cfradial.py +++ b/pyart/io/cfradial.py @@ -192,8 +192,12 @@ def read_cfradial( ray_angle_res = None # Uses ARM scan name if present. - if hasattr(ncobj, "scan_name"): - mode = ncobj.scan_name + if not hasattr(ncobj, "scan_name"): + scan_name = "" + else: + scan_name = ncobj.scan_name + if len(scan_name) > 0: + mode = scan_name else: # first sweep mode determines scan_type try: