Acoular 22.3 documentation

RectGrid

«  Grid   ::   grids   ::   RectGrid3D  »

RectGrid

class acoular.grids.RectGrid

Bases: acoular.grids.Grid

Provides a cartesian 2D grid for the beamforming results.

The grid has square or nearly square cells and is on a plane perpendicular to the z-axis. It is defined by lower and upper x- and y-limits and the z co-ordinate.

x_min = Float(-1.0, …

The lower x-limit that defines the grid, defaults to -1.

x_max = Float(1.0, …

The upper x-limit that defines the grid, defaults to 1.

y_min = Float(-1.0, …

The lower y-limit that defines the grid, defaults to -1.

y_max = Float(1.0, …

The upper y-limit that defines the grid, defaults to 1.

z = Float(1.0, …

The z co-ordinate that defines the grid, defaults to 1.

increment = Float(0.1, …

The cell side length for the grid, defaults to 0.1.

nxsteps = Property( …

Number of grid points along x-axis, readonly.

nysteps = Property( …

Number of grid points along y-axis, readonly.

index(x, y)

Queries the indices for a grid point near a certain co-ordinate.

This can be used to query results or co-ordinates at/near a certain co-ordinate.

Parameters
x, yfloat

The co-ordinates for which the indices are queried.

Returns
2-tuple of integers

The indices that give the grid point nearest to the given x, y co-ordinates from an array with the same shape as the grid.

indices(*r)

Queries the indices for a subdomain in the grid.

Allows either rectangular, circular or polygonial subdomains. This can be used to mask or to query results from a certain sector or subdomain.

Parameters
x1, y1, x2, y2, …float

If three parameters are given, then a circular sector is assumed that is given by its center (x1, y1) and the radius x2. If four paramters are given, then a rectangular sector is assumed that is given by two corners (x1, y1) and (x2, y2). If more parameters are given, the subdomain is assumed to have polygonial shape with corners at (x_n, y_n).

Returns
2-tuple of arrays of integers or of numpy slice objects

The indices that can be used to mask/select the grid subdomain from an array with the same shape as the grid.

extend()

The extension of the grid in pylab.imshow compatible form.

Returns
4-tuple of floats

The extent of the grid as a tuple of x_min, x_max, y_min, y_max)

«  Grid   ::   grids   ::   RectGrid3D  »