-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
211 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.. _node-attributes: | ||
.. _graphs-node_attributes: | ||
|
||
#################### | ||
Nodes - Attributes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.. _node-coordinates: | ||
.. _graphs-node_coordinates: | ||
|
||
##################### | ||
Nodes - Coordinates | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. _modules-masks: | ||
|
||
####### | ||
Masks | ||
####### | ||
|
||
.. automodule:: anemoi.graphs.generate.masks | ||
:members: | ||
:no-undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
.. _usage-limited_area: | ||
|
||
############################# | ||
Limited Area Modeling (LAM) | ||
############################# | ||
|
||
Anemoi Graphs brings another level of flexibility to the user by | ||
allowing the definition of limited area graphs. | ||
|
||
************************************************ | ||
Cut out regional dataset into a global dataset | ||
************************************************ | ||
|
||
In this case, the user can use 2 datasets to build the data nodes | ||
combining nodes from the LAM dataset and the global dataset (as boundary | ||
forcings). The class `CutOutZarrDatasetNodes` allows this functionality: | ||
|
||
.. literalinclude:: yaml/cutout_zarr.yaml | ||
:language: yaml | ||
|
||
The `CutOutZarrDatasetNodes` supports an optional `thinning` argument | ||
which can be used to sampling points from the regional dataset to reduce | ||
computation during development stage. | ||
|
||
In addition, this node builder class will create an additional node | ||
attribute with a mask showing which node correspond to each of the 2 | ||
datasets. | ||
|
||
.. code:: console | ||
>>> graph | ||
HeteroData( | ||
data={ | ||
x=[40320, 2], | ||
node_type='ZarrDatasetNodes', | ||
area_weight=[40320, 1], | ||
cutout=[40320, 1], | ||
} | ||
) | ||
********************************************* | ||
Define hidden nodes over region of interest | ||
********************************************* | ||
|
||
Once the ``data`` nodes are defined, the user can define the hidden | ||
nodes only over the region of interest. In this case, the area of | ||
interest is defined by the ``data`` nodes masked by the ``cutout`` | ||
attribute. | ||
|
||
.. literalinclude:: yaml/limited_area_nodes.yaml | ||
:language: yaml | ||
|
||
.. code:: console | ||
>>> graph | ||
HeteroData( | ||
data={ | ||
x=[40320, 2], | ||
node_type='ZarrDatasetNodes', | ||
area_weight=[40320, 1], | ||
cutout=[40320, 1], | ||
}, | ||
hidden={ | ||
x=[10242, 2], | ||
node_type='TriNodes', | ||
} | ||
) | ||
************** | ||
Adding edges | ||
************** | ||
|
||
The user may define the edges using the same configuration as for the | ||
global graphs. | ||
|
||
.. literalinclude:: yaml/global.yaml | ||
:language: yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
nodes: | ||
data: | ||
node_builder: | ||
_target_: anemoi.graphs.nodes.CutOutZarrDatasetNodes | ||
lam_dataset: /path/to/regional-dataset.zarr | ||
forcing_dataset: /path/to/global-dataset.zarr | ||
thinning: 25 # optional | ||
attributes: ... | ||
hidden: ... | ||
|
||
edges: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
nodes: | ||
data: ... | ||
hidden: | ||
node_builder: | ||
_target_: anemoi.graphs.nodes.LimitedAreaTriNodes | ||
resolution: 5 | ||
reference_node_name: data | ||
mask_attr_name: cutout | ||
|
||
edges: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters