Skip to content

Commit

Permalink
FIX datatree reader now works with sweeps containing different variab…
Browse files Browse the repository at this point in the history
…les (#252)

* FIX datatree reader now works with sweeps containing different variables
* Update xradar/io/backends/common.py
  • Loading branch information
egouden authored Dec 10, 2024
1 parent 0ea8d58 commit 830d86b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion xradar/io/backends/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ def _get_required_root_dataset(ls_ds, optional=True):
remove_root ^= set(optional_root_vars)
remove_root ^= {"sweep_number", "fixed_angle"}
remove_root &= data_var
root = [sweep.drop_vars(remove_root) for sweep in ls_ds]
# ignore errors for variables which exist in one sweep but not the other
root = [sweep.drop_vars(remove_root, errors="ignore") for sweep in ls_ds]
root_vars = {x for xs in [sweep.variables.keys() for sweep in root] for x in xs}
# rename variables
# todo: find a more easy method not iterating over all variables
Expand Down

0 comments on commit 830d86b

Please sign in to comment.