rotate_data

pySurf.data2D.rotate_data(data, x=None, y=None, ang=0, k=None, center=None, fill_value=nan, usepoints=False, *args, **kwargs)

Rotate anticlockwise by an angle in degree.

Non optimized version using points functions. 2018/10/31 added k parameters allowing 90 deg rotations with np.rot90. k is the number of anticlockwise rotations about center. Note there is not resampling, so it can be inaccurate if center is not on pixel center.

rotate_Data was intended to work using scipy.ndimage.interpolation.rotate but this failed. Added 2018/12/12 args and kwargs are passed to the function that handles the rotation.

See also comments on resampling in data2D.apply_transform.

rot90 determination of rotated axis can probably be extended to general case, but in the meanwhile the implementation based on points offers an accurate interpolation (even if slower),

can be enabled setting flag usepoints.