polywarp

sofia_redux.toolkit.image.warp.polywarp(xi, yi, xo, yo, order=1)[source]

Performs polynomial spatial warping

Fit a function of the form xi[k] = sum over i and j from 0 to degree of: kx[i,j] * xo[k]^i * yo[k]^j yi[k] = sum over i and j from 0 to degree of: ky[i,j] * xo[k]^i * yo[k]^j

Parameters:
xiarray-like of float

x coordinates to be fit as a function of xi, yi

yiarray-like of float

y coordinates to be fit as a function of xi, yi

xoarray-like of float

x independent coorindate.

yoarray-like of float

y independent coordinate

orderint, optional

The polynomial order to fit. The number of coordinate pairs must greater than or equal to (order + 1)^2.

Returns:
kx, kynumpy.ndarray, numpy.ndarray

Array coefficients for xi, yi as a function of (xo,yo). shape = (degree+1, degree+1)

Notes

xi, yi, xo, and yo must all have the same length Taken from https://github.com/tvwenger/polywarp/blob/master/Polywarp.py