xradar.util.apply_to_sweeps#
- xradar.util.apply_to_sweeps(dtree, func, *args, **kwargs)[source]#
Applies a given function to all sweep nodes in the radar volume.
- Parameters:
dtree (
xarray.DataTree) – The DataTree object representing the radar volume.func (
function) – The function to apply to each sweep.*args (
tuple) – Additional positional arguments to pass to the function.**kwargs (
dict) – Additional keyword arguments to pass to the function. Theinheritkey, if present, is popped and forwarded toxarray.DataTree.to_dataset()instead of func. Accepted values (see xarray docs for details):Trueor"indexes": inherit only indexed coordinates."all_coords": inherit all coordinates, including non-index coordinates.False: only include coordinates defined at the sweep node.
Defaults to
"all_coords"for backward compatibility.
- Returns:
xarray.DataTree– A new DataTree object with the function applied to all sweeps.