flasc.utilities.utilities.interp_with_max_gap

flasc.utilities.utilities.interp_with_max_gap#

flasc.utilities.utilities.interp_with_max_gap(x, xp, fp, max_gap, kind, wrap_around_360=False)[source]#

Interpolate data linearly or using nearest-neighbor with maximum gap.

If there is larger gap in data than max_gap, the gap will be filled with np.nan.

Parameters:
  • x (np.array) -- The output x-data; the data points in x-axis that you want the interpolation results from.

  • xp (np.array) -- The input x-data.

  • fp (np.array) -- The input y-data.

  • max_gap (float) -- The maximum allowable distance between x and xp for which interpolation is still performed. Gaps larger than this will be filled with np.nan in the output target_y.

  • kind (str) -- The interpolation method to use. Can be 'linear' or 'nearest'.

  • wrap_around_360 (bool) -- If True, the interpolation will be done in a circular fashion, i.e., the interpolation will wrap around 360 degrees.

Returns:

The interpolation results.

Return type:

np.array