Created
January 9, 2024 19:14
-
-
Save joaofig/9cfc2c61e610433d0a3cf8d3c7f17575 to your computer and use it in GitHub Desktop.
The compound trajectory constructor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CompoundTrajectory: | |
def __init__(self, trajectory: Trajectory, | |
map_lat: np.ndarray, | |
map_lon: np.ndarray): | |
self.segments: list[Trajectory] = [] | |
t0 = 0 | |
merged = merge_trajectory(trajectory, map_lat, map_lon) | |
for i, segment in enumerate(merged): | |
dt = trajectory.dt[i] | |
tr = segment_to_trajectory(segment, dt, t0) | |
self.segments.append(tr) | |
t0 = tr.time[-1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment