earthkit.meteo.regimes.ModulatedPatterns

class earthkit.meteo.regimes.ModulatedPatterns(labels, grid, base_patterns, modulator, xp=None)

Bases: Patterns

Patterns generated from a set of base patterns and a custom scalar function.

Parameters:
  • labels (Iterable[str]) – Labels for the patterns.

  • grid (dict) – Specification of the grid on which the patterns live.

  • base_patterns (array_like) – Base patterns (one for each label, stacked into a single array).

  • modulator (Callable[Any,array_like]) – Scalar function to modulate the base patterns. The parameters required to evaluate this function must be provided when projecting as patterns_extra_coords kwargs.

  • xp (array_namespace, optional) – The array namespace used for the patterns and their generation. By default, it is inferred from the type of base_patterns.

property grid: dict

The grid on which the patterns live.

Return type:

dict

property labels

Labels of the patterns.

property ndim: int

Number of dimensions/axes in a single pattern.

Return type:

int

patterns(**patterns_extra_coords)

Evaluated patterns for a given input to the modulator function.

Parameters:

**patterns_extra_coords (dict[str,Any], optional) – Keyword arguments for the modulator function.

Returns:

Modulated patterns.

Return type:

Mapping[str,array_like]

property shape

Shape of a single pattern.

property size: int

Number of grid points in a single pattern.

Return type:

int

property xp

Array namespace of the generated patterns.