From b54157f7e98243e914a586abae003278118492a2 Mon Sep 17 00:00:00 2001 From: Zach Sherman Date: Wed, 20 Mar 2024 14:31:34 -0500 Subject: [PATCH] ENH: Add instrument parameter check for sinarame. (#1532) * ENH: Add check fro instrument parameters. * FIX: Add dict definition. --- pyart/aux_io/sinarame_h5.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pyart/aux_io/sinarame_h5.py b/pyart/aux_io/sinarame_h5.py index 83884abe7a..4088293e96 100644 --- a/pyart/aux_io/sinarame_h5.py +++ b/pyart/aux_io/sinarame_h5.py @@ -348,7 +348,14 @@ def read_sinarame_h5( ) # instrument_parameters - instrument_parameters = None + # Check if no attributes for instrument parameters. + if len(hfile["how"].attrs) == 0: + instrument_parameters = None + # Grab each instrument parameter and its value for the hfile object. + else: + instrument_parameters = {} + for i in hfile["how"].attrs.keys(): + instrument_parameters[i] = hfile["how"].attrs[i] return Radar( _time,