Skip to content

Commit

Permalink
FIX: use len(unique) to estimate unique entry (#151)
Browse files Browse the repository at this point in the history
* Addressed an issue in model.py, where having multiple distances between gates (either by manually setting the radar to have varying steps or by small float inaccuracies) causes the reading of a ODIM h5 file to crash. More info on this in issue #150.
* Update history.md
---------

Co-authored-by: Martin Paule <martin.paule@microstep-mis.com>
Co-authored-by: Kai Mühlbauer <kmuehlbauer@wradlib.org>
  • Loading branch information
3 people committed Feb 22, 2024
1 parent e7b7a39 commit fe853d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/history.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# History

## 0.4.3 (2024-02-24)

* FIX: use len(unique) to estimate unique entry for odim range ({pull}`151`) by [@martinpaule](https://github.com/martinpaule).

## 0.4.2 (2023-11-02)

* FIX: Fix handling of sweep_mode attributes ({pull}`143`) by [@mgrover1](https://github.com/mgrover1)
Expand Down
2 changes: 1 addition & 1 deletion xradar/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ def get_range_attrs(rng=None):
if rng is not None:
diff = np.diff(rng)
unique = np.unique(diff)
if unique:
if len(unique) == 1:
spacing = "true"
range_attrs["meters_between_gates"] = diff[0]
else:
Expand Down

0 comments on commit fe853d3

Please sign in to comment.