rex.temporal_stats.temporal_stats.circular_mean

circular_mean(data, weights=None, degrees=True, axis=0, exponential_weights=True)[source]

Computed the ciruclar average. if provided compute the weighed average with the given weights. For example, if averaging wind direction with wind speed as weights, wind directions that occur at higher wind speeds will have a larger weight of the final mean value.

Parameters:
  • data (ndarray) – Data to average

  • weights (ndarray, optional) – Weights to apply to data during averaging, must be of the same shape as data, by default None

  • degree (bool, optional) – Flag indicating that data is in degrees and needs to be converted to/from radians during averaging. By default True

  • axis (int, optional) – Axis to compute average along, by default 0 which will produce site averages

  • norm_weights (: bool, optional) – Flag to normalize weights, by default True

  • exponential_weights (bool) – Flag to convert weights to exponential, by default True

Returns:

mean (ndarray) – Weighted circular mean along the given axis