API reference

This is a complete api reference to the openpiv python module.

The openpiv.tools module

The openpiv.tools module is a collection of utilities and tools often used.

imread(filename) Read an image file into a numpy array
save(x, y, u, v, filename[, fmt, delimiter]) Save flow field to an ascii file.
display(message) Display a message to standard output.

The openpiv.pyprocess module

This module contains a pure python implementation of the cross-correlation algorithm for PIV image processing. It also contains some useful helper functions.

normalize_intensity(window) Remove mean value from window and masks negative, dark pixels
correlate_windows(window_a, window_b[, ...]) Compute correlation function between two interrogation windows.
get_coordinates(image_size, window_size, overlap) Compute the x, y coordinates of the centers of the interrogation windows.
get_field_shape(image_size, window_size, overlap) Compute the shape of the resulting flow field.
moving_window_array(array, window_size, overlap) This is a nice numpy trick.
find_first_peak(corr) Find row and column indices of the first correlation peak.
find_second_peak(corr[, i, j]) Find the value of the second largest peak
find_pixel_peak_position(corr[, ...]) Find pixel approximation of the correlation peak.
find_subpixel_peak_position(corr, peak_indices) Find subpixel approximation of the correlation peak.
piv(frame_a, frame_b[, window_size, ...]) Basic python implementation of the PIV cross-correlation

The openpiv.process module

A cython module for fast advanced algorithms for PIV image analysis.

extended_search_area_piv The implementation of the one-step direct correlation with different size of the interrogation window and the search area.

The openpiv.filters module

The openpiv.filters module contains some filtering/smoothing routines.

gaussian(u, v, size) Smooths the velocity field with a Gaussian kernel.
_gaussian_kernel(size) A normalized 2D Gaussian kernel array
replace_outliers(u, v[, method, n_iter, ...]) Replace nans in an velocity field using an iterative image inpainting algorithm.

The openpiv.validation module

A module for spurious vector detection.

global_val(u, v, u_thresholds, v_thresholds) Eliminate spurious vectors with a global threshold.
sig2noise_val(u, v, sig2noise[, threshold]) Eliminate spurious vectors from cross-correlation signal to noise ratio.
global_std(u, v[, std_threshold]) Eliminate spurious vectors with a global threshold defined by the standard deviation

The openpiv.scaling module

Scaling utilities

uniform(x, y, u, v, scaling_factor) Apply an uniform scaling