Create a Constant Altitude Plan Position Indicator (CAPPI)

A CAPPI gives the value of a target variable (typically reflectivity in dBZ, but here also other variables such as e.g. rainfall intensity) in a defined altitude.

In order to create a CAPPI, you first have to create an instance of this class. Calling this instance with the actual polar volume data will return the CAPPI grid.

Parameters
Returns

output (`numpy.ndarray`) – float 1-d ndarray of the same length as `gridcoords` (num voxels,)

Examples

Here’s an example how a set of CAPPIs can be created from synthetic polar volume data:

```>>> import wradlib
>>> import numpy as np
>>> from osgeo import osr
>>> import matplotlib.pyplot as pl
>>> pl.interactive(True)
>>> # define elevation and azimuth angles, ranges, radar site coordinates,
>>> # projection
>>> elevs  = np.array([0.5,1.5,2.4,3.4,4.3,5.3,6.2,7.5,8.7,10,12,14,16.7,19.5])
>>> azims  = np.arange(0., 360., 1.)
>>> ranges = np.arange(0., 120000., 1000.)
>>> sitecoords = (120.255547,14.924218,500.)
>>> proj = osr.SpatialReference()
>>> _ = proj.ImportFromEPSG(32651)
>>> # create Cartesian coordinates corresponding the location of the
>>> # polar volume bins
...                                            azims, ranges, proj)  # noqa
>>> # this is the shape of our polar volume
>>> polshape = (len(elevs),len(azims),len(ranges))
>>> # now we define the coordinates for the 3-D grid (the CAPPI layers)
>>> x = np.linspace(polxyz[:,0].min(), polxyz[:,0].max(), 120)
>>> y = np.linspace(polxyz[:,1].min(), polxyz[:,1].max(), 120)
>>> z = np.arange(500.,10500.,500.)
>>> xyz = wradlib.util.gridaspoints(z, y, x)
>>> gridshape = (len(z), len(y), len(x))
>>> # create an instance of the CAPPI class and
>>> # use it to create a series of CAPPIs
>>> gridder = wradlib.vpr.CAPPI(polxyz, xyz, maxrange=ranges.max(),  # noqa
...                             minelev=elevs.min(), maxelev=elevs.max(),
 `__call__`(data, **kwargs) Interpolates the polar data to 3-dimensional Cartesian coordinates