Skip to content

Commit 1337ed9

Browse files
authored
FIX: Corrected instrument parameters check for sinarame H5 files. (#1766)
1 parent d98fb7a commit 1337ed9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pyart/aux_io/sinarame_h5.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,14 +348,14 @@ def read_sinarame_h5(
348348
)
349349

350350
# instrument_parameters
351-
# Check if no attributes for instrument parameters.
352-
if len(hfile["how"].attrs) == 0:
353-
instrument_parameters = None
354351
# Grab each instrument parameter and its value for the hfile object.
355-
else:
352+
try:
356353
instrument_parameters = {}
357354
for i in hfile["how"].attrs.keys():
358355
instrument_parameters[i] = hfile["how"].attrs[i]
356+
# Continue if there are no attributes for instrument parameters.
357+
except KeyError:
358+
instrument_parameters = None
359359

360360
return Radar(
361361
_time,

0 commit comments

Comments
 (0)