pycvcam.TransformModal._transform#
- TransformModal._transform(points, *, dx=False, dp=False, **kwargs)[source]#
Apply the modal transformation to a set of input points.
This method simply call the original transformation’s
_transformmethod, since the parameters of the original transformation are updated to reflect the modal coefficients.The Jacobian matrice with respect to the modal coefficients can be computed using the following formula
\[\frac{\partial T}{\partial \alpha_i} = \frac{\partial T}{\partial p} \cdot M^T\]where \(\frac{\partial T}{\partial p}\) is the Jacobian with respect to the original parameters, and \(M\) is the modes matrix of shape (n_modes, n_params).
- Parameters:
points (numpy.ndarray) – The input points to be transformed. Shape (n_points, input_dim).
dx (bool, optional) – If True, compute the Jacobian of the transformed points with respect to the input points. Default is False.
dp (bool, optional) – If True, compute the Jacobian of the transformed points with respect to the parameters of the transformation. Default is False.
**kwargs – Additional keyword arguments to be passed to the original transformation’s
_transformmethod.
- Returns:
A tuple containing:
transformed_points: The transformed points of shape (n_points, output_dim).jacobian_dx: The Jacobian matrix with respect to the input points of shape (n_points, output_dim, input_dim) ifdxis True, otherwise None.jacobian_dp: The Jacobian matrix with respect to the modal coefficients of the transformation of shape (n_points, output_dim, n_modes) ifdpis True, otherwise None.
- Return type:
Tuple[numpy.ndarray, Optional[numpy.ndarray], Optional[numpy.ndarray]]