Interpolation¶
interpolation ¶
interpolate ¶
interpolate(
trajectory: Trajectory,
index: list | ndarray,
method: InterpolationMethod = LINEAR,
inplace: bool = True,
max_gap_size: float = float("inf"),
) -> Trajectory
Interpolates a trajectory to specified timestamps using the given method.
Parameters:
-
trajectory(Trajectory) –Trajectory to interpolate
-
index(list | ndarray) –Interpolation index
-
method(InterpolationMethod, default:LINEAR) –Interpolation method. Defaults to InterpolationMethod.LINEAR.
-
inplace(bool, default:True) –Perform in-place interpolation. Defaults to True.
-
max_gap_size(float, default:float('inf')) –Maximum gap in the index over which to interpolate. Defaults to infinity.
Returns:
-
Trajectory(Trajectory) –Interpolated trajectory
Source code in trajectopy\processing\interpolation.py
inside_gaps ¶
Returns which values of an index lie inside gaps of the observations that are larger than max_gap_size.
Such values are not interpolated. Values at the edges of a gap are, since the observations on both sides of an edge are available.
Parameters:
-
index(ndarray) –Index values to interpolate at.
-
observed_index(ndarray) –Ascending index of the observations.
-
max_gap_size(float) –Maximum gap in the observed index over which to interpolate.
Returns:
-
ndarray–np.ndarray: Boolean mask, True for values of index that lie strictly inside a gap.