def to_cartesian(r_dev, pos, normal):
""" Transform radial deviations from an ellipsoidal grid to Cartesian
Parameters
----------
r_dev : ndarray, shape (N, )
Array containing the N radial deviations from the ellipse. r < 0 means
inside the ellipse.
pos : ndarray, shape (2, N)
The N (y, x) positions of the ellipse (as given by ``ellipse_grid``)
normal : ndarray, shape (2, N)
The N (y, x) unit normals of the ellipse (as given by ``ellipse_grid``)
"""
coord_new = pos + r_dev * normal
coord_new = coord_new[:, np.isfinite(coord_new).all(0)]
return coord_new
评论列表
文章目录