Nadav Horesh wrote: > There is an unwrap function in numpy. Doesn't it work for you? > Like I had said, np.unwrap was too slow. Profiling showed it eating up an absurd proportion of time. My c++ code was much better (although still surprisingly slow).