is_separable#

astropy.modeling.is_separable(transform)[source]#

A separability test for the outputs of a transform.

Parameters:
transformModel

A (compound) model.

Returns:
is_separablendarray

A boolean array with size transform.n_outputs where each element indicates whether the output is independent and the result of a separable transform.

Examples

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