rotate90

sofia_redux.toolkit.image.adjust.rotate90(image, direction)[source]

Replicates IDL rotate function

In the table below, (X0, Y0) indicates the original subscripts, and (X1, Y1) are the subscripts of the resulting array. The notation Y0 indicates a reversal of the Y axis, Y1 = Ny - Y0 - 1.

Direction

Transpose?

AntiClockwise

X1

Y1

0

N

0

X0

Y0

1

N

90

-Y0

X0

2

N

180

-X0

-Y0

3

N

270

Y0

-X0

4

Y

0

Y0

X0

5

Y

90

-X0

Y0

6

Y

180

-Y0

-X0

7

Y

270

X0

-Y0

Parameters:
imagearray_like

(N, M) 2 dimensional array to rotate.

directionint

See above for rotate value effect. Direction is taken as modulo 8.

Returns:
numpy.ndarray