metobs_toolkit.obstype_modeldata.compute_amplitude#
- compute_amplitude(modelobs_vectorfield, df)[source]#
Compute amplitude of 2D vectorfield components.
The amplitude column is added to the dataframe and a new ModelObstype, representing the amplitude is returned. All attributes wrt the units are inherited from the ModelObstype_vectorfield.
- Parameters:
modelobs_vectorfield (ModelObstype_Vectorfield) – The vectorfield observation type to compute the vector amplitudes 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 amplitudes.
amplitude_obstype (ModelObstype) – The (scalar) Modelobstype representation of the amplitudes.