scopesim.optics.image_plane_utils.affine_map

Contents

scopesim.optics.image_plane_utils.affine_map#

scopesim.optics.image_plane_utils.affine_map(input, matrix=None, rotation_angle: float = 0.0, shear_angle: float = 0.0, scale_factor=None, reshape: bool = True, spline_order: int = 3)#

Apply an affine transformation matrix to an image around its centre.

Similar functionality to scipy.ndimage.rotate but for the affine_transformation function

Either a 2x2 affine transformation matrix can be supplied, or the rotation, shear, and scaling values which are the basis of an affine transformation.

Parameters:
  • input (array_like) – The input array

  • matrix (ndarray, optional) – A 2x2 affine transformation matrix

  • rotation_angle (float, optional) – [deg] If matrix==None, a rotation matrix is built from this angle

  • shear_angle (float, optional) – [deg] If matrix==None, a y-axis shear matrix is built from this angle

  • scale_factor (list, array) – [mx, my] If matrix==None, a scaling matrix is built from this list

  • reshape (bool, optional) – If True, the array is re-sized to contain the whole transformed image

  • spline_order (int, optional) – Default is 3. Spline interpolation order

Returns:

output – The new mapping of the image

Return type:

array-like