File tree Expand file tree Collapse file tree
src/spikeinterface/preprocessing Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313from spikeinterface .core .core_tools import SIJsonEncoder
1414from spikeinterface .core .job_tools import _shared_job_kwargs_doc
1515
16+
1617motion_options_preset = {
1718 # dredge
1819 "dredge" : {
@@ -277,10 +278,11 @@ def correct_motion(
277278
278279 This function depends on several modular components of :py:mod:`spikeinterface.sortingcomponents`.
279280
280- If select_kwargs is None then all peak are used for localized.
281+ If ` select_kwargs` is None then all peak are used for localized.
281282
282283 The recording must be preprocessed (filter and denoised at least), and we recommend to not use whithening before motion
283284 estimation.
285+ Since the motion interpolation requires a "float" recording, the recording is casted to float32 if necessary.
284286
285287 Parameters for each step are handled as separate dictionaries.
286288 For more information please check the documentation of the following functions:
@@ -435,6 +437,8 @@ def correct_motion(
435437 t1 = time .perf_counter ()
436438 run_times ["estimate_motion" ] = t1 - t0
437439
440+ if recording .get_dtype ().kind != "f" :
441+ recording = recording .astype ("float32" )
438442 recording_corrected = InterpolateMotionRecording (recording , motion , ** interpolate_motion_kwargs )
439443
440444 motion_info = dict (
You can’t perform that action at this time.
0 commit comments