Align two tracks#

Align two tracks with different coordinate systems with a geometric affine transformation.

The function to map a track on a track is: mapOn.

Importing Tracklib#

[1]:
import matplotlib.pyplot as plt
import os
import sys

# Import the Tracklib library
import tracklib as tkl
Code running in a no shapely environment
[2]:
tkl.seed(123)

reference = tkl.generate(0.2, dt=10)

noised = tkl.noise(reference, 3, tkl.ExponentialKernel(100))
noised = tkl.noise(noised, 20, tkl.GaussianKernel(1000))
original = noised.copy()

print (reference.size(), noised.size())

plt.plot(noised['x'], noised['y'], 'r-')
plt.plot(reference['x'], reference['y'], 'b-')
plt.show()
Generated track from 05/02/2042 00:44:56 to 05/02/2042 01:44:56 [360 pts, 159.24m]
360 360
../_images/howto_MAP_MapOn_3_1.png
[3]:
tkl.mapping.mapOn(noised, reference, TP1=range(len(noised)), verbose=False)

plt.plot(reference['x'], reference['y'], 'b-')
plt.plot(noised['x'], noised['y'], 'g-')
plt.show()
../_images/howto_MAP_MapOn_4_0.png