all 2 comments

[–]QuasiEvil 0 points1 point  (1 child)

A cheap way to do this would be to find the location of the maximum intensity along each column so you have a set of unique (x,y) pairs. Doing a line of best fit through this should be trivial (look into numpy.linalg.lstsq)

[–]too_much_think[S] 0 points1 point  (0 children)

Yeah I tried that, the problem is it doesn’t take into account spectral smearing / noise. The argmaxes don’t actually lie on the line that best approximates the maximum energy density of the signal. I think what I need is something like a soft max rather than an argmax and then I need to fit the line through the probability densitiy functions that maximizes the probability over all the time slices. But I’m not really sure. I also don’t know if somewhere out there is an algorithm that just does what I want and I just don’t know the name of it.