pyart.retrieve.grid_displacement_pc#

pyart.retrieve.grid_displacement_pc(grid1, grid2, field, level, return_value='pixels')[source]#

Calculate the grid displacement using phase correlation.

See: http://en.wikipedia.org/wiki/Phase_correlation

Implementation inspired by Christoph Gohlke: http://www.lfd.uci.edu/~gohlke/code/imreg.py.html

Note that the grid must have the same dimensions in x and y and assumed to have constant spacing in these dimensions.

Parameters:
  • grid1, grid2 (Grid) – Py-ART Grid objects separated in time and square in x/y.

  • field (string) – Field to calculate advection from. Field must be in both grid1 and grid2.

  • level (integer) – The vertical (z) level of the grid to use in the calculation.

  • return_value (str, optional) – ‘pixels’, ‘distance’ or ‘velocity’. Distance in pixels (default) or meters or velocity vector in m/s.

Returns:

displacement (two-tuple) – Calculated displacement in units of y and x. Value returned in integers if pixels, otherwise floats.