We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c0e4903 commit 632d9d7Copy full SHA for 632d9d7
1 file changed
cloudnetpy/instruments/rpg.py
@@ -121,11 +121,11 @@ def create_one_day_data_record(rpg_objects: RpgObjects) -> dict:
121
for key in should_be_constant:
122
if key not in rpg_header:
123
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}"
+ values = rpg_header[key]
+ if not np.allclose(values[0], values[1:]):
+ msg = f"Value for '{key}' is not constant"
127
raise ValueError(msg)
128
- rpg_header[key] = unique_values[0]
+ rpg_header[key] = values[0]
129
130
rpg_raw_data = _mask_invalid_data(rpg_raw_data)
131
return {**rpg_header, **rpg_raw_data}
0 commit comments