rotate_coordinates_about

sofia_redux.instruments.forcast.rotate.rotate_coordinates_about(coordinates, center, angle, shift=None, inverse=False)[source]

Rotate the coordinates about a center point by a given angle.

The forward transform is given by:

rotated = rotate(coordinates + shift - center, angle) + center

The inverse transform is given by:

coordinates = rotate(rotated - center, -angle) + center - shift
Parameters:
coordinatesnumpy.ndarray

The coordinates to rotate of shape (2, shape,) where coordinates[0] contains the y-coordinates, and coordinates[1] contains the x-coordinates (numpy convention).

centernumpy.ndarray

The coordinate about which to perform the rotation of shape (2,) in (y, x) order (numpy convention).

angleint or float

The angle in degrees by which to rotate the coordinates.

shiftnumpy.ndarray, optional

An optional shift to apply to the coordinates of shape (

inversebool, optional

If True, perform the inverse rotation (rotate by -angle).

Returns:
rotated_coordinatesnumpy.ndarray (float)

The rotated coordinates of shape (2, shape,).