Edge attributes
- class anemoi.graphs.edges.attributes.EdgeDirection(norm: str | None = None, luse_rotated_features: bool = True)
Bases:
BaseEdgeAttributeEdge direction feature.
This class calculates the direction of an edge using either: 1. Rotated features: The target nodes are rotated to the north pole to compute the edge direction. 2. Non-rotated features: The direction is computed as the difference in latitude and longitude between the source and target nodes.
The resulting direction is represented as a unit vector starting at (0, 0), with X and Y components.
- norm
Normalisation method. Options: None, “l1”, “l2”, “unit-max”, “unit-range”, “unit-std”.
- Type:
Optional[str]
- compute(graph, source_name, target_name)
Compute direction of all edges.
- class anemoi.graphs.edges.attributes.EdgeLength(norm: str | None = None, invert: bool = False)
Bases:
BaseEdgeAttributeEdge length feature.
- norm
Normalisation method. Options: None, “l1”, “l2”, “unit-max”, “unit-range”, “unit-std”.
- Type:
Optional[str]
- compute(graph, source_name, target_name)
Compute edge lengths attributes.
- get_raw_values(graph: HeteroData, source_name: str, target_name: str) ndarray
Compute haversine distance (in kilometers) between nodes connected by edges.
- post_process(values: ndarray) Tensor
Post-process edge lengths.