@sh.add_function(dsp, outputs=['phases_times'])
def calculate_phases_times(phases_indices, times):
"""
Calculates cycle phases times [s].
:param phases_indices:
Indices of the cycle phases [-].
:type phases_indices: numpy.array
:param times:
Time vector [s].
:type times: numpy.array
:return:
Cycle phases times [s].
:rtype: numpy.array
"""
i = phases_indices.copy()
i[:, 1] -= 1
return np.diff(times[i], axis=1).ravel()