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.

imread(filename) Read an image file into a numpy array
save(x, y, u, v, mask, filename[, fmt, ...]) Save flow field to an ascii file.
display(message) Display a message to standard output.
display_vector_field(filename, **kw) Displays quiver plot of the data stored in the file
Multiprocesser(data_dir, pattern_a, pattern_b)

The openpiv.pyprocess module

This module contains a pure python implementation of the basic cross-correlation algorithm for PIV image processing.

normalize_intensity(window) Normalize interrogation window by removing the mean value.
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, width]) Find the value of the second largest peak.
find_subpixel_peak_position(corr[, ...]) Find subpixel approximation of the correlation peak.
piv(frame_a, frame_b[, window_size, ...]) Standard PIV cross-correlation algorithm.

The openpiv.process module

This module is dedicated to 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.
CorrelationFunction
get_coordinates Compute the x, y coordinates of the centers of the interrogation windows.
get_field_shape Compute the shape of the resulting flow field.
correlate_windows Compute correlation function between two interrogation windows.
normalize_intensity Normalize interrogation window by removing the mean value.

The openpiv.lib module

A module for various utilities and helper functions

sincinterp
replace_nans Replace NaN elements in an array using an iterative image inpainting algorithm.

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, max_iter, ...]) Replace invalid vectors 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
local_median_val(u, v, u_threshold, v_threshold) Eliminate spurious vectors with a local median threshold.

The openpiv.scaling module

Scaling utilities

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