YAC 3.12.0
Yet Another Coupler
Loading...
Searching...
No Matches
N-Nearest-Neighbour interpolation

Table of Contents

Description

This method supports source fields that are defined on points at the grid corners, cells, or edges.

For each target point, this method searches for the "n" nearest source points. Using the weighting method selected by the user, the interpolation stencil will be generated from the identified source points.

Grid connection information is not taken into account by this interpolation method.

Source field

Options

Remark: Here distances between two points on the surface of a unit sphere are defined as the angle between two vectors that point from the center of the sphere to the two points. In the configuration file, these distances have to be provided in degree.

  • Number of source points per target point (mandatory)
  • Weighting method (default: weighted: arithmetic_average)
    • arithmetic_average

      Simple average

      Target field
      n = 1n = 4n = 9


    • distance_weighted

      Inverse distance weighting

      Target field
      n = 1n = 4n = 9


    • gauss_weighted

      Gaussian filter

      This method has an additional optional scaling parameter.
      Through empirical tests a good default value has be determined. (default: gauss_scale: YAC_INTERP_NNN_GAUSS_SCALE_DEFAULT)

      Target field
      n = 1n = 4n = 9


    • zero

      Zero weight

      Sets the weight to zero (number of source points per target has to be 1).
      This method can be useful if a weight file generated by YAC is supposed to be used by another software that does not support the Fixed value interpolation. In this case this option can be used to set target points to "0.0".

  • Maximum search distance (default: max_search_distance: 0.0)

    Valid range: 0.0 <= max_search_distance < 180.0

    A distance of 0.0 results in an unlimited search distance.

    If there are less than the specified number of source points within the maximum search distance, then the respective target point will not be interpolated by this method.

YAML example

interpolation:
- nnn:
n: 4
weighted: arithmetic_average
max_search_distance: 5.0