ptypy.utils.array_utils.switch_orientation#

ptypy.utils.array_utils.switch_orientation(A, orientation, center=None)#

Switches orientation of Array A along the last two axes (-2,-1)

Parameters:
  • A (array-like) – input array, must be at least twodimensional

  • orientation (tuple or int) –

    3-tuple of booleans (transpose,flipud,fliplr). If integer, value is converted according to binary representation:

    0: [False, False, False] 1: [False, False, True] 2: [False, True, False] 3: [False, True, True] 4: [True, False, False] 5: [True, False, True] 6: [True, True, False] 7: [True, True, True]

  • center (tuple, optional) – move this coordinate alomg with the transformations

Returns:

  • out (ndarray) – A view of A where either rows, columns and axis may be reversed

  • center (tuple) – new center