nsrdb.utilities.interpolation.idw

idw(data, indices, distance, p=2, dist_thresh=None)[source]

Inverse Distance Weighted Spatial Interpolation.

Parameters:
  • data (np.array) – Coarse resolution NSRDB data to be interpolated. Must be for a single timestep and be flattened/raveled.

  • indices (np.ndarray) – Index array generated by a sklearn Tree query.

  • distance (np.ndarray) – Distance array generated by a sklearn Tree query.

  • p (int) – Power of the inverse distance. Default = 2.

  • dist_thresh (int | float) – Distance threshold. Neighbors with distance greater than this value are not interpolated.

Returns:

out (np.array) – Fine resolution NSRDB data that has been interpolated.