convnwb.timestamps.align.fit_sync_alignment

convnwb.timestamps.align.fit_sync_alignment(sync_behav, sync_neural, score_thresh=0.9999, ignore_poor_alignment=False, return_model=False, verbose=False)[source]

Fit a model to align synchronization pulses from different recording systems.

Parameters:
sync_behav1d array

Sync pulse times from behavioral computer.

sync_neural1d array

Sync pulse times from neural computer.

score_threshfloat, optional, default: 0.9999

R^2 threshold value to check that the fit model is better than.

ignore_poor_alignmentbool, optional, default: False

Whether to ignore a bad alignment score.

return_modelbool, optional, default: False

Whether to return the model object. If False, returns

verbosebool, optional, default: False

Whether to print out model information.

Returns:
modelLinearRegression

The fit model object. Only returned if return_model is True.

model_interceptfloat

Intercept of the model predicting differences between sync pulses. Returned if return_model is False.

model_coeffloat

Learned coefficient of the model predicting differences between sync pulses. Returned if return_model is False.

scorefloat

R^2 score of the model, indicating how good a fit there is between sync pulses.