Skip to content

phase_jump_detection_2D

PhaseJumpDetection2D

Bases: RotorDetection

Implements PhaseJump phase mapping algorithm based on doi: 10.1109/TBME.2016.2554660

Attributes:

Name Type Description
LOOPS dict

Dictionary of the loop types (single_2x2, single_4x4, double_4x4, 'triple_6x6'). Different locations on a loop must be formatted clockwise and seperated by 1 integer. Different loops must be seperated by 2 integers.

LOOPS = {'single_2x2': np.array([[1, 2], [4, 3]]), 'single_4x4': np.array([[1, 2, 3, 4], [12, 0, 0, 5], [11, 0, 0, 6], [10, 9, 8, 7]]), 'double_4x4': np.array([[0, 6, 7, 0], [13, 1, 2, 8], [12, 4, 3, 9], [0, 11, 10, 0]]), 'triple_6x6': np.array([[0, 15, 16, 17, 18, 0], [30, 0, 6, 7, 0, 19], [29, 13, 1, 2, 8, 20], [28, 12, 4, 3, 9, 21], [27, 0, 11, 10, 0, 22], [0, 26, 25, 24, 23, 0]])} class-attribute instance-attribute

all_loops = False instance-attribute

loop = self.LOOPS[self.loop_type] instance-attribute

loop_type = 'double_4x4' instance-attribute

monotonic = False instance-attribute

phase_threshold = 1.5 * np.pi instance-attribute

__init__(phase_maps)

calc_inner_mesh_indices(loop_radius)

Calculate the indices of the mesh inside the original mesh with a border of size=loop_radius removed.

Parameters:

Name Type Description Default
loop_radius int

Radius of the largest loop.

required

Returns:

Name Type Description
tuple tuple[ndarray, ...]

Indices of the inner mesh inside the original mesh without the border of size=loop_radius.

calc_loop_props()

Calculate loop properties of a specific loop type.

Returns:

Name Type Description
loop_properties dict

Dictionary of the loop properties.

calc_loop_separation()

Calcuate the separation of the different loops.

Returns:

Name Type Description
loop_separation list

The pairs of start and end indices of each loop.

calc_phase_jumps()

Calculate phase jumps defined as loops containing an odd number of positive or negative phase jumps.

Returns:

Type Description
ndarray

np.ndarray[n_loops, T, N, M]: Phasejump array containing + or -1 for positive/negative

ndarray

rotations and 0 for no rotations.

detect()

Calculate (x_index, y_index) of rotor centers.

Returns:

Type Description
DataFrame

pd.DataFrame: Dataframe with columns ['t_ind', 'x_ind', 'y_ind', 'direction'].

set_all_loops(all_loops=True)

Specifies if all loops must detect a phase singularity (True) or one loop minimally (False). Default: False

set_loop(loop_type)

Set loop type to be used by algorithm Default: 'double_4x4'

set_monotonic(monotonic=True)

Specifies if monotonicity of phases along rings is desired. Default: False

set_phase_threshold(phase_threshold)

Number in interval [-pi, pi] that phase differences must be exceeded to be classified as phase jump. Default: 1.5 * pi