cart2pol#

movement.utils.vector.cart2pol(data)[source]#

Transform Cartesian coordinates to polar.

Parameters:

data (xarray.DataArray) – The input data containing space as a dimension, with x and y in the dimension coordinate.

Returns:

An xarray DataArray containing the polar coordinates stored in the space_pol dimension, with rho and phi in the dimension coordinate. The angles phi returned are in radians, in the range [-pi, pi].

Return type:

xarray.DataArray