Skip to content

Commit faca0e5

Browse files
committed
Update docstring on 'calculate_displacement_unit_factor.
1 parent e996dee commit faca0e5

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/spikeinterface/generation/drifting_generator.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,14 +253,18 @@ def calculate_displacement_unit_factor(
253253
non_rigid_gradient: float, unit_locations: np.array, drift_start_um: np.array, drift_stop_um: np.array
254254
) -> np.array:
255255
"""
256-
In the case of introducing non-rigid drift, a set of scaling
257-
factors (one per unit) is generated for scaling the displacement
258-
as a function of unit position.
256+
Introduces a non-rigid drift across the probe, this is a linear
257+
scaling of the displacement based on the unit position.
258+
259+
To introduce non-rigid drift, a set of scaling factors (one per unit)
260+
are generated. These scale the displacement applied to each unit
261+
as a function of unit position. The smaller the `non_rigid_gradient`,
262+
the larger the influence of the unit position is on scaling the
263+
displacement (more non-linearity).
259264
260265
The projections of the gradient vector (x, y)
261266
and unit locations (x, y) are normalised to range between
262267
0 and 1 (i.e. based on relative location to the gradient).
263-
These factors are scaled by `non_rigid_gradient`.
264268
265269
Parameters
266270
----------
@@ -270,6 +274,7 @@ def calculate_displacement_unit_factor(
270274
that are based on unit location. This sets the weighting given to the factors
271275
based on unit locations. When 1, the factors will all equal 1 (no effect),
272276
when 0, the scaling factor based on unit location will be used directly.
277+
Smaller number results in more nonlinearity.
273278
unit_locations : np.array
274279
The unit location with shape (num_units, 2)
275280
drift_start_um : np.array
@@ -293,6 +298,7 @@ def calculate_displacement_unit_factor(
293298
factors = 1 - factors
294299

295300
f = np.abs(non_rigid_gradient)
301+
print("f", f)
296302
displacement_unit_factor = factors * (1 - f) + f
297303

298304
return displacement_unit_factor

0 commit comments

Comments
 (0)