@sh.add_function(dsp, outputs=['phases_indices'])
def identify_phases_indices(times, phases_integration_times):
"""
Identifies the indices of the cycle phases [-].
If phases_distances is not given the result is the cumulative CO2 of cycle
phases [CO2g] otherwise it is CO2 emission of cycle phases [CO2g/km].
:param times:
Time vector [s].
:type times: numpy.array
:param phases_integration_times:
Cycle phases integration times [s].
:type phases_integration_times: tuple
:return:
Indices of the cycle phases [-].
:rtype: numpy.array
"""
return np.searchsorted(times, phases_integration_times, side='right')