polaris.ocean.global_stats_names.discover_fields

polaris.ocean.global_stats_names.discover_fields(ds, model, time_mean_period=None)[source]

Get the fields a dataset holds global statistics for

This is the inverse of the name construction: a variable whose name ends in one of the statistics the model computes is a statistic of whatever comes before it. It is what lets a step plot what a simulation wrote rather than what someone thought it would write.

Parameters:
  • ds (xarray.Dataset) – The global statistics, with the names the model gave them

  • model ({'mpas-ocean', 'omega'}) – The ocean model that wrote the output

  • time_mean_period (str, optional) – The period of the time reduction to look for. The default finds the snapshots, and a dataset holding both is not searched for the wrong one.

Returns:

fields (list of str) – The model’s own name for each field, in the order its variables appear in the dataset, without repeats