metpy.calc.
unit_vectors_from_cross_section
Calculate the unit tanget and unit normal vectors from a cross-section.
Given a path described parametrically by \(\vec{l}(i) = (x(i), y(i))\), we can find the unit tangent vector by the formula:
From this, because this is a two-dimensional path, the normal vector can be obtained by a simple \(\frac{\pi}{2}\) rotation.
cross (xarray.DataArray) – The input DataArray of a cross-section from which to obtain latitudes
xarray.DataArray
index (str, optional) – A string denoting the index coordinate of the cross section, defaults to ‘index’ as set by metpy.interpolate.cross_section
metpy.interpolate.cross_section
unit_tangent_vector, unit_normal_vector (tuple of numpy.ndarray) – Arrays describing the unit tangent and unit normal vectors (in x,y) for all points along the cross section
numpy.ndarray