Class for adaptiv Piv

The sub class for the iterative part of the piv process is called Adaptive Piv.

class piv.adaptive_piv.AdaptivePIV(piv_object, window_size, search_size, distance, deformation='forward', ipmethod='bilinear')[source]

Class for the adaptive piv.

After the initial piv is done an adaptive piv can be performed to minimize the error or to make the grid finer. Therefore the correlation function is inherited as well as the GridSpec. In addition to the inherited grid a new Grid is calculated by deforming the grid with respect to the prior calculated velocities. In the case that the new grid is supposed to be finer then the one before, the velocities need to be upscaled.

Initialization as an extension of the super class.

The initialization of the super class is called to generate all necessary GridSpecs and grids. Additional information are the deformation method and the interpolation method.

Parameters:

piv_object : Direct/AdaptivePIV

object of the initial piv

window_size : int

size of the interrogation window

search_size : int

size of the search window

distance : int

distance between beginning of the first interrogation window and second

deformation : str

deformation method

ipmethod : str

interpolation method

In order to perform the deformation and needed interpolation a new method is introduced.

AdaptivePIV._deform_grid(deformation_method, ipmethod)[source]

Deforms the regular grid according to velocity and interpolates image.

In order to capture more particles flowing in the same direction as indicated by the previously calculated velocity field, the grid is deformed and the image corresponding to that grid spot interpolated from the original image. This gives a new grid with interpolated particle spots. Here two methods are available:

  • central:
    Leeds to a half deformation in both directions, forward and backwards. This as well leads to two times the computation of the deformation.
  • forward:
    Leeds to a full deformation in forward direction
Parameters:

deformation_method : str

deformation method, mentioned above

ipmethod : str

interpolation method passed along to the interpolator

For inclusion of these two different deformation methods into the correlation, the function getting the sub images has to be overridden.

AdaptivePIV._get_window_frames(i, j)[source]

Function override in order to include the two different deformation methods.

Functionality is the same as

DirectPIV._get_window_frames(i, j)

Return sub images of image attribute a and b at position i,j.

Parameters:
  • i (int) – first index of grid coordinates
  • j (int) – second index of grid coordinates
Returns:

sub frame as interrogation and search window for correlation

but in this function, before the window in handed over the deformation is performed for that grid point.