Workflows (pysdic.workflows)#

The submodule pysdic.workflows is a bank of procedures built on the API of pysdic: each workflow chains the base objects and functions (analyses, terms, cameras, meshes, …) to solve a recurring task of a SDIC analysis. The workflows are not part of the base API: they are called from their namespace,

from pysdic.workflows import create_grid_integration_points, measure_reference_shape

so that the base API stays small while new workflows can be added freely.

Conventions of a workflow:

  • it only uses the public API of pysdic: it can be read as an example of the API;

  • it does not modify its inputs (in particular the analysis), except when it is its purpose and it is documented: the displacements computed by a workflow are returned, and written by the user with pysdic.SDICAnalysis.set_displacement();

  • its results are returned as a frozen dataclass named <Name>Result when there are several outputs.

See also

The gallery section of the workflows gives an example of each family of workflows.

Integration points#

Prepare the material points of a correlation: a regular grid of points in each element, sized from the number of pixels per element, and the selection of the points visible in all the views.

Initialization of the displacements#

Estimate the displacement of a frame before the correlation, which needs an initial guess close to the solution.

Shape at the reference frame#

The mesh of an analysis (e.g. from a CAD model) is never exactly at the position of the specimen: its shape at the reference frame is measured with the stereo pairings of this frame, before any measure of displacement.

Tools on the displacements#

Process the displacements of the frames of an analysis. The functions return a dictionary {frame: displacement}, the analysis is not modified.

from pysdic.workflows import compute_interpolated_displacements

interpolated = compute_interpolated_displacements(analysis, missing_frames, measured_frames)
for frame, displacement in interpolated.items():
    analysis.set_displacement(frame, displacement)

Quality control#

Check a measure after its convergence: the residuals per element (reflections, occlusions, damaged speckle) and the uncertainty of the displacements.