signal_design.axis

Module Contents

Classes

Axis

The representation of some array axis.

Functions

_check_size(→ None)

class signal_design.axis.Axis(size: int, sample: signal_design.help_types.RealNumber = 1, start: signal_design.help_types.RealNumber = 0, end: Optional[signal_design.help_types.RealNumber] = None)[source]

The representation of some array axis.

This is the axis description. The axis describes the size, sample spacing between elements, start and end.

Raises:
  • TypeError – Raise this exception if type of size is not int.

  • ValueError – Raise this exception if size less then 1.

Parameters:
  • size (int) – is size of axis

  • sample (RealNumber) – is sample of axis.

  • start (RealNumber) – is start of axis.

  • end (RealNumber) – is end of axis.

property size: int
property sample: signal_design.help_types.RealNumber
property start: signal_design.help_types.RealNumber
property end: signal_design.help_types.RealNumber
property array: numpy.ndarray

Representation of array axis into numpy.ndarray

Returns:

numpy array of axis

Return type:

numpy.ndarray

get_array() numpy.ndarray[source]

Create array of numpy from Axis, using, start, end and sample of Axis.

Parameters:

self (Axis) – instance of Axis

Returns:

numpy array of axis.

Return type:

numpy.ndarray

copy() Axis[source]

Copy of axis.

Returns:

copy of axis

Return type:

Axis

static get_common_axis(axis1: Axis, axis2: Axis, is_correct_end=False) Axis[source]

Specifies the overall axis.

Finds the general sample rate and beginning and end of sequence. A method by which to find the common sequence of numbers along the axis, obtained from two other sequences along the axis.

Parameters:
  • axis1 (Axis) – first axis.

  • axis2 (Axis) – second axis.

Returns:

return common Axis.

Return type:

Axis

static get_using_end(start: signal_design.help_types.RealNumber, end: signal_design.help_types.RealNumber, sample: signal_design.help_types.RealNumber = 1.0, is_correct_end: bool = True) Axis[source]

Create instance of Axis using start, end and sample params of axis.

Parameters:
  • start (RealNumber) – start position of axis.

  • end (RealNumber) – end position of axis.

  • sample (RealNumber) – sample of axis.

  • is_correct_end (bool) – Default to True. Checking the correctness of the end of the axis. If value is False, no end will be set for the instance.

Returns:

new instance of Axis.

Return type:

Axis

static get_from_array(x: signal_design.help_types.ArrayLike, sample: Optional[signal_design.help_types.RealNumber] = None) Axis[source]

Create instance of Axis from some array of numbers.

Parameters:
  • x (ArrayLike) – input array of numbers.

  • sample (RealNumber, optional) – sample of axis for array. Default is None.

Returns:

new instance of Axis.

Return type:

Axis

_reset_property() None[source]
__str__()[source]

Return str(self).

__eq__(other: Axis)[source]

Return self==value.

__ne__(other: Axis)[source]

Return self!=value.

signal_design.axis._check_size(size: int) None[source]