metobs_toolkit.obstype_modeldata.compute_angle#

compute_angle(modelobs_vectorfield, df)[source]#

Compute vector direction of 2D vectorfield components.

The direction column is added to the dataframe and a new ModelObstype, representing the angle is returned. The values represents the angles in degrees, from north in clock-wise rotation.

Parameters:
  • modelobs_vectorfield (ModelObstype_Vectorfield) – The vectorfield observation type to compute the vector directions for.

  • df (pandas.DataFrame) – The dataframe with the vector components present as columns.

Returns:

  • data (pandas.DataFrame) – The df with an extra column representing the directions.

  • amplitude_obstype (ModelObstype) – The (scalar) Modelobstype representation of the angles.