calculate_metric_per_timestep_and_average#

mhm_tools.common.metrics.metrics_handler.calculate_metric_per_timestep_and_average(map1, map2, func, *args, **kwargs)[source]#

Apply func to matching 2D timesteps of two 3D arrays,then average the per-timestep results.

Parameters:
  • func (callable) – Function applied to matching 2D timestep slices from both arrays.

  • map1 (numpy.ndarray) – observed data 3D array with shape (time, lat, lon).

  • map2 (numpy.ndarray) – simulated data 3D array with shape (time, lat, lon).

  • *args – Additional positional arguments passed to func.

  • **kwargs – Additional keyword arguments passed to func.

Returns:

Mean metric values over all timesteps.

Return type:

numpy.ndarray