:py:mod:`gnome.utilities.transforms` ==================================== .. py:module:: gnome.utilities.transforms Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: gnome.utilities.transforms.r_theta_to_uv_current gnome.utilities.transforms.uv_to_r_theta_current gnome.utilities.transforms.r_theta_to_uv_wind gnome.utilities.transforms.uv_to_r_theta_wind .. py:function:: r_theta_to_uv_current(r_theta) Converts array of current values given with magnitude, direction into (u,v) wind values. Current from 0 deg is (u,v) = (0,1), from 45 deg (u,v) = (1,1) i.e. rotate clockwise from North. In addition, (u,v) represents the direction the current moves towards. :param r_theta: NX2 numpy array containing r = r_theta[:,0], theta = r_theta[:,1]. Theta is in degrees between 0 and 360. :returns: NX2 numpy array containing the corresponding uv Cartesian velocity vector .. py:function:: uv_to_r_theta_current(uv) Converts array of current values given with (u,v) current values to magnitude, direction. Current from 0 deg is (u,v) = (0,1), from 45 deg (u,v) = (1,1) i.e. rotate clockwise from North. In addition, (u,v) represents the direction the current blows towards :param uv: NX2 numpy array, where each row corresponds with a velocity vector :returns: NX2 numpy array containing polar coordinates r_theta .. py:function:: r_theta_to_uv_wind(r_theta) Converts array of wind values given with magnitude, direction into(u,v) wind values. Wind from 0 deg is (u,v) = (0,-1), from 45 deg (u,v) = (-1,-1) i.e. rotate clockwise from North. In addition, (u,v) represents the direction the wind blows towards :param r_theta: NX2 numpy array containing r = r_theta[:,0], theta = r_theta[:,1]. Theta is in degrees between 0 and 360. :returns: NX2 numpy array containing the corresponding uv Cartesian velocity vector .. py:function:: uv_to_r_theta_wind(uv) Converts array of wind values given with (u,v) wind values to magnitude, direction. Wind from 0 deg is (u,v) = (0,-1), from 45 deg (u,v) = (-1,-1) i.e. rotate clockwise from North. In addition, (u,v) represents the direction the wind blows towards :param uv: NX2 numpy array, where each row corresponds with a velocity vector :returns: NX2 numpy array containing polar coordinates r_theta