diff --git a/src/spikeinterface/generation/drifting_generator.py b/src/spikeinterface/generation/drifting_generator.py index b439c57c52..d355b1b3fb 100644 --- a/src/spikeinterface/generation/drifting_generator.py +++ b/src/spikeinterface/generation/drifting_generator.py @@ -141,8 +141,15 @@ def make_one_displacement_vector( else: displacement_vector[ind0:ind1] = -0.5 + elif drift_mode == "slope": + + slope = np.linspace(0, 1, end_drift_index - start_drift_index) # TODO: check amplitude + + displacement_vector[start_drift_index:end_drift_index] = slope + displacement_vector[end_drift_index:] = slope[-1] + else: - raise ValueError("drift_mode must be 'zigzag' or 'bump'") + raise ValueError("drift_mode must be 'zigzag', 'bump' or 'slope'") return displacement_vector * amplitude_factor