 # Acoular 20.02 documentation

## RectGrid

«  Grid   ::   grids   ::   RectGrid3D  »

# RectGrid¶

class acoular.grids.RectGrid

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, desc="minimum x-value")

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

x_max = Float(1.0, desc="maximum x-value")

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

y_min = Float(-1.0, desc="minimum y-value")

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

y_max = Float(1.0, desc="maximum y-value")

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

z = Float(1.0, desc="position on z-axis")

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

increment = Float(0.1, desc="step size")

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

nxsteps = Property( desc="number of grid points along x-axis")

Number of grid points along x-axis, readonly.

nysteps = Property( desc="number of grid points along y-axis")

Number of grid points along y-axis, readonly.

index(self, 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(self, x1, y1, x2, y2=None)

Queries the indices for a subdomain in the grid.

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

Parameters
x1, x2, y1, y2float

If all four parameters are given, then a rectangular sector is assumed that is given by two corners (x1, y1) and (x2, y2). If only three parameters are given, then a circular sector is assumed that is given by its center (x1, y1) and the radius x2.

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(self)

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  »