colour.utilities.orient

colour.utilities.orient(a, orientation)[source]

Orient given array according to given orientation value.

Parameters
  • a (array_like) – Array to perform the orientation onto.

  • orientation (str, optional) – {‘Flip’, ‘Flop’, ‘90 CW’, ‘90 CCW’, ‘180’} Orientation to perform.

Returns

Oriented array.

Return type

ndarray

Examples

>>> a = np.tile(np.arange(5), (5, 1))
>>> a
array([[0, 1, 2, 3, 4],
       [0, 1, 2, 3, 4],
       [0, 1, 2, 3, 4],
       [0, 1, 2, 3, 4],
       [0, 1, 2, 3, 4]])
>>> orient(a, '90 CW')
array([[0, 0, 0, 0, 0],
       [1, 1, 1, 1, 1],
       [2, 2, 2, 2, 2],
       [3, 3, 3, 3, 3],
       [4, 4, 4, 4, 4]])
>>> orient(a, 'Flip')
array([[4, 3, 2, 1, 0],
       [4, 3, 2, 1, 0],
       [4, 3, 2, 1, 0],
       [4, 3, 2, 1, 0],
       [4, 3, 2, 1, 0]])