earthkit.meteo.regimes.xarray.project

earthkit.meteo.regimes.xarray.project(field, patterns, weights, **patterns_extra_coords)

Project onto the given patterns.

Parameters:
  • field (xarray.DataArray) – Input field(s) to project. The patterns are projected onto the trailing dimensions of the input fields.

  • patterns (earthkit.meteo.regimes.Patterns) – Patterns to project on.

  • weights (xarray.DataArray) – Weights for the summation in the projection. Weights are normalised before application so the sum of weights over the domain equals 1.

  • **patterns_coords (dict[str,str], optional) – Mapping of coordinate names to keyword arguments of the pattern generation function. Only coordinates that are dimensions of field can be mapped.

Returns:

The projection(s) for each pattern, with "pattern" as a new leftmost dimension and all dimensions of field following except for the dimensions reduced in the projection (i.e., the spatial dimensions of the patterns are missing on the right).

Return type:

xarray.DataArray