get_beamwise_interpolation

HSTB.kluster.xarray_helpers.get_beamwise_interpolation(pingtime, additional, interp_this)

Given ping time and beamwise time addition (delay), return a 2d interpolated version of the provided 1d Dataarray.

We want this to be efficient, so first we stack and get the unique times to interpolate. Retain the index of where these unique times go in the original array

Then reform the array, populating the indices with the interpolated values. Should be faster than brute force interpolating all of the data, especially since we expect a lot of duplication (delay values are the same within a sector)

Parameters
  • pingtime (DataArray) – 1dim array of timestamps representing time of ping

  • additional (DataArray) – 2dim (time/beam) array of timestamps representing additional delay

  • interp_this (DataArray) – 1dim DataArray (time) that we want to interpolate to pingtime + additional

Returns

2dim array, the interpolated array at pingtime + additional

Return type

xr.DataArray