pisces.models.core.utils.inspect_model_coordinate_system#

pisces.models.core.utils.inspect_model_coordinate_system(path: str | Path, registry: Registry | None = None)[source]#

Inspect the coordinate system of a model without fully instantiating the model.

This function:

  1. Opens the model’s HDF5 file.

  2. Loads the /GRID group using load_grid().

  3. Returns the grid’s coordinate_system object.

Parameters:
  • path (str or Path) – Path to the HDF5 file containing the model.

  • registry (Registry, optional) – Registry mapping grid class names to their corresponding classes. If None, the default Pisces grid registry will be used.

Returns:

The coordinate system instance associated with the model’s grid.

Return type:

CoordinateSystem

Raises:
  • FileNotFoundError – If the file does not exist or is not a file.

  • KeyError – If the file does not contain a /GRID group.

  • AttributeError – If the loaded grid does not define a coordinate_system attribute.