icon_grid

ICON native grid helper functions.

Functions

get_remap_coeffs(grid_uuid, grid_type)

Get ICON native grid remap indices and weights.

load_boundary_idx_from_file(uuid)

Load the lateral boundary strip index from .nc format file.

load_grid_from_balfrin()

Return a grid source to load grid files when running on balfrin.

load_grid_from_file(uuid, grid_paths)

Load the clat and clon grid coordinates from .nc format file.

meteodatalab.icon_grid.get_remap_coeffs(grid_uuid: str, grid_type: Literal['rotlatlon', 'geolatlon']) Dataset[source]

Get ICON native grid remap indices and weights.

Parameters:
  • grid_uuid (str) – The UUID of the horizontal grid in hex format.

  • grid_type (str) – Type of grid to remap to.

Raises:

KeyError – If the UUID is not found in the GRID_ID constant.

Returns:

Dataset of the remap indices and weights.

Return type:

xarray.Dataset

meteodatalab.icon_grid.load_boundary_idx_from_file(uuid: UUID) DataArray[source]

Load the lateral boundary strip index from .nc format file.

Parameters:

uuid (UUID) – The UUID of the horizontal grid as specified in the GRIB metadata.

Returns:

Lateral boundary strip index for the given grid.

Return type:

xr.DataArray

meteodatalab.icon_grid.load_grid_from_balfrin() Callable[[UUID], dict[str, DataArray]][source]

Return a grid source to load grid files when running on balfrin.

meteodatalab.icon_grid.load_grid_from_file(uuid: UUID, grid_paths: dict[UUID, Path]) dict[str, DataArray][source]

Load the clat and clon grid coordinates from .nc format file.

Parameters:
  • uuid (UUID) – The UUID of the horizontal grid as specified in the GRIB metadata.

  • grid_paths (dict[UUID, Path]) – Dictionary mapping from horizontal grid UUID to the path where the data file is.

Raises:

KeyError – If the UUID does not match a known model.

Returns:

Dataset containing clon and clat coordinates of the ICON grid cell centers for the model.

Return type:

dict[str, xr.DataArray]