Acoular 25.04 documentation

LineGrid

«  ImportGrid   ::   grids   ::   MergeGrid  »

LineGrid

class acoular.grids.LineGrid

Bases: Grid

Define a 3D grid for a line geometry.

The LineGrid class represents a grid where points are arranged linearly in 3D space. The grid is defined by a starting location (loc), a direction vector (direction), a total length (length), and the number of points (num_points) along the line.

Notes

  • The distance between points is length / ( num_points - 1).

  • The direction vector is normalized to ensure consistency.

Examples

Create a line grid with 5 points along the x-axis, starting at (0, 0, 0), with a length of 4 meters:

>>> import acoular as ac
>>> grid = ac.LineGrid()
>>> grid.loc = (0.0, 0.0, 0.0)
>>> grid.direction = (1.0, 0.0, 0.0)
>>> grid.length = 4
>>> grid.num_points = 5
>>> grid.pos
array([[0., 1., 2., 3., 4.],
       [0., 0., 0., 0., 0.],
       [0., 0., 0., 0., 0.]])
loc = Tuple((0.0, 0.0, 0.0))

Starting point of the grid in 3D space. Default is (0.0, 0.0, 0.0).

direction = Tuple((1.0, 0.0, 0.0), desc='Line orientation ')

A vector defining the orientation of the line in 3D space. Default is (1.0, 0.0, 0.0).

length = Float(1, desc='length of the line source')

Total length of the line. Default is 1.0.

num_points = Int(1, desc='length of the line source')

Number of grid points along the line. Default is 1.

size = Property(desc='overall number of grid points')

The total number of grid points. Automatically updated when other grid-defining attributes are set. (read-only)

pos = Property(desc='x, y, z positions of grid points')

A (3, size) array containing the x, y, and z positions of the grid points. (read-only)

digest = Property(

A unique identifier for the grid, based on its properties. (read-only)

«  ImportGrid   ::   grids   ::   MergeGrid  »