wradlib.util.cross_section_ppi#
- wradlib.util.cross_section_ppi(obj, azimuth, **kwargs)[source]#
Cut a cross-section from PPI volume scans
Added in version 1.18.
This function extracts cross-sections from a PPI volume scan along one or more azimuth angles, or along a line connecting two given points. Similar to PyArt’s cross_section_ppi function.
- Parameters:
obj (
xarray.Dataset
- Dataset containing PPI sweeps) – from which azimuthal cross-sections will be extracted.azimuth (
int
,float
,slice
,tuple
orlist
) – Value of azimuth to extract the cross-section. It can be multiple values in the form of a slice, or a tuple or list of values. Alternatively, it can be given a tuple or list containing coordinates of two arbitrary points in the x,y space of the georeferenced object: [ (x1, y1), (x2,y2) ]. In case two points are given, a cross-section along the line connecting the points will be generated by selecting the nearest-neighbor values of data. No interpolation of data is performed. If more than two points are given, only the first two are used. The resulting dataset has dimensions xyi (which is just an index along the line connecting the points) and elevation, and coordinates xy (distance along the line from p1) and z. The xy and z coordinates should be used for plotting.
- Keyword Arguments:
method (
{None, "nearest", "pad", "ffill", "backfill", "bfill"}
, optional) – Method for inexact matches for selecting azimuth values, fromxarray:xarray.Dataset.sel
. Defaults to None (only exact matches).tolerance (
float
, optional) – Maximum distance between original and new labels for inexact matches fromxarray:xarray.Dataset.sel
.bw (
float
, optional) – Beam width in degrees (defaults to None). Option meant for plotting beams with their true beamwidth instead of filling the empty space by stretching the beams (because of how matplotlib pcolormesh works). Defaults to None, which returns a Dataset of cross-sections in the specified azimuth(s). If set to a certain beamwidth, it will return the same Dataset with additional “fake” empty beams (extra elevations) so that when plotting with matplotlib pcolormesh the beamwidths are correctly represented according to their width.crs (
osgeo.osr.SpatialReference
,cartopy.crs.CRS
, optional) – Projection to use withwradlib.georef.xarray.georeference
. If GDAL OSR SRS, output is in this projection, defaults to AEQD.npl (
int
, optional) – Number of points to make up the line between p1 and p2, in case the user gives two arbitrary points instead of an azimuth value. npl should be high enough to accomodate more points along the line that points of data available (i.e., higher that the resolution of the data). The default value 1000 should be enough for most cases, but in case the result looks low resolution try increasing npl.
- Returns:
obj (
xarray.Dataset
orxarray.DataArray
) – Dataset of cross-section(s) in the specified azimuth(s) or along the line connecting the given points.