RectSector3D#

class acoular.grids.RectSector3D

Bases: RectSector

Class for defining a cuboid sector.

This class extends the RectSector class to define a cuboid sector, which can be used for 3D grids. The cuboid sector is defined by its bounds along the x, y, and z axes.

Examples

Load example data and set diffrent Sectors for intergration in the sector integration example.

z_min

The lower z position of the cuboid. Default is -1.0.

z_max

The upper z position of the cuboid. Default is 1.0.

contains(pos)

Check if the coordinates in a given array lie within the cuboid sector.

The method checks if the points in the provided position array are within the cuboid defined by the bounds along the x, y, and z axes. If no point is inside the sector, and if default_nearest is True, the nearest point to the center of the cuboid is returned.

Parameters:
posarray of floats

A (3, N) array containing the positions of N grid points, where each point is represented by its x, y, and z coordinates.

Returns:
numpy.ndarray of bools

A boolean array of shape shape (N,) indicating which of the given positions lie within the cuboid sector. True if the grid point is inside the cuboid, otherwise False.

Examples

>>> import acoular as ac
>>> grid = ac.RectGrid3D(increment=2)
>>> sec = ac.RectSector3D(x_min=0, y_min=0, z_min=0)
>>> sec.contains(grid.pos)
array([False, False, False, False, False, False, False,  True])
x_min

The minimum x position of the rectangle. Default is -1.0.

x_max

The maximum x position of the rectangle. Default is 1.0.

y_min

The minimum y position of the rectangle. Default is -1.0.

y_max

The maximum y position of the rectangle. Default is 1.0.

include_border

If True, grid points lying on the sector border are included in the sector. Default is True.

abs_tol

The absolute tolerance to apply when determining if a grid point lies on the sector border. Default is 1e-12.

default_nearest

If True, the contains method (as in RectSector.contains(), RectSector3D.contains(), CircSector.contains(), and PolySector.contains()) returns the nearest grid point if no grid points are inside the sector. Default is True.