SingleSector#
- class acoular.grids.SingleSector
Bases:
SectorBase class for single sector types.
Defines the common interface for all single sector classes. This class can serve as a base for various single sector implementations. When used directly, it defines a sector that encompasses the whole grid. It includes attributes for handling border inclusion, tolerance for sector borders, and default behavior when no points are inside the sector.
Examples
Load example data and set diffrent Sectors for intergration in the sector integration example.
- include_border
If
True, grid points lying on the sector border are included in the sector. Default isTrue.
- 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, thecontainsmethod (as inRectSector.contains(),RectSector3D.contains(),CircSector.contains(), andPolySector.contains()) returns the nearest grid point if no grid points are inside the sector. Default isTrue.
- contains(pos)
Check whether the given coordinates lie within the sector’s bounds.
This method determines if each column of the input array
poscorresponds to a point that falls within the sector. For this base class, all points are considered within the sector.- Parameters:
- pos
numpy.ndarray A 2D array with shape (3, N), where N is the number of grid points. Each column represents the
x, y, zcoordinates of a grid point.
- pos
- Returns:
numpy.ndarrayofboolsA 1D array of length N, where each entry indicates whether the corresponding column in
poslies within the sector’s bounds.
Examples
>>> import numpy as np >>> import acoular as ac >>> sector = ac.Sector() >>> positions = np.array([[0, 1], [0, 0], [0, 0]]) # Two grid points >>> sector.contains(positions) array([ True, True])