CosineHalfSpreading#

class waveresponse.CosineHalfSpreading(s=1, degrees=False)[source]#

Cosine-2s type spreading (half directional range).

Defined as:

D(theta) = scale * C(s) * cos(theta) ** (2 * s) , for -pi/2 <= theta <= pi/2

D(theta) = 0 , otherwise

where,

C(s) = 2 ** (2 * s + 1) * gamma(s + 1) ** 2 / gamma(2 * s + 1)

If theta is given in ‘radians’:

scale = 1.0 / (2.0 * np.pi)

If theta is given in ‘degrees’:

scale = 1 / 360.0

Note that this spreading is independent of frequency.

Parameters:
  • s (int) – Spreading coefficient.

  • degrees (bool) – If directions passed to the spreading function will be given in ‘degrees’. If False, ‘radians’ is assumed.

Notes

The spreading function is implemented according to reference [1].

References

discrete_directions(n, direction_offset=0.0)[source]#

Split the spreading function into discrete direction bins with “equal energy”, i.e. equal area under the curve. The direcitons representing the bins are chosen to have equal area under the curve on each side within the bin.

Parameters:
  • n (int) – Number of discrete directions.

  • direction_offset (float, default) – A offset to add to the discrete directions. Units should be according to the degrees flag given during initialization.

Returns:

A sequence of direction representing “equal energy” bins with range wrapped to [0, 360) degrees or [0, 2 * pi) radians according to the degrees flag given during initialization.

Return type:

ndarray