phygnn.utilities.tf_utilities.idw_fill

idw_fill(x, low_mem=True)[source]

IDW fill for tensors with channel dimension. Assumes input shape is (n_obs, spatial_1, spatial_2, n_features) or (n_obs, spatial_1, spatial_2, n_temporal, n_features).

Parameters:
  • x (tf.Tensor) – Tensor with NaNs and shape (n_obs, spatial_1, spatial_2, n_features) or (n_obs, spatial_1, spatial_2, n_temporal, n_features)

  • low_mem (bool) – If True, use a low memory implementation that loops over time and channel dimensions. This is slower but uses less memory.

Returns:

  • x_filled (tf.Tensor) – Tensor with NaNs filled

  • mask (tf.Tensor) – Mask of the input tensor where 1 is not NaN and 0 is NaN.