radarx.grid.ugrid.to_uxarray#
- radarx.grid.ugrid.to_uxarray(obj, variables=None)[source]#
Convert a radar sweep into a uxarray dataset with one face per gate.
- Parameters:
obj (
xarray.Datasetorxarray.DataArray) – PPI sweep onazimuthandrangedimensions; seegate_corners().variables (
strorlistofstr, optional) – Variables to attach to the faces. By default all data variables on the(azimuth, range)dimensions.
- Returns:
uxarray.UxDataset– Dataset on then_facedimension with a UGRID grid (.uxgrid). Faces are ordered by azimuth, then range;azimuthandrangeof each face are kept as coordinates.- Raises:
ImportError – If uxarray is not installed.
ValueError – If
objis not a PPI sweep or lacks the radar site location.
Notes
Dask. This function computes the dask array: uxarray builds its grid and variables in memory. The input is loaded into memory and the result is held in memory.
Examples
>>> sweep = dtree["sweep_0"].to_dataset(inherit="all_coords") >>> uxds = sweep.radarx.to_uxarray(["DBZH"]) >>> uxds["DBZH"].plot() # gate polygons