diff --git a/docs/gridspec.rst b/docs/gridspec.rst index 2979bc1..3cfda6d 100644 --- a/docs/gridspec.rst +++ b/docs/gridspec.rst @@ -54,3 +54,37 @@ Example: .. code-block:: {"grid": [1, 1]} + + + +HEALPix nested grid +------------------------------------------ + +The ``grid`` format is:: + + HXXX + +The ``ordering`` must be set to ``"nested"``. For details about this grid, see `here `_. + +Example: + +.. code-block:: + + {"grid": "H512", "ordering": "nested"} + + +HEALPix ring grid +------------------------------------------ + +The ``grid`` format is:: + + HXXX + +The ``ordering`` can be omitted or set to ``"ring"``. For details about this grid, see `here `_. + +Example: + +.. code-block:: + + {"grid": "H512", "ordering": "ring"} + {"grid": "H512"} diff --git a/earthkit/regrid/sphinxext/generate_inventory_rst.py b/earthkit/regrid/sphinxext/generate_inventory_rst.py index c606cb6..a4d31c0 100644 --- a/earthkit/regrid/sphinxext/generate_inventory_rst.py +++ b/earthkit/regrid/sphinxext/generate_inventory_rst.py @@ -23,7 +23,12 @@ def to_str(gs): if isinstance(gs, str): return gs - return {"grid": gs["grid"]} + + grid = gs["grid"] + if isinstance(grid, str) and grid.startswith("H"): + return {"grid": gs["grid"], "ordering": gs["ordering"]} + else: + return {"grid": gs["grid"]} def make_gs_block(source, target):