separability_matrix#

astropy.modeling.separable.separability_matrix(transform)[source]#

Compute the correlation between outputs and inputs.

Parameters:
transformModel

A (compound) model.

Returns:
separable_matrixndarray

A boolean correlation matrix of shape (n_outputs, n_inputs). Indicates the dependence of outputs on inputs. For completely independent outputs, the diagonal elements are True and off-diagonal elements are False.

Examples

>>> from astropy.modeling.models import Shift, Scale, Rotation2D, Polynomial2D
>>> separability_matrix(Shift(1) & Shift(2) | Scale(1) & Scale(2))
    array([[ True, False], [False,  True]]...)
>>> separability_matrix(Shift(1) & Shift(2) | Rotation2D(2))
    array([[ True,  True], [ True,  True]]...)
>>> separability_matrix(Shift(1) & Shift(2) | Mapping([0, 1, 0, 1]) |         Polynomial2D(1) & Polynomial2D(2))
    array([[ True,  True], [ True,  True]]...)
>>> separability_matrix(Shift(1) & Shift(2) | Mapping([0, 1, 0, 1]))
    array([[ True, False], [False,  True], [ True, False], [False,  True]]...)