@sh.add_function(dsp, outputs=['phases_distances'])
def calculate_phases_distances(phases_indices, distances):
"""
Calculates cycle phases distances [km].
:param phases_indices:
Indices of the cycle phases [-].
:type phases_indices: numpy.array
:param distances:
Cumulative distance vector [m].
:type distances: numpy.array
:return:
Cycle phases distances [km].
:rtype: numpy.array
"""
i = phases_indices.copy()
i[:, 1] -= 1
return np.diff(distances[i], axis=1).ravel() / 1000.0