Skip to content

Commit 632d9d7

Browse files
committed
Allow small differences in RPG header values
1 parent c0e4903 commit 632d9d7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

cloudnetpy/instruments/rpg.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ def create_one_day_data_record(rpg_objects: RpgObjects) -> dict:
121121
for key in should_be_constant:
122122
if key not in rpg_header:
123123
continue
124-
unique_values = np.unique(rpg_header[key])
125-
if len(unique_values) > 1:
126-
msg = f"More than one value for {key} found: {unique_values}"
124+
values = rpg_header[key]
125+
if not np.allclose(values[0], values[1:]):
126+
msg = f"Value for '{key}' is not constant"
127127
raise ValueError(msg)
128-
rpg_header[key] = unique_values[0]
128+
rpg_header[key] = values[0]
129129

130130
rpg_raw_data = _mask_invalid_data(rpg_raw_data)
131131
return {**rpg_header, **rpg_raw_data}

0 commit comments

Comments
 (0)