Module for downsampling accross a path in multi-dimensional space.
Let a d-dimensional parametric curve in of the form:
x_1 = x_1(t) x_2 = x_2(t) … x_d = x_d(t)
sampled at N time steps, t_1, t_2, …, t_N. It is possible to select a subset of the time steps - essentially defining a downsampled version of the curve - so that the original curve can be reconstructed with minimum error.
The provided class TrackDownsampler performs the downsampling. It requires two input arrays. The first is the “independent” variable, t, which does not have to be temporal (e.g., spatial), but must be strictly increasing. The 2nd array is the track, in which the different columns correspond to the different dimensions:
— parameters —>
x_1(t_1) x_2(t_1) … x_d(t_1)
- time x_1(t_2) x_2(t_2) … x_d(t_2)
or . . … . any . . … .
. . … .V x_1(t_N) x_2(t_N) … x_d(t_N)
TD = TrackDownsample(t, X) t_new, X_new = TD.downsample(max_err=0.001)
- class posydon.grids.downsampling.TrackDownsampler(independent, dependent, verbose=False)[source]
Bases:
object
Class performing downsampling of multi-dimensional paths.
Get, reduce and rescale data.
- downsample(max_err=None, scale_back=True, max_interval=None)[source]
Perform the downsampling and return the result.