def traj_diff(t1, t2):
"""Compute trajectory difference.
Parameters
----------
t1, t2 : DataFrame
Trajectories.
Returns
-------
diff : DataFrame
Trajectory difference. It can be interpreted as errors in `t1` relative
to `t2`.
"""
diff = t1 - t2
diff['lat'] *= np.deg2rad(earth.R0)
diff['lon'] *= np.deg2rad(earth.R0) * np.cos(0.5 *
np.deg2rad(t1.lat + t2.lat))
diff['h'] %= 360
diff.h[diff.h < -180] += 360
diff.h[diff.h > 180] -= 360
return diff.loc[t1.index.intersection(t2.index)]
评论列表
文章目录