pysdic.compute_residuals#
- compute_residuals(analysis, pairing, integration_points, *, gl_correction=None, gray_level_groups=None)[source]#
Compute the gray levels of material points in the two views of a pairing and their residual, for the current state of the analysis, with the gray level correction of
pysdic.SDICCorrelationTerm.The positions of the integration points at the frames of the pairing are interpolated from the deformed vertices, projected in the views to interpolate the images, and corrected with
gl_correction(same options and same functions as the correlation term):\[r = g'_2 - g'_1, \qquad g_k = [I_k \circ P_k](\vec{X} + \vec{u}_k)\]With the same integration points,
gl_correctionandgray_level_groups, the residuals are those of apysdic.SDICCorrelationTermwithout the weights of the points. This function does not need any unknown (e.g. a pairing between two reference frames); to evaluate the residuals of a term for a vector of unknowns, usepysdic.SDICCorrelationTerm.compute_residuals().Note
The occlusions are not taken into account (as in the correlation term): a point hidden in a view still gets the gray level of the image at its projection.
- Parameters:
analysis (
pysdic.SDICAnalysis) – The analysis, with the displacements of the frames of the pairing set.pairing (
pysdic.Pairing) – The two views to compare.integration_points (
pysdic.IntegrationPoints) – The material points, all located in the mesh of the analysis.gl_correction (Optional[Mapping[str, Any]], optional) – The gray level correction, as in
pysdic.SDICCorrelationTerm. None (default): raw gray levels.gray_level_groups (Optional[
pysdic.GrayLevelGroups], optional) – The groups of the correction, as inpysdic.SDICCorrelationTerm. By default, computed fromgl_correction["neighborhood"].
- Returns:
The gray levels, the residuals and the projections of the points in the two views.
- Return type:
- Raises:
ValueError – If the pairing is not valid in the analysis, the integration points are not consistent with the mesh or not all located, a displacement of the pairing is not set, or the gray level options are not valid.