forcings
- class anemoi.inference.forcings.Forcings(context: TensorHandler)
Bases:
ABCRepresents a forcings provider for the model.
Initialize the Forcings object.
- Parameters:
context (TensorHandler) – The context for the forcings.
- class anemoi.inference.forcings.ComputedForcings(context: TensorHandler, variables: list[str], mask: Any)
Bases:
ForcingsCompute forcings like cos_julian_day or insolation.
Initialize the ComputedForcings object.
- Parameters:
context (TensorHandler) – The context for the forcings.
variables (List[str]) – The list of variables to compute.
mask (Any) – The mask to apply to the forcings.
- class anemoi.inference.forcings.CoupledForcings(context: TensorHandler, input: Input, variables: list[str], mask: ndarray[tuple[Any, ...], dtype[Any]])
Bases:
ForcingsRetrieve forcings from the input.
Initialize the CoupledForcings object.
- Parameters:
context (TensorHandler) – The context for the forcings.
input (Input) – The input object.
variables (List[str]) – The list of variables to retrieve.
mask (IntArray) – The mask to apply to the forcings.
- load_forcings_array(dates: list[str | datetime | int], current_state: dict[str, Any]) ndarray[tuple[Any, ...], dtype[Any]]
Load the forcings for the given dates.
- Parameters:
dates (List[Any]) – The list of dates for which to load the forcings.
current_state (State) – The current state of the model.
- Returns:
The loaded forcings as a numpy array.
- Return type:
- class anemoi.inference.forcings.ConstantForcings(context: TensorHandler, input: Input, variables: list[str], mask: ndarray[tuple[Any, ...], dtype[Any]])
Bases:
CoupledForcingsInitialize the CoupledForcings object.
- Parameters:
context (TensorHandler) – The context for the forcings.
input (Input) – The input object.
variables (List[str]) – The list of variables to retrieve.
mask (IntArray) – The mask to apply to the forcings.
- class anemoi.inference.forcings.BoundaryForcings(context: TensorHandler, input: DatasetInput, variables: list[str], variables_mask: ndarray[tuple[Any, ...], dtype[Any]])
Bases:
ForcingsRetrieve boundary forcings from the input.
Initialize the BoundaryForcings object.
- Parameters:
context (TensorHandler) – The context for the forcings.
input (DatasetInput) – The input object.
variables (List[str]) – The list of variables to retrieve.
variables_mask (IntArray) – The mask to apply to the forcings.