polaris.mesh.info.is_spherical
- polaris.mesh.info.is_spherical(ds: Dataset, default: bool | None = None) bool[source]
Whether an MPAS mesh is on a sphere, based on the
on_a_sphereglobal attribute ofds- Parameters:
ds (xarray.Dataset) – A dataset with the
on_a_sphereattribute, which MPAS meshes always give as'YES'or'NO'default (bool, optional) – The value to return if
dshas noon_a_sphereattribute. By default, a missing attribute is an error, since a mesh dataset without it is invalid and guessing either way leads to silently wrong results. A step assembling a dataset that has not picked up the attribute yet may pass an explicit default.
- Returns:
spherical (bool) – Whether the mesh is on a sphere
- Raises:
ValueError – If
dshas noon_a_sphereattribute and nodefaultwas given, or if the attribute is neither'YES'nor'NO'