ahwillia / affinewarp

An implementation of piecewise linear time warping for multi-dimensional time series alignment
MIT License
162 stars 36 forks source link

Aligning on event median #19

Open ClaraBesserer opened 2 years ago

ClaraBesserer commented 2 years ago

Hello, I'm trying to apply warping to my data, following the 'rat motor cortex' tutorial. I noticed that it always align to the max isi (for tap2 in the exemple). It is not ideal if my event distribution is polluted by some abnormaly long isi. Is it possible to align on the isi mean or median?

Figure 2021-12-15 095931

Here is how it looks like on my data : I don't think it makes sense to align on the max isi, especially for the 'align on both taps' column.

Thanks in advance! Clara

ahwillia commented 2 years ago

Yes its possible, but you'll have to work out the math. See the docstring for manual_fit. It may be as easy as replacing tmax in the example notebook with whatever median or mean that you'd like to use as the anchor.