dctools.metrics.oceanbench_metrics.DCMetric

class dctools.metrics.oceanbench_metrics.DCMetric(**kwargs)

Abstract Base Class for Data Challenge Metrics.

Parameters:

kwargs (Any)

__init__(**kwargs)

Initialize the DCMetric.

Parameters:

**kwargs (Any) – Configuration parameters for the metric. Common arguments include: - plot_result (bool): Whether to generate plots. - minimum_latitude (float): Min lat bound. - maximum_latitude (float): Max lat bound. - minimum_longitude (float): Min lon bound. - maximum_longitude (float): Max lon bound. - spatial_resolution (float): Spatial resolution. - small_scale_cutoff_km (float): Cutoff for spectral analysis.

Return type:

None

Methods

__init__(**kwargs)

Initialize the DCMetric.

compute(pred_data[, ref_data])

Compute the metric wrapper (includes preprocessing).

compute_metric(pred_data[, ref_data])

Compute the core metric value.

get_metric_name()

Return the name of the metric.

abstractmethod compute(pred_data, ref_data=None, **kwargs)

Compute the metric wrapper (includes preprocessing).

Parameters:
  • pred_data (xr.Dataset) – Prediction dataset.

  • ref_data (xr.Dataset, optional) – Reference dataset.

  • kwargs (Any)

Return type:

Any

abstractmethod compute_metric(pred_data, ref_data=None, **kwargs)

Compute the core metric value.

Parameters:
  • pred_data (xr.Dataset) – Prediction dataset.

  • ref_data (xr.Dataset) – Reference dataset.

  • kwargs (Any)

Return type:

Any

get_metric_name()

Return the name of the metric.

Returns:

The name of the metric.

Return type:

str