pre_processors
extract
- class anemoi.inference.pre_processors.extract.ExtractBase(context: Context, metadata: Metadata)
Bases:
ProcessorBase class for pre-processors that extract data from the state.
- class anemoi.inference.pre_processors.extract.ExtractSlice(context: Context, metadata: Metadata, *slice_args: int)
Bases:
ExtractBaseExtract a subset of points from the state based on a slice.
- Parameters:
context (Context) – The context in which the processor is running.
metadata (Metadata) – Metadata corresponding to the dataset this processor is handling.
slice_args (int) – Arguments to create a slice object. This can be a single integer or a tuple of integers representing the start, stop, and step of the slice.
forward_transform_filter
mask
- class anemoi.inference.pre_processors.mask.MaskValues(context: Context, *, mask: str, param: str | list[str], **kwargs)
Bases:
ProcessorReplace values in a field with nans from a specified mask in the supporting arrays.
Initialize the MaskValues processor.
- Parameters:
context (Context) – The context in which the processor operates.
mask (str) – The mask to apply to the fields from the supporting arrays or a path to a mask file. Can be npy, grib, or netCDF file.
param (str or list of str) – The parameter(s) to which the mask should be applied.
kwargs (Any) – Additional keyword arguments to pass to the apply_mask_to_param filter. - mask_value: The value in the mask that indicates where to apply the mask (default: None). - threshold_operator: The operator to use for thresholding the mask if using a threshold (default: None). - threshold: The threshold value for the mask if using operator (default: None).