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 = Float(-1.0, desc='minimum z position of the cuboid')¶
The lower z position of the cuboid. Default is
-1.0
.
- z_max = Float(1.0, desc='maximum z position of the cuboid')¶
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
isTrue
, 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.
- posarray of
- Returns:
numpy.ndarray
ofbools
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, otherwiseFalse
.
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])